Skip to content

Change default rule for PKG_CONFIG_PATH and MANPATH to target #5972

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

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ users)
* [BUG] Rework the logic of := and =: so that an empty entry is correctly preserved on multiple updates [#5935 @dra27 - fix #5926]
* [BUG] Fix incorrect reverting of `=+` and `=:` [#5935 @dra27 - fix #5926]
* For the `Cygwin` internal operator, don't allow `make.exe` to become shadowed [#5996 @dra27]
* [BUG] Fix incorrect quoting rule for `PKG_CONFIG_PATH` [#5972 @dra27 - partial fix for #5923]

## Opamfile

Expand Down
2 changes: 1 addition & 1 deletion src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let default_sep_fmt_str var =
| "PATH" when Sys.win32 ->
SSemiColon, Target_quoted
| "PKG_CONFIG_PATH" | "MANPATH" ->
SColon, Target_quoted
SColon, Host
| _ -> default_separator, default_format

let default_sep_fmt var = default_sep_fmt_str (OpamStd.Env.Name.to_string var)
Expand Down
4 changes: 2 additions & 2 deletions tests/reftests/env.win32.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Done.
### : already contains a directory which needs escaping (e.g. building with
### : MSVC)
### opam env --shell=cmd | grep "PATH" | 'XXX:.*' -> '' | 'set "P' -> 'set P'
set "MANPATH=:"${BASEDIR}/OPAM/rewriting/man""
set MANPATH=:${BASEDIR}/OPAM/rewriting/man
set PATH=${BASEDIR}/OPAM/rewriting/bin;C:\Devel\bin1;C:\Devel\bin2;"C:\Devel\bin3;";C:\Devel\bin4;ZZZ:\;
### opam exec -- opam env --shell=cmd --revert | grep 'ZZZ:' | 'ZZZ:\\.*' -> 'ZZZ:\' | 'set "P' -> 'set P'
### : Test for #5838
### opam env | grep MANPATH
MANPATH=':"${BASEDIR}/OPAM/rewriting/man"'; export MANPATH;
MANPATH=':${BASEDIR}/OPAM/rewriting/man'; export MANPATH;
### opam exec -- opam env --revert | grep MANPATH
MANPATH=''; export MANPATH;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this expected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that was clumsy of me. I think the Target above should be Host, but I need to test that (especially w.r.t. MSYS2)

### : Tests forward and backslash rewriting on revert
Expand Down
Loading