-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix Issue 18433 - rdmd doesn't respect DFLAGS for its cache hash #343
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request, @wilzbach! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + tools#343" |
Hmm apparently this was done on purpose:
https://issues.dlang.org/show_bug.cgi?id=1660 I strongly disagree with this decision.
|
OPTLINK does the same thing, the config file overrides any environment variable (I wasted a bunch of time figuring this out). The intuitive priority to me would be:
Not sure if this order can be changed without breaking a bunch of stuff. In any case, whether or not the order can be changed, |
Not entirely sure either, but what if DMD would append to the We could even trigger a deprecation/warning a la "Hey your exported |
Was about to say this - dmd ignores the DFLAGS environment variable. Close? |
Appending might be odd if there are duplicate options...you could get multuple standard libraries for example. We could write some logic to merge the options but that could get complex. Not sure what the right move is here. I like the warning idea. Maybe we start by seeing if changing the priority is even something Walter would want. Maybe he had a reason for the current priority? |
IIRC Walter has a general dislike for getting things from the environment. He said something along the lines of that anything could put stuff there (esp. on Windows where any program can edit the default environment, and they often do), and it can be hard to debug issues when things in the environment are causing problems (because you need to know to look there). |
@CyberShadow Yeah I can understand this sentiment. I would be fine with completely removing support for
|
I think this would actually break my setup from a few years ago, where I effectively aliased
Why would you want to add a warning when it is overridden by the config file? In that situation, removing it completely will have no effect. Did you mean to say that a warning will appear when it is not overridden by the config file?
Sorry, I've completely lost track of what this is about. If DFLAGS can currently only be set by changing the configuration file, then all we need to do is ensure that the configuration file is one of the "dependencies" that rdmd checks the modification time of, which I believe it already does. Right? |
No, DMD does parse https://github.com/dlang/dmd/blob/master/test/Makefile#L101
The idea was to let this code issue a warning:
(the user may have expected dmd to behave otherwise) But thinking about it, it probably doesn't solve our problem either :/ An non-breaking option would be to introduce an |
The current state of DFLAGS is that it will read it from either the config file, or as an environment variable in that order. If it doesn't read it from the config file (or if you provide |
Right, we're on the same page here. I meant the current behavior with the default configuration file.
Is that with
Maybe we can introduce a new variable and add it to the default definition of Here's a different idea: make |
FYI:
Yep (though a lot of the bash scripts don't set it and everything "just works" because the debug
Not sure whether this would create less confusion if we introduce |
No, that's unusable for this case. |
Note this is only part of the required fix.
DMD at the moment doesn't allow to incrementally add to DFLAGS, so this needs to be fixed before this can be merged:
(no
Foo
set here)Fixes #424