-
Notifications
You must be signed in to change notification settings - Fork 359
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
windows: opam root redirection when path contains spaces #5457
Conversation
note from dev meeting: for the directory we could create a new directory in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General question: why do we redirect the entire opam root instead of just installing Cygwin in C:\opam-cygwin
or similar? What are the advantage/inconvenient of both solutions?
-> installed nv.1 | ||
Done. | ||
# Run eval $(opam env '--root=${BASEDIR}/root 2' '--switch=${BASEDIR}/switch w spaces') to update the current shell environment | ||
### opam env --root "$RT" --switch "./$SW" | grep "NV_VARS" | ';' -> ':' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this test not needed anymore? What was it testing to being with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is moved to env.unix & init.win32 as the behaviour differs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing that command in either of those files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah,the command itself, true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that originally it was here to show that the switch was well created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is safe - the main thing is that the primary tests in #5935 (further up the file) are still there. The noise in these other parts suggests that the tests should possibly be split up a bit further (but's definitely a post 2.2.0 thing!)
my question wasn't answered. Looks fine otherwise on a glance, i'll test it tomorrow |
I know, i hadn't time :) |
94ef0e4
to
1883aac
Compare
tests/reftests/init.win32.test
Outdated
-> test test | ||
### echo $OPAMROOT | ||
roots/with path | ||
### rm -rf 'C:\opamroot' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely can't stay - it blows away the user's opam root!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then the tests are not reproducible on Windows at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok for CI, on tester computer, we can add a note about it in the test and not remove something outside the test directories
1883aac
to
6730dea
Compare
The tests have been split off to #6006 |
It is needed for Cygwin installation, that doesn't handle paths with space. At init, detection and redirection are done, afterwards opam always load redirected opam root. Original root directory is stored in `OpamStateConfig.!r.original_root_dir`. Co-authored-by: David Allsopp <david.allsopp@metastack.com>
🎉 |
Thanks all! |
On Windows, opam may install a local cygwin, but cygwin doesn't support having a space in its path. We need then to redirect all opam root into a path with no space. Redirection is done at first init, and afterwards it is followed for each opam call.
So opam root directory can contain either:
an unique file
redirected-opamroot
that contains the new pathor the already known opam root.
update changes
update message with relevant root dir
set default path, or give user the choice
add an error if
--root
/OPAMROOT
path contains spaceadd readme.txt in C:\opamroot
related to #5220