If the syntax error is in a .hrl file, then the reported error message
is not as useful because it's not clear which .erl file was being
compiled. We can fix that easily by first printing what source file was
being processed. We don't change the actual error message, so this will
still work with your editor of choice for jumping to the right line.
Before
------
Success:
Compiled src/foo.erl
Failure:
include/foo.hrl:10: syntax error [...]
After
-----
Success:
Compiled src/foo.erl
Failure:
Compiling src/foo.erl failed:
include/foo.hrl:10: syntax error [...]
To avoid treating plugins' info/2 functions as commands, we catch calls
to 'rebar info'. Previously (4b8c81fb) we simply printed the help
string, but it's much more informative to print the following:
Command 'info' not understood or not applicable
Previous generate-upgrade required renames in rel/ directory:
rebar generate
...changing code...
mv rel/<release> rel/<release_prev>
rebar generate
rebar generate-upgrade previous_release=<release_prev>
With the proposed changes you can now do the same without moving things:
rebar generate # default target dir: rel/<release>
...changing code...
rebar generate target_dir=<release_new>
rebar generate-upgrade target_dir=<release_new> previous_release=<release>
rebar used to mistakenly report plain version strings like
{vsn, "1.0.0"} as follows:
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: "1.0.0"
Properly detect unknown/unsupported version terms and abort
if we encounter one.
While at it, rename a variable in vcs_vsn/3 to be non-misleading.
Rebar, when it encounters a lib_dir directive, caches the current code
path, adds the libdir(s) and returns the cached copy of the path. When
rebar has finished processing that directory, it restores the cached
path. This is problematic in the below scenario:
/(lib_dir)->G
A -> B -> C -> D -> E
\-> F -> D -> E
When rebar is finished processing B, it restores the code path to what
it was before it processed B, removing C, D, E and G from the code path.
This means when it comes to process F, neither D or E are in the code
path, so any header includes, rebar plugins or parse transforms will not
be in the code path. Without the lib_dir directive, rebar does no code
path cleanups, so everything works fine.
This change makes rebar only remove the explicit lib_dir code paths it
added and adds an inttest that replicates the above scenario.
Sometimes tags like 1.1-3-g3af5478 or d20b53f0 are encountered. The
first is the output of 'git describe', and the second is just a regular
git SHA. git fetch --tags will not pull these down, so do a full git
fetch instead.