!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1179 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org194 Servers

Load older messages


SenderMessageTime
13 Jan 2026
@emilazy:matrix.orgemilythough, yeah, avoiding patching at all is nicer01:17:01
@emilazy:matrix.orgemilycan we just symlink the compiler and the stdlib nearby?01:17:11
@reckenrode:matrix.orgRandy EckenrodeThat’s what I want to do, but I also want them to be discoverable by the linker.01:18:28
@reckenrode:matrix.orgRandy Eckenrode How does it work on Linux? Does linking with a .so at some path automatically set up the rpath? 01:18:44
@reckenrode:matrix.orgRandy EckenrodeIt makes me wonder what even the point of the patch is if the linker will handle things for us.01:20:35
@reckenrode:matrix.orgRandy Eckenrode

“It also fixes the output of swift -frontend -print-target-info, which SwiftPM uses to set the rpath on Linux.”

If the .sos are in the normal place, won’t the linker take care of this for us?

01:21:27
@emilazy:matrix.orgemilyis this about one of our existing patches?01:22:38
@emilazy:matrix.orgemilyI figured you would have just thrown all of those away…01:22:45
@emilazy:matrix.orgemily I assumed -L would add to the rpath or such. 01:23:42
@emilazy:matrix.orgemilynot sure exactly how it works.01:23:44
@reckenrode:matrix.orgRandy Eckenrode The separate lib patch. 01:24:10
@emilazy:matrix.orgemilyoh, our wrapper does it.01:24:37
@emilazy:matrix.orgemily
# Three tasks:
#
#   1. Find all -L... switches for rpath
01:24:40
@reckenrode:matrix.orgRandy Eckenrodehttps://github.com/NixOS/nixpkgs/blob/c3d8909996f4f24ed7cbeeee7600ee75c873fd04/pkgs/development/compilers/swift/compiler/patches/swift-separate-lib.patch01:24:50
@emilazy:matrix.orgemilythat one is nonsense anyway01:25:10
@reckenrode:matrix.orgRandy Eckenrode I assume the reason why that doesn’t work with Swift is the libraries are not in $out/lib, but I’ve taken to putting all of them there in my work. 01:25:13
@reckenrode:matrix.orgRandy EckenrodeSo the linker should do the right thing.01:25:23
@emilazy:matrix.orgemily IIRC half of what's in $lib is not required at runtime 01:25:25
@emilazy:matrix.orgemilyand there's some dumb dependency too01:25:51
@reckenrode:matrix.orgRandy EckenrodeI’ve got the stdlib build with only the host shared libraries. Build platform stuff is staying with the compiler.01:26:09
@reckenrode:matrix.orgRandy EckenrodeSo in theory you can make a cross-Swift using the new host’s stdlib.01:26:32
@reckenrode:matrix.orgRandy EckenrodeBut cross won’t work out of the box with my work. It doesn’t now, and I don’t want to spend time on it right now.01:26:50
@reckenrode:matrix.orgRandy EckenrodeI want to get Swift updated to 6.2.x with the rewritten package set, so I can switch gears back to Darwin for a bit.01:27:39
@reckenrode:matrix.orgRandy EckenrodeI’d really like to get it using only LLVM bintools, but that requires some work on the wrapper.01:27:51
@emilazy:matrix.orgemily

ok, yeah, this is why the current lib patch is nonsense:

shion:/v/f/1/j/T/tmp.xaiYxboQnX
❭ l result-lib/lib/swift/
total 8
dr-xr-xr-x   5 root  nixbld   160B  1 Jan  1970 _InternalSwiftScan/
dr-xr-xr-x   5 root  nixbld   160B  1 Jan  1970 _InternalSwiftStaticMirror/
dr-xr-xr-x   5 root  nixbld   160B  1 Jan  1970 apinotes/
dr-xr-xr-x   5 root  nixbld   160B  1 Jan  1970 clang/
dr-xr-xr-x   6 root  nixbld   192B  1 Jan  1970 FrameworkABIBaseline/
dr-xr-xr-x   3 root  nixbld    96B  1 Jan  1970 host/
dr-xr-xr-x  40 root  nixbld   1.3K  1 Jan  1970 macosx/
dr-xr-xr-x  12 root  nixbld   384B  1 Jan  1970 migrator/
-r--r--r--   1 root  nixbld   186B  1 Jan  1970 module.modulemap
dr-xr-xr-x  27 root  nixbld   864B  1 Jan  1970 shims/
dr-xr-xr-x   5 root  nixbld   160B  1 Jan  1970 swiftToCxx/
01:28:02
@emilazy:matrix.orgemilythere's even header files in there01:28:13
@emilazy:matrix.orgemilybut ofc if you made the output less dumb in the rework that's another matter :)01:28:23
@reckenrode:matrix.orgRandy EckenrodeThe reason why LLD currently “works” is it relies on Clang to pass the correct flags. It’s not even wrapped.01:28:29
@reckenrode:matrix.orgRandy Eckenrode
$ nix build -f . swiftPackages.stdlib^\*
$ ls result/**
result/lib/lib_InternalSwiftStaticMirror.dylib*
result/lib/libswift_Builtin_float.dylib*
result/lib/libswift_Concurrency.dylib*
result/lib/libswift_Differentiation.dylib*
result/lib/libswift_RegexParser.dylib*
result/lib/libswift_StringProcessing.dylib*
result/lib/libswift_Volatile.dylib*
result/lib/libswiftCompatibilitySpan.dylib@
result/lib/libswiftCore.dylib*
result/lib/libswiftDistributed.dylib*
result/lib/libswiftObservation.dylib*
result/lib/libswiftRegexBuilder.dylib*
result/lib/libswiftRemoteMirror.dylib*
result/lib/libswiftRuntime.dylib*
result/lib/libswiftSwiftOnoneSupport.dylib*
result/lib/libswiftSynchronization.dylib*
result/lib/swift-6.2/macosx/libswiftCompatibilitySpan.dylib*

result/lib:
lib_InternalSwiftStaticMirror.dylib*  libswiftDistributed.dylib*
libswift_Builtin_float.dylib*         libswiftObservation.dylib*
libswift_Concurrency.dylib*           libswiftRegexBuilder.dylib*
libswift_Differentiation.dylib*       libswiftRemoteMirror.dylib*
libswift_RegexParser.dylib*           libswiftRuntime.dylib*
libswift_StringProcessing.dylib*      libswiftSwiftOnoneSupport.dylib*
libswift_Volatile.dylib*              libswiftSynchronization.dylib*
libswiftCompatibilitySpan.dylib@      swift-6.2/
libswiftCore.dylib*

result/lib/swift-6.2:
macosx/

result/lib/swift-6.2/macosx:
libswiftCompatibilitySpan.dylib*
01:29:17
@emilazy:matrix.orgemily an output with the runtime libraries required for Swift binaries (on Linux only, I guess?) would make sense, but the current lib ain't it 01:29:20

Show newer messages


Back to Room ListRoom Version: 6