| 17 Jan 2026 |
emily | we could copy the stdlib in too if necessary | 18:41:28 |
emily | although that means targetPlatform evil | 18:41:46 |
Randy Eckenrode | The problem is swiftc looks for its libraries in the path where it really is. | 18:42:12 |
Randy Eckenrode | So if swiftc is a symlink, it will look in the swiftc package, but that package has no stdlib. | 18:42:34 |
Randy Eckenrode | What I want is for it to look in the swift package that symlinks all the stuff together. | 18:42:52 |
Randy Eckenrode | swiftc, swift-driver, swift-corelibs-xctest, swift-testing, (on Linux), swift-corelibs-foundation, etc. | 18:43:23 |
Randy Eckenrode | * swiftc, swift-driver, the stdlib, swift-corelibs-xctest, swift-testing, (on Linux), swift-corelibs-foundation, etc. | 18:43:49 |
emily | right. unfortunate that that will involve targetPackages for a multi-target compiler but maybe we can figure something out with upstream one day | 18:44:14 |
emily | how does their whole cross SDK stuff work upstream? | 18:44:31 |
Randy Eckenrode | You specify --sdk <path to SDK>. | 18:45:15 |
Randy Eckenrode | AFAIK | 18:45:16 |
Randy Eckenrode | There are static Linux SDKs for various distros. | 18:45:27 |
Randy Eckenrode | * | 18:45:48 |
Randy Eckenrode | Supporting cross-compilation is a non-goal currently for my Swift work. It doesn’t currently work. Having the stdlib separate at least moves us in the right direction. | 18:47:13 |
Randy Eckenrode | Right now I’m just looking for spliced packages in things that care about that. | 18:48:25 |
Randy Eckenrode | https://github.com/reckenrode/nixpkgs/blob/139e88d5b9ed888bc534afcb981c4d79698fecb3/pkgs/by-name/sw/swiftPackages/by-name/sw/swiftc/package.nix#L61-L97 | 18:49:43 |
Randy Eckenrode | If cross just happens to work, yay. I doubt it will, though we’re closer than we are currently. | 18:50:26 |
emily | I was wondering whether we can avoid this "looking at its own location" by just putting that stuff in the SDK. | 18:51:47 |
emily | then the SDK is a build input, a la apple-sdk. the compiler could propagate the ones for the host and target platforms | 18:52:45 |
Randy Eckenrode | We would have to vend a special SDK on Darwin that adds the Swift libs the apple-sdk. | 19:30:39 |
Randy Eckenrode | Maybe we can do that, but it can be done in a follow up. | 19:30:56 |
emily | ah, it expects the other macOS SDK stuff mixed in with the Swift stuff? fun | 20:39:11 |
Randy Eckenrode | It maps SDKROOT to --sdk automatically. | 20:41:00 |
emily | gotcha | 20:43:05 |
Ihar Hrachyshka | compiler-rt build fix for x86_64-darwin is confirmed: https://github.com/NixOS/nixpkgs/pull/480889 | 20:43:09 |
| 18 Jan 2026 |
gigamonster256 | I'm having trouble getting an app to run on x86_64-darwin derivation here: https://github.com/gigamonster256/opencode/blob/48050d51580cc332979c589e2ed260984f240cd6/nix/opencode.nix
opencode> 34 | export function systemArchitectureSync() {
opencode> 35 | const {arch, platform, env} = process;
opencode> 36 |
opencode> 37 | // Detect Node.js x64 binary running under Rosetta 2 on a ARM64 Mac.
opencode> 38 | if (platform === 'darwin' && arch === 'x64') {
opencode> 39 | const stdout = childProcess.execFileSync('sysctl', ['-inq', 'sysctl.proc_translated'], {encoding: 'utf8'});
opencode> ^
opencode> error: Executable not found in $PATH: "sysctl"
opencode> path: "sysctl",
opencode> errno: -2,
opencode> syscall: "spawnSync sysctl",
opencode> spawnargs: [ "-inq", "sysctl.proc_translated" ],
opencode> signal: null,
opencode> status: undefined,
opencode> output: [
opencode> null, null, null
opencode> ],
any advice for making sure the sysctl command is found? some sort of wrapProgram? adding sysctl to buildInputs didnt seem to make a difference
| 00:15:08 |
Randy Eckenrode | Try adding it to nativeBuildInputs. | 00:16:39 |
gigamonster256 | no dice on that either iirc, I'll double check, the failure happens when running install checks and generating shell completions | 00:18:47 |
Randy Eckenrode | https://github.com/NixOS/nixpkgs/pull/477520#issuecomment-3764540038 | 00:45:49 |
Randy Eckenrode | While I wasn’t successful due to not having intentbuilderc, that’s promising. | 00:46:09 |