Improve the lookup sequence for finding the config file#7915
Improve the lookup sequence for finding the config file#7915wilzbach wants to merge 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
|
|
||
| $(OL | ||
| $(LI current directory) | ||
| $(LI exe directory (windows)) |
There was a problem hiding this comment.
To me this looks like the exe directory is not checked at all on non-Windows platforms. That's not correct?
There was a problem hiding this comment.
AFAICT the argv0 directory is pretty much the exe directory.
There was a problem hiding this comment.
Ah, right, not sure what I was thinking.
|
Do we have tests for this? Can we test this? |
I don't think so.
It's a bit tricky within the testsuite as
Anyhow before investing more work into this, I would like to make sure that everyone is okay with improving the lookup order. |
Fair enough. I would vote for this new order. |
Approval was the wrong thing to do here. What I mean is I support the new lookup rules.
|
Generally, people are not going to like breaking their setups. They may not even know what they are - it'll just start failing. |
|
@wilzbach since this was generated to address the concerns @MartinNowak voiced on dlang/installer#297, can you clean it up (rebase and resolve all conflicts) and address @WalterBright's concern? @WalterBright is the filename the only thing holding up this pull request? |
In short, it's very problematic that
~/dmd.confhas a higher precedence than the config next to the dmd binary.This easily leads to unexpected behavior.
I think @MartinNowak has a very good explanation at #4256 (comment):
LDC's search oder
FWIW I think LDC's search order is nice and we should learn from them:
Other path DMD should look at:
Resulting issues I found on a quick scan:
As you can see the current status quo is a mess. I'm more than happy to fix the two open issues in this PR too. Here's the order I suggest