-
Notifications
You must be signed in to change notification settings - Fork 346
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
Fixes to reversal of environment updates #5935
Commits on May 15, 2024
-
Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
Configuration menu - View commit details
-
Copy full SHA for c4750ce - Browse repository at this point
Copy the full SHA c4750ceView commit details -
reftests: sort 'opam env' output for stability
opam env itself makes no guarantee of the ordering
Configuration menu - View commit details
-
Copy full SHA for 13ebdea - Browse repository at this point
Copy the full SHA 13ebdeaView commit details -
Add test for updates with mixed slashes
CAML_LD_LIBRARY_PATH should appear in opam env --revert
Configuration menu - View commit details
-
Copy full SHA for 199a4b7 - Browse repository at this point
Copy the full SHA 199a4b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f16bbc1 - Browse repository at this point
Copy the full SHA f16bbc1View commit details -
Add regression test for ocaml#4861
As in this commit, there should be no output captured from the opam env --revert invocation.
Configuration menu - View commit details
-
Copy full SHA for 7e7388c - Browse repository at this point
Copy the full SHA 7e7388cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81220db - Browse repository at this point
Copy the full SHA 81220dbView commit details -
NV_VARS5925_1 thru _4 should all be foo (i.e. without no colon)
Configuration menu - View commit details
-
Copy full SHA for cd3ffad - Browse repository at this point
Copy the full SHA cd3ffadView commit details -
- In `opam exec -- env` / `opam env`: - NV_VARS_5926_L_2 should be `b::a` (the _L_1 case is correct) - NV_VARS_5926_L_4 should be `:a:b` (the _L_3 case is correct) - NV_VARS_5926_L_5 and _L_6 should be `b::a` (neither is correct) - NV_VARS_5926_L_8 should be `:a:b` (the _L_7 case is correct) - All four NV_VARS_5926_M_ all contain `a1:a2` instead of `a1::a2` - NV_VARS_5926_T_2 should be `:b:a` (the _T_1 case is correct) - NV_VARS_5926_T_4 should be `a::b` (the _T_3 case is correct) - NV_VARS_5926_T_6 should be `:b:a` (the _T_5 case is correct) - NV_VARS_5926_T_7 and _T_8 should be `a::b` (neither is correct) - In `opam exec -- opam env --revert`: - NV_VARS_5926_L_{2,4,6,8} revert to `a` instead of `:a` - NV_VARS_5926_M_{1,2,3,4} should all revert to `a1::a2` where - _M_1 and _M_3 only have a single colon (`a1:a2`) - _M_2 and _M_4 have reversed the two components! (`a2:a1`) - NV_VARS_5926_T_{2,4,6,8} revert to `a` instead of `a:` - Note NV_VARS_5926_S_{1,2,3,4} revert to empty rather than `:` (this is correct since both interpretations are equivalent and opam can't know which it was)
Configuration menu - View commit details
-
Copy full SHA for 86b31b6 - Browse repository at this point
Copy the full SHA 86b31b6View commit details -
Transform arguments before reversing an env_update
Missing transformation of the argument, which affected reverting updates with forward slashes (e.g. "%{lib}%/stublibs")
Configuration menu - View commit details
-
Copy full SHA for 3228abb - Browse repository at this point
Copy the full SHA 3228abbView commit details -
OpamEnv.split_var: use correct split functions
The cases of this match were the wrong way around. Note that this regresses ocaml#4861's quoted directory test.
Configuration menu - View commit details
-
Copy full SHA for ba9cd26 - Browse repository at this point
Copy the full SHA ba9cd26View commit details -
Expose the Win32 logic in OpamStd.Sys.split_path
Expose a generalised version of the Windows implementation of PATH-splitting as OpamStd.String.split_quoted.
Configuration menu - View commit details
-
Copy full SHA for d1a8017 - Browse repository at this point
Copy the full SHA d1a8017View commit details -
Replace PATH-splitting implementation in OpamEnv
Existing implementation was not correct w.r.t. separators which were themselves quoted. Use OpamStd.String.split_quoted instead. However, this causes superfluous quotes in variables to be removed. Note that this fixes the MANPATH issue of ocaml#5838 but the quoting-handling is still broken.
Configuration menu - View commit details
-
Copy full SHA for 9380e5d - Browse repository at this point
Copy the full SHA 9380e5dView commit details -
Fix appending to empty env vars (ocaml#5925)
Ensure that if opam has internally synthesised an empty environment variable, then adding to it doesn't create a stray colon.
Configuration menu - View commit details
-
Copy full SHA for 4eb951d - Browse repository at this point
Copy the full SHA 4eb951dView commit details -
Preserve quoting in environment variables
Change the internal representation of environment variables so that both the original quoted version and the parsed version are kept, along with the separator. This has the benefit that reconstituting the variable value does not require knowledge of the separator (which deals coherently with the parasitic case of two packages updating the same variable with a different separator: the value is almost certainly trashed, but it is at least trashed in a semantically coherent manner!) Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
Configuration menu - View commit details
-
Copy full SHA for 5db5951 - Browse repository at this point
Copy the full SHA 5db5951View commit details -
Correct value-splitting w.r.t. x-env-path-rewrite
When reverting [FOO += "value"], it is necessary to determine what to do if "value" is of the form "<value1><sep><value2>". Because FOO itself will have been split at <sep>, we will never match "<value1><sep><value2>" so it is necessary to split value at <sep> as well (this is the crux of ocaml#4861). However, the interaction of this and x-env-path-rewrite is incorrect. If x-env-path-rewrite has [FOO false] (the `norewrite case), then the value must be split according to the default interpretation of FOO (which is how it was added). If x-env-path-rewrite has a rewrite rule for FOO, then opam has already assumed that value refers to a single directory (the host/target and quoting transformation options all being this way). If x-env-path-rewrite does not have any rule (and does have have [FOO false]) then we are in essence in the backwards-compatible case, and must split value. In order to stop poor interaction between this and opam itself injecting Windows paths, opam's updates in OpamEnv (to MANPATH, etc.) are explicitly expanded so that in unzip_to they are treated as though they had an x-env-path-rewrite rule given (and are therefore not split). Combined with the previous fixes, this addresses ocaml#5838 without regressing ocaml#4861.
Configuration menu - View commit details
-
Copy full SHA for 57a7b83 - Browse repository at this point
Copy the full SHA 57a7b83View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20a64c9 - Browse repository at this point
Copy the full SHA 20a64c9View commit details -
Rework logic of := and =: operators (ocaml#5926)
:= and =: now ensure that an empty directory empty is always introduced then all the append operators ensure that an empty directory entry is maintained (see env.test changes).
Configuration menu - View commit details
-
Copy full SHA for 9046905 - Browse repository at this point
Copy the full SHA 9046905View commit details -
Configuration menu - View commit details
-
Copy full SHA for eeba7d2 - Browse repository at this point
Copy the full SHA eeba7d2View commit details