-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
CMake: Set CMAKE_OSX_ only on Darwin? #94952
Comments
I don't think setting it as an environment variable will have any effect, so we will need to put a guard around it in the setup hook. |
The real issue is NixOS#94952 or NixOS#94905.
I think just adding |
Why not use a Nix conditional? It should spare at least the Darwin rebuilds if done right. |
That will probably work, but splitting the setup hook could be a little tricky. We'd need two setup hooks - one for all systems, and one for darwin (and maybe even one for linux for consistency). It would definitely be better for issues like these in the future, but I'm always a little hesitant to rework some of the Bash logic given its brittleness. |
I kinda like that idea as it's simple and minimal. Though that might cause problems for cross-builds (if that even works between e.g. Darwin and Linux)? Would be nice if there would be an environment variable available in the Nix build for this (both with and without sandboxing).
Yeah, I guess merging the common parts is the most tricky part. One option could be to add scripts for Linux and Darwin that set and export an environment variable and then source |
I marked this as stale due to inactivity. → More info |
Another problem: since libjpeg-turbo/libjpeg-turbo@399aa37
|
I hope it is fixed in #114817 |
Nice! d16a875 (#114817) fixes/avoids the issues came from
|
In 68513e4 (part of #77632)
CMAKE_OSX_ARCHITECTURES=x86_64
was moved frompkgs/stdenv/darwin/default.nix
topkgs/development/tools/build-managers/cmake/setup-hook.sh
. As a result-DCMAKE_OSX_ARCHITECTURES=x86_64
is since then set on Linux as well.Until now this wasn't a problem as https://cmake.org/cmake/help/v3.18/variable/CMAKE_OSX_ARCHITECTURES.html states that:
Unfortunately that behaviour changed in CMake 3.18:
To avoid such regressions in the future it might be a good idea to set the following two CMake flags (source) only on Darwin:
cc CMake maintainers: @ttuegel @LnL7
cc @orivej (found this regression)
The text was updated successfully, but these errors were encountered: