You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When no switch is selected, for example because I don't have a global switch and I'm not in a folder with a local switch, the command opam var and all the sub commands are returning an error code 50.
~$ opam init --bare
~$ cd ~/project-with-local-switch
~/project-with-local-switch$ opam sw create . 4.12.1 --no-install
~$ cd
~$ opam var; echo $?
<><> Global opam variables ><><><><><><><><><><><><><><><><><><><><><><><><><><>
arch x86_64 # Inferred from system
exe # Suffix needed for executable filenames (Windows)
jobs 255 # The number of parallel jobs set up in opam configuration
make make # The 'make' command to use
opam-version 2.1.2 # The currently running opam version
os linux # Inferred from system
os-distribution debian # Inferred from system
os-family debian # Inferred from system
os-version 10 # Inferred from system
root /home/louis.roche/.opam # The current opam root directory
switch # The identifier of the current switch
sys-ocaml-arch # Target architecture of the OCaml compiler present on your system
sys-ocaml-cc # Host C Compiler type of the OCaml compiler present on your system
sys-ocaml-libc # Host C Runtime Library type of the OCaml compiler present on your system
sys-ocaml-version # OCaml version present on your system independently of opam, if any
<><> Configuration variables from the current switch ><><><><><><><><><><><><><>
[ERROR] No switch is currently set. Please use 'opam switch' to set or install a switch
50
~$ opam var root; echo $?
[ERROR] No switch is currently set. Please use 'opam switch' to set or install a switch
50
~$ cd ~/project-with-local-switch
~/project-with-local-switch$ opam var root; echo $?
/home/louis.roche/.opam
0
That's with opam version 2.1.2. With 2.0.8 the behavior was different from what I could reproduce and opam config var root wouldn't return an error.
Digging & fixing that, i found another bug : setting an option on a non-existent switch don't fail and write the switch config file! It leads to opam internals to be inconsistent 😨
When no switch is selected, for example because I don't have a global switch and I'm not in a folder with a local switch, the command
opam var
and all the sub commands are returning an error code 50.That's with opam version 2.1.2. With 2.0.8 the behavior was different from what I could reproduce and
opam config var root
wouldn't return an error.ocamllabs/vscode-ocaml-platform#701
The text was updated successfully, but these errors were encountered: