-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
expat: Fix cmake config files #128997
expat: Fix cmake config files #128997
Conversation
|
@OPNA2608 the generated |
|
The current problem is that expat's CMake files and headers get installed to a different prefix ( |
|
@OPNA2608 is this an upstream bug or a nixOS packaging bug? If upstream, please help me reproduce it on a more mainstream flavor of Linux. |
|
I think this is a 50:50 situation. There may be a problem with the paths passed via the
On a Ubuntu 18.04.5 system after # Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target expat::expat
add_library(expat::expat SHARED IMPORTED)
set_target_properties(expat::expat PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)Running the 4 This is what would happen on NixOS as well, but the The last path component of the I hope this helps you with reproducing the bug on your end. |
|
@OPNA2608 thanks, I think the issue is clear now. Given the high complexity and effort for a clean fix upstream, I cannot promise a soon fix at the moment. Patching this for this in nixOS packaging is probably a good idea. |
|
@ofborg eval (Sorry, ofborg's certs recently had an issue, meaning that it was unable to |
903cd9f
to
ab86042
Compare
Header & library path constructions in CMake modules expect them to reside under the same prefix as the CMake files. This assumption doesn't work with our multiple outputs so we patch the library path to the correct output. Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
…ilding" This reverts commit 7d82e18.
ab86042
to
74af056
Compare
Closes #128808
This is a universal fix for what the above PR was trying to implement locally.
Motivation for this change
As mentioned in #128808, the expat bump from #124212 introduced new, currently broken CMake files. This broke the freshly introduced opencolorio 2.x (part of #127522) and in turn our Blender package. This patches those files so everything works again.
Why are they broken?
expat.cmake:expat-noconfig.cmake:Since
_IMPORT_PREFIXis calculated from thedevoutput that has the cmake files but the libraries are in theoutoutput, the later check can never find the libraries. We'll replace the${_IMPORT_PREFIX}usage in the library path with the correct output variable.CC @hartwork, upstream expat developer & committer of the bump that introduced these files
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)