Skip to content
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

OPAMSWITCH and OPAMROOT reverts #5743

Merged
merged 2 commits into from
Jan 11, 2024
Merged

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Nov 27, 2023

Store old OPAMSWITCH in last env file, in order to revert it properly
Don't store OPAMSWITCH & OPAMROOT in the last environment file, like that they are not reverted. They are set with --set-switch and --set-root, they are meant to remain in the shell environment.

fixes #5696

queued on #5715 for windows ci

@rjbou rjbou added this to the 2.2.0~beta1 milestone Nov 27, 2023
@rjbou
Copy link
Collaborator Author

rjbou commented Nov 27, 2023

CI issue

@@ -96,11 +96,20 @@ opam sw show
 ### sh unset-opamswitch.sh opam
 foo
 OPAMSWITCH='bar'; export OPAMSWITCH;
-OPAMSWITCH=''; export OPAMSWITCH;
-bar
+unset-opamswitch.sh: line 13: $'\r': command not found
+unset-opamswitch.sh: line 13: $'\r': command not found
+unset-opamswitch.sh: line 13: $'\r': command not found
+unset-opamswitch.sh: line 13: $'\r': command not found
+unset-opamswitch.sh: line 13: $'\r': command not found
+foo

will be resolved by #5715

@rjbou rjbou added the PR: QUEUED Pending pull request, waiting for other work to be merged or closed label Nov 27, 2023
@rjbou
Copy link
Collaborator Author

rjbou commented Dec 6, 2023

Other solution could be to not store OPAMSWITCH in last env file at all

@rjbou
Copy link
Collaborator Author

rjbou commented Dec 11, 2023

Updated!

@rjbou rjbou changed the title OPAMSWITCH revert OPAMSWITCH and OPAMROOT reverts Dec 11, 2023
src/core/opamConsole.ml Outdated Show resolved Hide resolved
@kit-ty-kate kit-ty-kate force-pushed the switch-revert branch 2 times, most recently from 1c98f6f to 847704b Compare January 11, 2024 00:32
… not be reverted

They are set by '--set-switch' and '--set-root' with the idea to have them defined for the session
@kit-ty-kate
Copy link
Member

Thanks!

@kit-ty-kate kit-ty-kate merged commit 5cd7e1b into ocaml:master Jan 11, 2024
29 checks passed
@dra27 dra27 mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: QUEUED Pending pull request, waiting for other work to be merged or closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

opam 2.2.0~alpha2: OPAMSWITCH does not work anymore
3 participants