| 11 Nov 2024 |
emily | In reply to @reckenrode:matrix.org That seems to be a Nix problem where any change in inputs cause rebuilds even when they don’t matter. a problem that the solution to breaks Darwin in other ways… | 22:23:49 |
Randy Eckenrode | In reply to @emilazy:matrix.org it seems like the wrapper would still cause rebuilds because ld-wrapper is used to build clang-unwrapped, etc., but maybe I don't fully understand the rebuild issue If you’re using a different linker, I’d expect clang-unwrapped to be rebuilt. There’s no avoiding that. | 22:24:29 |
emily | well, the linker wouldn't matter, since it's only for the target platform | 22:25:52 |
emily | but hm | 22:25:54 |
emily | is ld-wrapper different for the target linker vs. the host one? | 22:26:12 |
emily | I guess it must be? | 22:26:14 |
emily | in which case yeah I guess we can move it in there. | 22:26:20 |
Randy Eckenrode | Of course it is. It references the absolute path to the host linker. | 22:27:08 |
Randy Eckenrode | * | 22:28:46 |
emily | do you just reference stdenv.hostPlatform.isDarwin in the ld-wrapper derivation and it means stdenv.targetPlatform.isDarwin when you put it in pkgsBuildTarget? | 22:29:29 |
Randy Eckenrode | 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=1unconditionally?
| 23:08:53 |
Randy Eckenrode | * 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?
| 23:08:59 |
Randy Eckenrode | (I’m guessing yes.)
| 23:09:14 |
Randy Eckenrode | I guess just revert the commit that set NIX_DONT_SET_RPATH_FOR_TARGET for now.
| 23:11:10 |
Randy Eckenrode | I wonder if NIX_DONT_SET_RPATH should be set in a hook that properly does role mangling.
| 23:11:35 |
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 |