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

Meson CMake dependency lookup ignores CMAKE_PREFIX_PATH after recent changes #5666

Closed
solson opened this issue Jul 16, 2019 · 6 comments
Closed
Labels
dependency:cmake Issues related to `dependency` with the `cmake` method
Milestone

Comments

@solson
Copy link

solson commented Jul 16, 2019

After upgrading from 0.49.2 to 0.50.1, my build which relies on a CMake dependency lookup started failing to find the dependency. By using git bisect on the Meson repo I found that the lookup starts failing with this PR, specifically this commit (cc @mensinda). I've also tested on 0.51.0 and master and the problem persists.

As per that PR, Meson now checks if the expected CMake modules exist before actually invoking CMake, except I believe it fails to consider all the places CMake itself would look. Specifically, as I understand it, CMake looks in the paths of the CMAKE_PREFIX_PATH environment variable, which I believe is automatically set by my dependency handling system and was key to finding the dependencies when I used 0.49.2. In newer versions, Meson bails out and never gives CMake the chance to run and check those paths.

I can seemingly work around this by configuring with -Dcmake_prefix_path=$(echo "$CMAKE_PREFIX_PATH" | tr : ,), but this feels a bit redundant. It's unclear to me whether it's intended design, given that Meson is happy to read other env vars like CXX/LDFLAGS without passing them through -D flags, for example. Previously, Meson's CMake support was really "plug and play" and didn't require any thought beyond what would make CMake itself work in the normal way, and I think it would be ideal to preserve that property.

Let me know if you need any more specific details.

@mensinda
Copy link
Member

No, this wasn't a design decision, I just forgot to add it. This should probably also go into 0.51.2.

@dcbaker dcbaker added this to the 0.51.2 milestone Jul 16, 2019
@scivision scivision added the dependency:cmake Issues related to `dependency` with the `cmake` method label Jul 17, 2019
@mensinda
Copy link
Member

Should be fixed with #5673

@nirbheek
Copy link
Member

Fixed with #5673

@c72578
Copy link
Contributor

c72578 commented Nov 2, 2019

I can seemingly work around this by configuring with -Dcmake_prefix_path=$(echo "$CMAKE_PREFIX_PATH" | tr : ,)

@solson, do you need the colon ':' as a list separator in CMAKE_PREFIX_PATH?

@solson
Copy link
Author

solson commented Nov 2, 2019

@c72578 I'm not very experienced with CMake, but that is the format I observed on my machine. Weirdly, checking the CMake docs now, they describe it as a semicolon-separated list, but I checked again and it's colon-separated in my situation.

@c72578
Copy link
Contributor

c72578 commented Nov 2, 2019

@solson, thanks for checking. A related PR has been prepared (#6126).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency:cmake Issues related to `dependency` with the `cmake` method
Projects
None yet
Development

No branches or pull requests

6 participants