We run the analysis for an extra_src_dir by making a fake app for it,
but send in the app alone for analysis.
In there, the DAG pruning routine looks at the DAG and files submitted
and goes "this right here is a project with 99% of its apps deleted". It
then tries to prune the whole DAG except for some test files. The code
"works" simply because there's a false-positive check that makes sure
the file is on disk before removing it for the DAG.
This ends up making extra runs where ~80% of the time is spent
double-checking the false positives for file deletions.
This commit fixes this by merging in all extra_src fake apps and making them
run in a single analysis phase, meaning we only pay the cost of the DAG
pruning once for the whole project, making it faster than any sparse
repo.
There's also a small patch needed for the root-level extra src dirs;
turns out that since the context-handling in the `rebar_compiler` uses a
map to store content, running single-pass analysis clobbered entries for
a given app if they had more than one extra_src_dir in there.
I also took the time to clean up the ordering of that file.
End result should allow to look like this:
$ head -n 3 rebar3
#!/usr/bin/env escript
%% Rebar3 3.14.0-rc1
%%! +sbtu +A1
This will allow tools like mix to read the top of the file to know the
version being used in the current path (when using features that aren't
forwards-compatible) without having to invoke the tool itself.
The version (full dynamic one) is also added to the local install:
$ head -n 2 /home/ferd/.cache/rebar3/bin/rebar3
#!/usr/bin/env sh
## Rebar3 3.14.0-rc1+build.4599.ref6b0f90d
The `##` comments are used to keep a fixed width over the other form.
To be backported to 3.13.2 as well.
This commit switches the relx dependency to branch 4.0.0. It is the
first iteration of integration with relx 4.0 which adds many changes
to how relx works and how the two integrate.
rebar_relx module now creates a relx state from the relx configuration
and pass it along with all the OTP applications rebar3 knows about
which may be used in the release. This allows relx to not have
to duplicate the effort of application discovery like before.
Since this is intended to be released only when OTP-23 is released
the testing of OTP-18 has been removed.
- topsort of an app does a full analysis of all apps to come up with
their app-level DAG
- each extra_src_dir has its own analysis run
- each extra_src_dir run is simulated as being an app
- we therefore end up doing a lot of useless analysis for single app
runs
This patch notes runs with 1 or 0 apps and skips doing the topsort
analysis on them, which speeds things up further.
Closes#2108. Changes the path to be printed to a relative path
to the current directory.
Also removes the `exports_not_used` warning from the default ones,
as Tristan suggested.