| 11 Nov 2024 |
Randy Eckenrode | Does that have the same problem? | 23:11:58 |
Randy Eckenrode | I assume it would have to be a hook that is run on every platform and detects the target platform at build time. 🫤 | 23:14:08 |
emily | In reply to @reckenrode:matrix.org
Hmm. Would it be disgustingly hacky to set NIX_DONT_SET_RPATH_aarch64_apple_darwin=1 and NIX_DONT_SET_RPATH_x86_64_apple_darwin=1 unconditionally?
this seems fine. | 23:19:31 |
emily | In reply to @emilazy:matrix.org do you just reference stdenv.hostPlatform.isDarwin in the ld-wrapper derivation and it means stdenv.targetPlatform.isDarwin when you put it in pkgsBuildTarget? would this not work though? do you always have a build→target toolchain available by default? | 23:20:01 |
emily | how does it get set for Darwin build/host anyway? | 23:21:35 |
emily | that stdenv thing only sets it for target | 23:21:40 |
Randy Eckenrode | preHook = preHook + lib.optionalString buildPlatform.isDarwin ''
export NIX_DONT_SET_RPATH_FOR_BUILD=1
'' + lib.optionalString (hostPlatform.isDarwin || (!hostPlatform.isElf && !hostPlatform.isMacho)) ''
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
'' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) ''
export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion}
'' + lib.optionalString targetPlatform.isDarwin ''
export NIX_DONT_SET_RPATH_FOR_TARGET=1
'';
| 23:22:58 |
Randy Eckenrode | Just to make sure I understand, the expectation is that clang.cc == pkgsCross.x86_64-darwin.buildPackages.clang.cc == pkgsCross.gnu64.buildPackages.clang.cc?
| 23:23:39 |
Randy Eckenrode | Since clang is a multi-target cross-compiler by default. | 23:23:54 |
Randy Eckenrode | Was there an issue on GitHub? I thought I got pinged, but my notifications aren’t showing anything. | 23:24:33 |
emily | there's a discourse thread | 23:26:27 |
emily | In reply to @reckenrode:matrix.org
Just to make sure I understand, the expectation is that clang.cc == pkgsCross.x86_64-darwin.buildPackages.clang.cc == pkgsCross.gnu64.buildPackages.clang.cc?
I think this is the idea, yes | 23:26:40 |
Randy Eckenrode | In reply to @emilazy:matrix.org I think this is the idea, yes I tried reverting the NIX_DONT_SET_RPATH_FOR_TARGET change. It didn’t seem to make a difference.
| 23:27:03 |
emily | In reply to @reckenrode:matrix.org
preHook = preHook + lib.optionalString buildPlatform.isDarwin ''
export NIX_DONT_SET_RPATH_FOR_BUILD=1
'' + lib.optionalString (hostPlatform.isDarwin || (!hostPlatform.isElf && !hostPlatform.isMacho)) ''
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
'' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) ''
export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion}
'' + lib.optionalString targetPlatform.isDarwin ''
export NIX_DONT_SET_RPATH_FOR_TARGET=1
'';
honestly, just replacing all of that with NIX_DONT_SET_RPATH_aarch64_apple_darwin/NIX_DONT_SET_RPATH_x86_64_apple_darwin seems cool to me | 23:27:14 |
emily | In reply to @reckenrode:matrix.org
I tried reverting the NIX_DONT_SET_RPATH_FOR_TARGET change. It didn’t seem to make a difference.
there's the nostdlibinc patch | 23:27:24 |
emily | try removing it entirely | 23:27:32 |
Randy Eckenrode | In reply to @emilazy:matrix.org honestly, just replacing all of that with NIX_DONT_SET_RPATH_aarch64_apple_darwin/NIX_DONT_SET_RPATH_x86_64_apple_darwin seems cool to me It’s exposing a cc-wrapper internal detail, which is also different on static Darwin builds. | 23:27:38 |
Randy Eckenrode | In reply to @emilazy:matrix.org try removing it entirely Doesn’t matter either. | 23:28:47 |
Randy Eckenrode | In reply to @emilazy:matrix.org try removing it entirely * | 23:28:54 |
Randy Eckenrode | Does every clang dependency have to be audited for targetPlatform stuff?
| 23:29:59 |
Randy Eckenrode | Note that this includes my “Darwin as useLLVM” work.
| 23:30:30 |
emily | well, ideally targetPlatform would be null so they would have no way of depending on it | 23:30:58 |
emily | I'm curious what nix-diff says though | 23:31:09 |
Randy Eckenrode | Output of nix-diff $(nix-instantiate . -A clang.cc) $(nix-instantiate . -A pkgsCross.gnu64.buildPackages.clang.cc) with the NIX_DONT_SET_RPATH_FOR_TARGET change reverted and the -nostdlibinc patches dropped.
https://gist.github.com/reckenrode/be122136283d8ed5a05d52f2f57d8809
| 23:41:53 |
emily | the bootstrap stuff seems solvable | 23:43:15 |
emily | if we used the earlier stage compilers to bootstrap pkgsCross | 23:43:26 |
emily | I think comparing two pkgsCrosses would be more enlightening though | 23:43:39 |
emily | since that's still significantly more sharing | 23:43:42 |
emily | and would eliminate that difference | 23:43:47 |
emily | like gnu64 and aarch64-multiplatform instead | 23:43:56 |