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

PKG_CONFIG_PATH is being double-quoted in the environment #5923

Open
jonahbeckford opened this issue Apr 17, 2024 · 3 comments
Open

PKG_CONFIG_PATH is being double-quoted in the environment #5923

jonahbeckford opened this issue Apr 17, 2024 · 3 comments
Assignees
Projects
Milestone

Comments

@jonahbeckford
Copy link
Contributor

This is opam 2.2~beta2. The problem did not manifest itself in opam 2.2~alpha0.

The dump from opam option is:

setenv                 [[PKG_CONFIG_SYSTEM_LIBRARY_PATH = ""] [PKG_CONFIG_SYSTEM_INCLUDE_PATH = ""] [PKG_CONFIG_PATH =
                       "Y:\\source\\dkml\\build\\pkg\\bump\\msys64\\clang64\\lib\\pkgconfig"]]

Yet the environment variable available inside opam install (and in the opam .env log file) is:

PKG_CONFIG_PATH="Y:\source\dkml\build\pkg\bump\msys64\clang64\lib\pkgconfig"
@rjbou rjbou added this to the 2.2.0~beta3 milestone Apr 17, 2024
@rjbou rjbou added this to For beta3 in Opam 2.2.0 Apr 17, 2024
@jonahbeckford
Copy link
Contributor Author

jonahbeckford commented Apr 17, 2024

Test Cases without double quotes

# Cygwin and pkg-config

$ env 'PKG_CONFIG_PATH=Y:\source\dkml\build\pkg\bump\msys64\clang64\lib\pkgconfig' pkg-config --cflags libffi
-IY:/source/dkml/build/pkg/bump/msys64/clang64/include

# MSYS2 and pkgconf

$ env 'PKG_CONFIG_PATH=Y:\source\dkml\build\pkg\bump\msys64\clang64\lib\pkgconfig' pkgconf --cflags libffi
-IY:/source/dkml/build/pkg/bump/msys64/clang64/include

Conclusion: double-quotes are not needed

@jonahbeckford
Copy link
Contributor Author

jonahbeckford commented Apr 17, 2024

Test Cases with double quotes

# Cygwin and pkg-config
$ env 'PKG_CONFIG_PATH="Y:\source\dkml\build\pkg\bump\msys64\clang64\lib\pkgconfig"' pkg-config --cflags libffi
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libffi', required by 'virtual:world', not found

# MSYS2 and pkgconf

$ env 'PKG_CONFIG_PATH="Y:\source\dkml\build\pkg\bump\msys64\clang64\lib\pkgconfig"' pkgconf --cflags libffi
-IZ:/msys64/clang64/bin/../include

Conclusion: adding double-quotes breaks both pkg-config and pkgconf

@jonahbeckford
Copy link
Contributor Author

Correction for Cygwin examples

# Cygwin using Cygwin native /usr/bin/pkg-config

$ cygpath -aw .
Z:\cygwin64\home\beckf

$ /usr/bin/pkg-config --version
2.2.0

$ env 'PKG_CONFIG_PATH=Y:\source\dkml\build\pkg\bump\msys64\clang64\lib\pkgconfig' /usr/bin/pkg-config --cflags libffi
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libffi' not found

$ (cd /cygdrive/y && env 'PKG_CONFIG_PATH=Y:\source\dkml\build\pkg\bump\msys64\clang64\lib\pkgconfig' /usr/bin/pkg-config --cflags libffi)
-I/clang64/include

@dra27 dra27 self-assigned this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Opam 2.2.0
  
For beta3
Development

No branches or pull requests

3 participants