dune icon indicating copy to clipboard operation
dune copied to clipboard

[dune-configurator] PKG_CONFIG_PATH is ignored on macos

Open dmtrKovalenko opened this issue 1 year ago • 3 comments

Expected Behavior

When providing custom PKG_CONFIG_PATH variable dependencies

Actual Behavior

PKG_CONFIG_PATH is ignored in favor of brew https://github.com/ocaml/dune/blob/main/otherlibs/configurator/src/v1.ml

Reproduction

  1. Get a mac
  2. Add a folder with custom pkg-config, e.g. vcpkg install libpng
  3. Run PKG_CONFIG= dune build
  4. Observe error

Specifications

  • Version of dune (output of dune --version): 3.16.0
  • Version of ocaml (output of ocamlc --version): 5.2.0
  • Operating system (distribution and version): MacOS 14.5

Additional information

Despite the code looks correct it is for some reason still not running, would be also good to log the modified PKG_CONFIG_PATH

dmtrKovalenko avatar Aug 06 '24 10:08 dmtrKovalenko

Do you want to send a PR? I don't think many of the dune devs use homebrew, so we need help from somebody that knows about brew and is willing to test things.

rgrinberg avatar Oct 20 '24 09:10 rgrinberg

I don't think this is true since Nix relies pretty heavily on PKG_CONFIG_PATH.

EDIT: looking at the code there does seem to be some special handling of PKG_CONFIG_PATH when brew is present. I suppose that could be improved.

anmonteiro avatar Oct 20 '24 21:10 anmonteiro

Yeah I do handle it differently in my projects, so can make a PR porting my changes

dmtrKovalenko avatar Oct 20 '24 21:10 dmtrKovalenko