-
Notifications
You must be signed in to change notification settings - Fork 518
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
app_vars_file applies env vars to every app rebar3 compiles #2615
Comments
First of all, this isn't the newest release (3.17 is out), but second of all, wow I had no idea this even was a feature. This appears to be code that was put in place in 2010, and imported straight from legacy rebar 2.x into rebar3 a few years later. This is probably a bug. though I'd have to figure out how the old rebar2 dealt with this in multi-app cases. The weird things I can imagine here are:
Option 1 is probably the less problematic one, but given that I'd be more tempted to just take it away if we're to break behaviour anyway. |
Admittedly, I didn't spend enough time ensuring I was on the latest release since I skipped ahead and read the code on master. Just now, I bootstrapped the master branch of rebar3 and got the same result as in the description.
We don't rely heavily on this feature -- and I would not object to taking the feature away. As-is, due to your point #2, use of the feature could cause some nasty unintended bugs in dependencies. In any case, I'll submit my PR to aide your decision. |
Yeah, the advantage of this could be to generate profile-specific env values (be aware that 'prod' is always used as an env on top of default for deps), so having it be per-app and work nicely with profiles would probably be the best way to keep the feature. |
Pre-Check
Environment
For my output below, I had done a
rebar3 local upgrade
first, to try to be on the latest release.The app I'm trying to build is closed-source but I'll provide a minimal set of steps to reproduce the behavior below.
Current behaviour
When the config option
app_vars_file
is provided in the rebar.config, the vars contained within are applied to every application's .app file that rebar3 is compiling. Since in my experience app vars are usually defined to be specific per app, this is unexpected behavior.In the foo app, I'm using the wonderful 'recon' as a dep just to illustrate the behavior. Any dependency project will show the same result.
Please notice:
Expected behaviour
I would expect to be able to target specific apps with the app_vars_file config option. The current behavior is not a bug, but the behavior is surprising enough that I thought it warranted an issue to go along with the Pull Request.
Thanks for reading, and thanks for the great tooling, as always. I hope you'll find my PR useful.
The text was updated successfully, but these errors were encountered: