-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overrides on erl_opts does not work as expected #1360
Comments
This works as expected. You just want to use the |
mhh, that means that the example from the (documentation)[https://www.rebar3.org/docs/configuration#overrides]:
is pretty much useless as it would break any dependency application that needs additionl erl_opts. Also, with |
It is usable for the erl_opts of specific deps at this point. It can be argued that we need Overrides were initially meant more as a measure to ease migration from rebar 2.x to rebar3 so it has not been fledged past a point of getting most deps that were breaking to working states (i.e. changing deps, adding plugins, replacing opts, and so on). It's possible we need to improve their support overall, if that's a direction we want to go to. You also have to ponder, for example, what would be the result of adding:
To a compile target and so on. There's possibly a reason why we didn't allow |
for consider:
how would you merge these three |
Found another example where overrides on erl_opts completely break the functionality of dependency. jsx uses a rebar config script to set some defines for enabling maps support. Attempting to add a compile time option (like native) through to an override nukes that detection logic.
Simple, you don't. This is a simple case of the last option wins. Last meaning here the top most define in the dependency hierarchy. However, this logic might me applicable to defines, but not to all compile options, some need aditive merge (e.g. parse_transform) others might need mechanisms to remove the (e.g. debug_info). So this feels like a per option merging strategy is needed for erl_opts. Whatever the solution, we need a way to force some compile time options for dependencies to certain values without touching other options set by that dependency. The most important ones being: |
doesn't we probably do need a way to set |
I made a PR that should enable add to work globally, like override can. |
CAPWAP-AC got an upgrade which provides a simple HTTP API to take over the functionality of the now not-existent CLI. Note: The support library *jsx* (a JSON Encoder/Decoder) needs special treatment in rebar.config due to subtle behaviour of rebar3 which deletes the result of certain compile time checks of *jsx* resulting in *jsx* being not able to encode / decode Erlang maps. See erlang/rebar3#1360 (comment) for more details.
CAPWAP-AC got an upgrade which provides a simple HTTP API to take over the functionality of the now not-existent CLI. Note: The support library *jsx* (a JSON Encoder/Decoder) needs special treatment in rebar.config due to subtle behaviour of rebar3 which deletes the result of certain compile time checks of *jsx* resulting in *jsx* being not able to encode / decode Erlang maps. See erlang/rebar3#1360 (comment) for more details.
Current behaviour
Using a override to force to a specific erl_opts setting on all or a specific dependency completely nukes the existing erl_opts settings.
e.g.:
will completely overwrite the erl_opts of all dependencies.
This becomes a problem if the dependency declares something important in it erl_opts, for example a parse_transform. Overriding erl_opts for every dependency separately to capture their original erl_opts quickly becomes a nightmare.
Expected behaviour
overrides should merge with existing settings or an explicit merge option should exists for overrides.
The text was updated successfully, but these errors were encountered: