| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
test profile wants
|
|
|
|
| |
This reverts commit 4ad1db97336a3ac070880876ada07d4c7b769327.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current rebar3 uses debug_info rules where debug_info is added by
default, and no_debug_info prevents the default from being added, and
removes any explicit debug_info, if any. The problem is that if
'no_debug_info' is anywhere in the config for a run, it cannot be
removed even with other profiles. additionally, no_debug_info ignores
special tuples like {debug_info, {Mod, Data}} and {debug_info_key, Key},
which can be used to add debug info and encrypt it (in lieu of plain
debug_info) respectively.
This patch makes it so that the following rules are in place:
- the last option seen takes priority, allowing profile overrides by
the ordering rules the compiler expects
- the overriden options shall be explicitly deleted to avoid confusing
the compiler
- any option related to debug info seen last cancels any no_debug_info
that preceded it
- any no_debug_info option seen last cancels all of the other
debug_info options
- if debug_info is seen last, it cancels out {debug_info_key, Key}
- if {debug_info_key, Key} is seen last, it cancels out debug_info
- All other options are left untouched in that context (defines can
still be expanded and so on)
This should allow proper profile rules to be followed. Note that erl_opt
profile merging puts precedence on the *last* element of a list, to
match the compiler.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces all deprecated function usage by alternative ones based on
a version switch enacted at compile time, preventing all warnings.
This will likely introduce some possible runtime errors in using a
Rebar3 compiled on OTP-20 or OTP-21 back in versions 19 and earlier, but
we can't really work around that.
A bunch of dependencies have been updated to support OTP-21 without
warnings as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
This reverts commit 4c32c52b557c66ac6e6764efb1ed9135c00a3c20.
|
| |
|
|
|
|
| |
prior to running compile and compile prehooks
|
| |
|
|
|
|
|
| |
Requires a rework of other test suites using the same dep-handling
mechanism.
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
test/rebar_profiles_SUITE.erl
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
test utils and add better eunit tests
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than using the stdlib lists:umerge, we expand it to allow fuzzy
matching on tuples vs. vals (`key` vs. `{key,val}`) with an overriden
sort order so that two tuples or values comparing equal get a priority
on the newest profile.
This is a partial fix for #287 -- this current patch should be followed
by a relx update to take options in order (as if they were a proplist)
to complete it.
|
| |
|
| |
|
|
|
|
|
|
| |
profiles are failing to be applied
relevant to #224 and #233
|
| |
|
| |
|
| |
|
| |
|
|
|