summaryrefslogtreecommitdiff
path: root/src/rebar3.erl
Commit message (Collapse)AuthorAgeFilesLines
* Fix precedence rules of erl_opts for test profileFred Hebert2018-04-201-1/+5
| | | | | | | | | | | | | | When adding the 'TEST' macro to the test profile, we mistakenly sourced the erl_opts values from the base profile rather than the test profile itself. This means that in cases where the base profile set an option such as 'no_debug_info' and a profile overrode it with 'debug_info', the default options would get injected within the test profile, and broke the precedence rules, yielding incompatible values. This patch fixes things by adding the macro to the values sourced from the test profile itself, fixing the issue.
* Set unicode option for starndard_io at entry pointShunichi Shinohara2018-02-221-0/+1
|
* Fix recursive profile merging in umbrella appsFred Hebert2017-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a config file exists at the root of a project, defines a given configuration value for a given profile, and that a sub-application (umbrella app) also has the same profile defined with the same key (but different values), the configuration values of the sub-application's profile would get silently dropped. The problem being that when the function to merge profiles is applied recursively, it is applied to each profile (so it will merge on the keys test, prod, etc.) rather than to each of the values of each profile. This patch reworks the profile merging so that the current behaviour is respected overall (a profile cannot be cancelled by a subdep's non-existant profile since its value should have been ignored), but ensures that sub-deps' profiles are otherwise applied recursively with the proper rules: - dependencies favor prior values - plugins favor new values - erl_first_files combine the lists - relx uses the tuple merge algorithm - erl_opts has its own custom merge as well - otherwise the new value takes precedence A test has also been added. There is a risk of breakage in some applications that may have relied on the buggy behaviour to work, though at this time we are aware of none of them.
* Unicode support in all the placesFred Hebert2017-08-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done through 3 main change groups: - replacing `~s` by `~ts` in format strings, so that strings that contain unicode are properly printed rather than crashing - adding the `unicode` argument to all function of the `re` module to ensure transformations on strings containing unicode data are valid instead of crashing (see issue #1302) - replacing `ec_cnv:to_binary/1` and `ec_cnv:to_list/1` with matching functions in `rebar_utils`. The last point has been done, rather than modifying and updating erlware commons, because binary and list conversions can be a contentious subject. For example, if what is being handled is actually bytes from a given binary stream, then forcing a byte-oriented interpretation of the data can corrupt it. As such, it does not appear safe to modify erlware commons' conversion functions since it may not be safe for all its users. Instead, rebar3 reimplements a subset of them (only converting atoms and chardata, ignoring numbers) with the explicit purpose of handling unicode string data. Tests were left as unchanged as possible. This may impact the ability to run rebar3's own suites in a unicode path, but respects a principle of least change for such a large patch.
* Properly warn on missing rebar3 deps: add inetsCarlo Carraro2017-03-051-1/+1
|
* REBAR_CONFIG impacts file project root onlyFred Hebert2017-02-241-1/+1
|
* Merge pull request #1391 from ferd/doc-and-typesFred Hebert2016-12-231-15/+61
|\ | | | | Type specifications and edocs improvements
| * Type specifications and edocs improvementsFred Hebert2016-11-271-15/+61
| | | | | | | | | | | | Includes improvments and function documentation for all modules (in alphabetical order) up to rebar_core, and may have included more in other modules as I saw fit to dig and understand more of the internals.
* | 1394: added fix for rebar_utils, moved setting of http_options into ↵Artem Pervin2016-11-301-1/+2
|/ | | | init_config, added unit tests
* Always read REBAR_CONFIG env var when loading configEric Meadows-Jönsson2016-11-221-6/+1
|
* Get stacktrace only once and as soon as possible. Fixes #1347.Alexander Sedov2016-10-131-2/+3
| | | | | It turns out that pretty-printing uses throw-catch and thus garbages out the stack trace sometimes, so we should get it only once.
* Print stacktrace in a more conventional wayTuncer Ayaz2016-08-301-1/+1
| | | | | | Insert a newline before printing the stacktrace so that the term is easier to read and copy. This is a more conventional way to print traces, and is, for instance, the way it's done by make and python.
* Let DEBUG="" and QUIET="" mean disable the optionJon2016-06-181-2/+2
| | | | | Setting DEBUG/QUIET environment variable to the empty string now acts the same as unsetting it. Unsetting is not always easy/possible.
* Merge pull request #1080 from project-fifo/crashdumpFred Hebert2016-06-101-2/+4
|\ | | | | Write rebar3.crashdump on errors
| * Make sure not to dump in api modeHeinz N. Gies2016-04-161-3/+3
| |
| * Write rebar3.crashdump on errorsHeinz N. Gies2016-04-161-2/+4
| |
* | Handle control sequences in formatted errorsPéter Gömöri2016-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) ```
* | Read env var REBAR_CACHE_DIR on rebar3 only onceFrancisco Rojas2016-04-061-3/+10
|/ | | | | Instead of reading every time that rebar_dir:global_cache_dir/1 is called
* Revert "define the 'EUNIT' macro in the test profile"alisdair sullivan2016-03-031-11/+10
| | | | This reverts commit 4c32c52b557c66ac6e6764efb1ed9135c00a3c20.
* define the 'EUNIT' macro in the test profilealisdair sullivan2016-03-031-10/+11
|
* Merge branch 'state' of https://github.com/saleyn/rebar3 into saleyn-stateFred Hebert2016-03-011-4/+4
|\
| * Remove --state argument option per Tristan's commentSerge Aleynikov2016-02-081-2/+1
| |
| * Add a state display providerSerge Aleynikov2016-02-081-4/+5
| | | | | | | | | | | | | | The provider is used for debugging to help displaying current rebar's state. Usage: rebar3 state
* | add project_providers after initing default providers but allow overridesTristan Sloughter2016-02-221-3/+3
| |
* | give new opt project_plugins providers precedence over default providersTristan Sloughter2016-02-201-5/+7
| |
* | check top level config for minimum or blacklisted otps at startTristan Sloughter2016-02-031-0/+3
| |
* | install project app plugins after discovering them not beforeTristan Sloughter2016-01-101-1/+1
|/
* support temporary cdn change with HEX_CDN os varTristan Sloughter2015-12-191-9/+16
|
* move test profile bootstrap into corealisdair sullivan2015-10-301-1/+22
|
* fix dialyzer warningsTristan Sloughter2015-09-271-0/+1
|
* Properly warn on missing rebar3 depsFred Hebert2015-09-261-10/+23
| | | | | | | | | | | | 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.
* add providers 'local upgrade' and 'local install' for installing/upgradingTristan Sloughter2015-09-071-2/+16
|
* add current_app attribute for setting before calling hooksTristan Sloughter2015-09-041-1/+0
|
* Revert "Revert "only load packages when needed""Fred Hebert2015-09-021-2/+0
|
* Revert "only load packages when needed"Fred Hebert2015-09-021-0/+2
|
* only load packages when neededTristan Sloughter2015-09-021-2/+0
|
* replace use of dict of packages and registry with single ets tableTristan Sloughter2015-08-211-3/+10
|
* fix no_return warningsTristan Sloughter2015-08-081-0/+1
|
* handle global config file that can't be readTristan Sloughter2015-07-191-19/+29
|
* Added rebar profile to httpc initialization and calls.CarlosEDP2015-07-031-1/+2
|
* Added support for proxy on rebar3 based on environment variables.CarlosEDP2015-07-031-10/+2
|
* setup hex httpc profile and http opts. needed also for proxyTristan Sloughter2015-06-291-1/+11
|
* plugins providerTristan Sloughter2015-06-181-4/+5
|
* check format of config file and print the bad section in the errorTristan Sloughter2015-06-181-3/+3
|
* set default providers before installing pluginsTristan Sloughter2015-05-311-3/+2
|
* Show stacktrace to errors caught in rebar3 module.Viacheslav Kovalev2015-05-221-0/+5
|
* start httpc in run/1 so it is available to download global pluginsTristan Sloughter2015-05-211-12/+14
|
* don't lose global plugin providersTristan Sloughter2015-05-211-3/+3
|
* install plugins from the global config to ~/.cache/pluginsTristan Sloughter2015-05-171-1/+10
|
* remove uses of 'case catch'Tristan Sloughter2015-05-101-24/+30
|