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

Hack CMake to ignore the "build environment" prefix in its searches #25

Merged
merged 1 commit into from
Jul 19, 2018

Conversation

pkgw
Copy link
Contributor

@pkgw pkgw commented Jul 19, 2018

In conda-forge GitHub issue #24 there was a problem because CMake decided to link with a version of the ncurses library found in the "build environment" prefix, rather than the "host environment" -- the major versions were different and so the resulting binaries did not link against the major version intended in the recipe specification.

As far as I can tell, the problem is that CMake decides that the "build environment" library directory should be searched for shared libraries, which is in turn because the build-env prefix shows up in the variable CMAKE_SYSTEM_PREFIX_PATH. We hack the CMakeLists.txt file to remove the relevant directory, which fixes the problem. As a bonus, a bunch of messages about libraries like libz being shadowed between the build and host prefixes now go away.

The CMake docs say that you're not supposed to futz with this variable, but I couldn't find an alternative solution. It may be fixable by patching our cmake package -- although I don't have a good sense as to whether we might sometimes want the build-env prefix to be in CMAKE_SYSTEM_PREFIX_PATH.

Checklist

  • Used a fork of the feedstock to propose changes
  • Bumped the build number (version is unchanged)
  • Re-rendered with the latest conda-smithy
  • Ensured the license file is being packaged.

In [conda-forge GitHub issue conda-forge#24](conda-forge#24)
there was a problem because CMake decided to link with a version of the
ncurses library found in the "build environment" prefix, rather than the "host
environment" -- the major versions were different and so the resulting
binaries did not link against the major version intended in the recipe
specification.

As far as I can tell, the problem is that CMake decides that the "build
environment" library directory should be searched for shared libraries, which
is in turn because the build-env prefix shows up in the variable
`CMAKE_SYSTEM_PREFIX_PATH`. We hack the CMakeLists.txt file to remove the
relevant directory, which fixes the problem. As a bonus, a bunch of messages
about libraries like `libz` being shadoweded between the build and host
prefixes now go away.

The [CMake
docs](https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PREFIX_PATH.html)
say that you're not supposed to futz with this variable, but I couldn't find
an alternative solution. It may be fixable by patching our cmake package --
although I don't have a good sense as to whether we might sometimes want the
build-env prefix to be in `CMAKE_SYSTEM_PREFIX_PATH`.
@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@pkgw pkgw mentioned this pull request Jul 19, 2018
@pkgw pkgw self-assigned this Jul 19, 2018
@pkgw pkgw merged commit f79a7c2 into conda-forge:master Jul 19, 2018
@pkgw pkgw deleted the fix-curses-link branch July 19, 2018 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants