-
Notifications
You must be signed in to change notification settings - Fork 365
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
Unexpected behaviour when prepending/appending to initially empty variables multiple times #5926
Comments
NV_VARS10 should be a:b and NV_VARS11 should be b:a (no leading colon)
NV_VARS10 should be a:b and NV_VARS11 should be b:a (no leading colon)
As in #5935, cross-referencing:
The documentation for Given those semantics:
So I think that the treatment of |
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
:= 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).
:= 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).
- 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)
:= 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).
When a variable is initially unset or empty, appending to it and then prepending to it using the colon operators (
:=
and=:
) causes an unexpected leading colon in the result. Prepending to an unset variable followed by appending to it produces the same unexpected result.Here is a package reproducing the problem:
Reproduce by running
opam install ./foo.opam && cat _opam/lib/foo
which will produce the output:But according to the documentation the output should be:
I'm on linux. Reproduced on both 2.1.5 and opam-2.2.0-beta2.
The text was updated successfully, but these errors were encountered: