-
Notifications
You must be signed in to change notification settings - Fork 368
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
Create opam root in %LOCALAPPDATA%\opam
on Windows
#5212
Conversation
This is great; ordinary opam.exe will be able to read OPAMROOT from Diskuv's opam.exe. |
The use of |
LGTM |
Looks like a tweak is needed to the runners. |
If .opam is found in either %HOME% or %USERPROFILE% then use that, but roots are otherwise created in %LOCALAPPDATA%\opam.
The directory before was selected "by fluke" - the CI runners don't want to use C:\ by default.
The hard-coded default of ~/.opam is not correct on Windows and also not technically correct if the user specified --root or set the OPAMROOT environment variable. This commit fixes both - ~/.opam is displayed when correct, and a more detailed message is displayed (mentioning the default value) if it has been overridden.
Thanks for the review, @AltGr! I've hopefully fixed the CI - beforehand, There's an extra commit to be checked, though. I've altered the code so that you now get the correct display on Windows:
but while there it was worth fixing #4992 as well. If the root is not the default, then you get this slightly different message:
We could possibly be more explicit about why the root has been overridden (there are three possibilities: |
Thanks a lot! |
If
.opam
is found in either%HOME%
or%USERPROFILE%
then use that, but roots are otherwise created in%LOCALAPPDATA%\opam
.This strategy is forwards-compatible with any switch to XDG (which would definitely introduce the situation where existing roots would be read from locations other than where a new root would be init'd). The location for Windows was discussed in #3766.