Jon
391f3b3bec
Let DEBUG="" and QUIET="" mean disable the option
Setting DEBUG/QUIET environment variable to the empty string now acts
the same as unsetting it. Unsetting is not always easy/possible.
pirms 9 gadiem
Péter Gömöri
cc2e5f7876
Handle control sequences in formatted errors
Formatted errors can accidentally contain substrings which are control
sequences for io:format/2. This is a naive attempt to handle such cases.
One example is running xref on the following module
(assuming module m does not exist)
```
-module(handle_error).
-export([f/0]).
f() -> m:'bobby~stables'().
```
```
$ rebar3 xref
===> Verifying dependencies...
===> Compiling myapp
===> Running cross reference analysis...
escript: exception error: bad argument
in function io:format/3
called as io:format(<0.23.0>,
"\e[0;31m===> \e[1mWarning: handle_error:f/0 is unused export (Xref)\nWarning: handle_error:f/0 calls undefined function m:bobby~stables/0 (Xref)\n\n\e[0m\e[0m",
[])
in call from rebar3:handle_error/1 (/Users/gomoripeti/git/rebar3/_build/default/lib/rebar/src/rebar3.erl, line 279)
```
pirms 9 gadiem
Heinz N. Gies
5945251fc0
Make sure not to dump in api mode
pirms 9 gadiem
Heinz N. Gies
bc9746881f
Write rebar3.crashdump on errors
pirms 9 gadiem
Francisco Rojas
243e94391a
Read env var REBAR_CACHE_DIR on rebar3 only once
Instead of reading every time that rebar_dir:global_cache_dir/1 is
called
pirms 9 gadiem
alisdair sullivan
d75fa758d8
Revert "define the 'EUNIT' macro in the test profile"
This reverts commit 4c32c52b55
.
pirms 9 gadiem
alisdair sullivan
4c32c52b55
define the 'EUNIT' macro in the test profile
pirms 9 gadiem
Tristan Sloughter
8cea177377
add project_providers after initing default providers but allow overrides
pirms 9 gadiem
Tristan Sloughter
53866e148c
give new opt project_plugins providers precedence over default providers
pirms 9 gadiem
Serge Aleynikov
9cd7880069
Remove --state argument option per Tristan's comment
pirms 9 gadiem
Serge Aleynikov
cf03345486
Add a state display provider
The provider is used for debugging to help displaying current rebar's state.
Usage:
rebar3 state
pirms 9 gadiem
Tristan Sloughter
270066c296
check top level config for minimum or blacklisted otps at start
pirms 9 gadiem
Tristan Sloughter
414dd344e9
install project app plugins after discovering them not before
pirms 9 gadiem
Tristan Sloughter
c4c7ca4244
support temporary cdn change with HEX_CDN os var
pirms 9 gadiem
alisdair sullivan
3fc51b912c
move test profile bootstrap into core
pirms 9 gadiem
Tristan Sloughter
0839efda57
fix dialyzer warnings
pirms 9 gadiem
Fred Hebert
6a4b5428b3
Properly warn on missing rebar3 deps
The current code could not cope with missing dependencies, as they would
prevent the rebar3 app from loading or properly building its config,
which prevented the log state from being carried along with default
values. This in turn would turn in an escript-level error that
obfuscated the true source of failure.
This patch bypasses the whole state setup and logging macros and logs an
error message manually when a dependency such as crypto or SSL is
missing from the Erlang install.
pirms 9 gadiem
Tristan Sloughter
da3d8a69cc
add providers 'local upgrade' and 'local install' for installing/upgrading
pirms 9 gadiem
Tristan Sloughter
8c7bed454d
add current_app attribute for setting before calling hooks
pirms 9 gadiem
Fred Hebert
c57177fde8
Revert "Revert "only load packages when needed""
pirms 9 gadiem
Fred Hebert
3f83b3a382
Revert "only load packages when needed"
pirms 9 gadiem
Tristan Sloughter
8732b7d5bd
only load packages when needed
pirms 9 gadiem
Tristan Sloughter
cf5390f018
replace use of dict of packages and registry with single ets table
pirms 9 gadiem
Tristan Sloughter
ecf6ad5524
fix no_return warnings
pirms 9 gadiem
Tristan Sloughter
0097a841a3
handle global config file that can't be read
pirms 9 gadiem
CarlosEDP
38cc32c40a
Added rebar profile to httpc initialization and calls.
pirms 10 gadiem
CarlosEDP
8de84f1af0
Added support for proxy on rebar3 based on environment variables.
pirms 10 gadiem
Tristan Sloughter
1c66f0eb9f
setup hex httpc profile and http opts. needed also for proxy
pirms 10 gadiem
Tristan Sloughter
f7ff07a87d
plugins provider
pirms 10 gadiem
Tristan Sloughter
cd8c03e1c4
check format of config file and print the bad section in the error
pirms 10 gadiem
Tristan Sloughter
ea07a7c65c
set default providers before installing plugins
pirms 10 gadiem
Viacheslav Kovalev
c2c1079ba2
Show stacktrace to errors caught in rebar3 module.
pirms 10 gadiem
Tristan Sloughter
fdc1267f67
start httpc in run/1 so it is available to download global plugins
pirms 10 gadiem
Tristan Sloughter
0bd49634ce
don't lose global plugin providers
pirms 10 gadiem
Tristan Sloughter
3a201230fe
install plugins from the global config to ~/.cache/plugins
pirms 10 gadiem
Tristan Sloughter
fa95321774
remove uses of 'case catch'
pirms 10 gadiem
Tristan Sloughter
bfd08c129d
set resources of state in state initialize functions
pirms 10 gadiem
Tristan Sloughter
e5988f69e0
R15 support, replace unsetenv with putenv empty string
pirms 10 gadiem
Tristan Sloughter
4374999d95
real bootstrapping
pirms 10 gadiem
Tristan Sloughter
a3d4cc1259
track and cleanup code paths for different contexts
pirms 10 gadiem
Fred Hebert
8f1bfcb596
Rename wtf->report, add all dep versions
pirms 10 gadiem
Tristan Sloughter
743b24883d
removing installing of global plugins
pirms 10 gadiem
Tristan Sloughter
79e2d6006c
install each deps plugins after handling dep, instead of at the end
pirms 10 gadiem
Tristan Sloughter
38de29ae42
move resource modules list to rebar_state, no longer static
pirms 10 gadiem
Tilman Holschuh
af5ba45f27
Decapitalize short option for 'version'
pirms 10 gadiem
Fred Hebert
ad18970cd7
Fix #267 , refactor as/do/namespace interactions
Breaking up initial call to parse from the ones deep inside the provider
parsing to do smarter namespace detection, added 'as' the ability to
look into these also, and cleaned up the code a whole lot that would
depend on implicit assumptions.
A side-effect is that 'do' is now valid for all namespaces, although it
can be overriden.
pirms 10 gadiem
Tristan Sloughter
ae7fe65a75
halt with 0 on successful run
pirms 10 gadiem
Tristan Sloughter
d623b39642
fix code path update for deps
pirms 10 gadiem
Tristan Sloughter
0638c85634
store base opts after initialization of providers
pirms 10 gadiem
Tristan Sloughter
d4c2332aab
make base_dir for a run include the profiles in path, link to shared deps
pirms 10 gadiem