Open XYenon opened 3 months ago
Also failing in aarch64-darwin
:
error: builder for '/nix/store/rcdwli2c6v6f36yqzg66yj9bgmhjg9mc-swift-5.8.drv' failed with exit code 1;
last 25 log lines:
> ld: warning: Could not find or use auto-linked library 'swiftCompatibility56'
> Undefined symbols for architecture arm64:
> "__swift_FORCE_LOAD_$_swiftCompatibility56", referenced from:
> __swift_FORCE_LOAD_$_swiftCompatibility56_$_Optimizer in libswiftCompilerModules-bootstrapping1.a(Optimizer.o)
> __swift_FORCE_LOAD_$_swiftCompatibility56_$_SIL in libswiftCompilerModules-bootstrapping1.a(SIL.o)
> __swift_FORCE_LOAD_$_swiftCompatibility56_$_Basic in libswiftCompilerModules-bootstrapping1.a(Basic.o)
> __swift_FORCE_LOAD_$_swiftCompatibility56_$_Parse in libswiftCompilerModules-bootstrapping1.a(Parse.o)
> __swift_FORCE_LOAD_$_swiftCompatibility56_$__CompilerRegexParser in libswiftCompilerModules-bootstrapping1.a(_CompilerRegexParser.o)
> __swift_FORCE_LOAD_$_swiftCompatibility56_$_AST in libswiftCompilerModules-bootstrapping1.a(AST.o)
> (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility56_$__CompilerRegexParser, __swift_FORCE_LOAD_$_swiftCompatibility56_$_SIL , __swift_FORCE_LOAD_$_swiftCompatibility56_$_Parse , __swift_FORCE_LOAD_$_swiftCompatibility56_$_Basic , __swift_FORCE_LOAD_$_swiftCompatibility56_$_Optimizer , __swift_FORCE_LOAD_$_swiftCompatibility56_$_AST )
> "__swift_FORCE_LOAD_$_swiftCompatibilityConcurrency", referenced from:
> __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_Optimizer in libswiftCompilerModules-bootstrapping1.a(Optimizer.o)
> __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_SIL in libswiftCompilerModules-bootstrapping1.a(SIL.o)
> __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_Basic in libswiftCompilerModules-bootstrapping1.a(Basic.o)
> __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_Parse in libswiftCompilerModules-bootstrapping1.a(Parse.o)
> __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$__CompilerRegexParser in libswiftCompilerModules-bootstrapping1.a(_CompilerRegexParser.o)
> __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_AST in libswiftCompilerModules-bootstrapping1.a(AST.o)
> (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_AST, __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_Basic , __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_Parse , __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$__CompilerRegexParser , __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_Optimizer , __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_SIL )
> ld: symbol(s) not found for architecture arm64
> clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> [1105/1354] Building CXX object stdlib/public/RemoteInspection/CMakeFiles/swiftRemoteInspection-macosx-arm64.dir/TypeLowering.cpp.o
> clang-15-unwrapped: warning: overriding '-mmacos-version-min=10.15' option with '-target arm64-apple-macosx10.13' [-Woverriding-t-option]
> [1106/1354] Building CXX object stdlib/public/RemoteInspection/CMakeFiles/swiftRemoteInspection-macosx-arm64.dir/TypeRef.cpp.o
> clang-15-unwrapped: warning: overriding '-mmacos-version-min=10.15' option with '-target arm64-apple-macosx10.13' [-Woverriding-t-option]
> ninja: build stopped: subcommand failed.
For full logs, run 'nix log /nix/store/rcdwli2c6v6f36yqzg66yj9bgmhjg9mc-swift-5.8.drv'.
The interesting part is that I could build this locally in my laptop (macOS 14.5), but it isn't working in GitHub Actions (also macOS 14.5). Here is my logs from GitHub Actions: https://github.com/thiagokokada/nix-configs/actions/runs/9976188278/job/27567744849.
This also builds on the darwin community builder:
- system: `"aarch64-darwin"`
- host os: `Darwin 23.5.0, macOS 14.5`
- multi-user?: `yes`
- sandbox: `relaxed`
- version: `nix-env (Nix) 2.18.5`
- nixpkgs: `/nix/store/qapc95ms35a2syn25wawy4byy3h1zbiv-8sjaji13jiylfr93qcx0d7fqc1f4gm1s-source`
Hydra also failed by same errors
https://hydra.nixos.org/build/266353277/nixlog/2 https://hydra.nixos.org/build/266353180/nixlog/1
Hello swift maintainers @dtzWill @trepetti @dduan @Trundle @stephank
on the nixpkgs trunk branch, swift-unwrapped is currently failing to build on 3/4 platforms:
two of the above platforms (aarch64-darwin, x86_64-darwin) have been broken for 1.5 months :(
can you please take a look?
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
Just a note on how I workaround this, in case it's helpful for people who reach here.
I am able to build my system with the latest unstable with swift
replaced by the swift
from 2e92235aa591abc613504fde2546d6f78b18c0cd
(the previous commit of the first failed build of swift.aarch64-darwin https://hydra.nixos.org/build/262793523). In my setup swift
is only used by mpv
so YMMV.
(final: prev: let
pkgsDarwin= import darwin-nixpkgs {inherit (prev) system;};
in
prev.lib.optionalAttrs prev.stdenv.hostPlatform.isDarwin {
inherit (pkgsDarwin) swift;
})
where
darwin-nixpkgs.url = "github:nixos/nixpkgs?rev=2e92235aa591abc613504fde2546d6f78b18c0cd";
in flake.inputs.
Thanks @yelite for your flakes workaround
I don't use flakes myself, so one workaround I'm using for the moment is excluding all packages that pull in swift
as a dependency.
To do this:
swift
no longer appearedHere are the commands... I generated a derivation my next rebuild by using --dry-run
:
$ darwin-rebuild switch --dry-run
building the system configuration...
trace: warning: nixfmt was renamed to nixfmt-classic. The nixfmt attribute may be used for the new RFC 166-style formatter in the future, which is currently available as nixfmt-rfc-style
these 107 derivations will be built:
/nix/store/9cvhkxbx69pd8w9kw9xwcccn98bxdwc6-swift-5.8.drv
/nix/store/52bvqras0kmavb9x7mg5x2w8bjkfwwkc-swift-wrapper-5.8.drv
/nix/store/84a9v245r6829j6spf61bbv72a70s409-fix-stdlib-path.patch.drv
...
/nix/store/i37yr1qrlg15cjrv1rj5rmvsnrwh3asa-darwin-system-24.05pre634371.29e8e22b42cc+darwin4.drv
That's my next derivation there on the last line. I turned this next derivation into a dependency tree (i output it to a file so I could browse it a bit easier):
nix-store --query --tree /nix/store/i37yr1qrlg15cjrv1rj5rmvsnrwh3asa-darwin-system-24.05pre634371.29e8e22b42cc+darwin4.drv > ~/output_dependencies_next
After squinting hard at that file for a bit, it turns out that mpv
, or anything that depends on mpv
, will also pull in swift
as a dependency. This is unfortunate because mpv is pretty incredible and I'd hate to go without it. So, I excluded mpv
, and a few other packages like yt-dlp
, somafmcli
and curseradio
.
After excluding the above, the dependency tree of my next generation didn't include swift
, and I was finally able to run darwin-rebuild switch
to completion
FWIW Swift is getting fixed as we speak as part of the macOS SDK rework. That’s still a few weeks out from landing in unstable, though.
swift
is now failing to build on Linux. It's a transitive dependency of deadbeef
(an audio player). The direct dependency is swift-corelibs-libdispatch
.
The build error occurs when running swig
to create Python bindings:
FAILED: bindings/python/LLDBWrapPython.cpp bindings/python/lldb.py /build/build/lldb/bindings/python/LLDBWrapPython.cpp /build/build/lldb/bindings/python/lldb.py
cd /build/build/lldb/bindings/python && /nix/store/alain6ji648fj2fl073sag1324xr9ivd-python3-3.12.5-env/bin/python3.12 /build/src/llvm-project/lldb/bindings/prepare_bindings.py --srcRoot=/build/src/llvm-project/lldb --targetDir=/build/build/lldb/bindings/python --cfgBldDir=/build/build/lldb/bindings/python --prefix=/build/build/lldb --swig-executable=/nix/store/ssm2qdxyzffs94ivzs2irblnah23b7bd-swig-4.2.1/bin/swig
ERROR:root:swig failed with error code 1: stdout=b'', stderr=b"/build/src/llvm-project/lldb/bindings/interfaces.swig:5: Error: Macro '__STDC_LIMIT_MACROS' redefined,\n:EOF: Error: previous definition of '__STDC_LIMIT_MACROS'.\n"
ERROR:root:command line:
/nix/store/ssm2qdxyzffs94ivzs2irblnah23b7bd-swig-4.2.1/bin/swig -c++ -shadow -python -features autodoc -threads -I/build/src/llvm-project/lldb/include -I/build/src/llvm-project/lldb/bindings -I/build/src/llvm-project/lldb/bindings/python -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -outdir /build/build/lldb/bindings/python -o /build/build/lldb/bindings/python/LLDBWrapPython.cpp /build/src/llvm-project/lldb/bindings/python/python.swig
It’s a SWIG 4 issue; I’m working on it.
FWIW the Darwin SDK rework is not going to significantly change a lot of the problems with the Swift derivation. It’s pretty unmaintainable right now. If anyone is strongly invested in Swift, I strongly suggest trying to factor out their LLVM from the core Swift derivations. Right now it spends so much time building its own LLVM and Clang and so on. I don’t know whether the use of their specific LLVM fork is mandatory. If it isn’t, then we should just use the existing packages from Nixpkgs. If it is required, then it should at least be built with the LLVM package machinery we already have in‐tree so that we don’t have to duplicate patches and other complexity.
https://github.com/NixOS/nixpkgs/pull/341384
(This won’t fix the Darwin problems or Hydra weirdness though.)
The PR has now been merged and I successfully built Swift on aarch64-linux
and x86_64-darwin
. Would be good to hear more build reports to see if the problem here is fixed. We still don’t know what’s up with the builds on Hydra, though.
Works for me, using commit 418918ebb102 from master
, on an x86_64-linux
system.
Thanks for fixing this! :raised_hands:
Works for me as well on aarch64-darwin
!
The PR has now been merged and I successfully built Swift on
aarch64-linux
andx86_64-darwin
. Would be good to hear more build reports to see if the problem here is fixed. We still don’t know what’s up with the builds on Hydra, though.
Thanks Emily, i hadn't been using swift stuff for a bit and can confirm it fixed the issues I was having on my builds.
The PR has now been merged and I successfully built Swift on
aarch64-linux
andx86_64-darwin
. Would be good to hear more build reports to see if the problem here is fixed. We still don’t know what’s up with the builds on Hydra, though.
Does hydra weirdness mean this? https://hydra.nixos.org/build/272581651/nixlog/1
Yes. The hope is that Randy’s SDK rework will make it go away, but I don’t think anyone understands it. It builds successfully locally for everyone, as far as I know.
The PR has now been merged and I successfully built Swift on
aarch64-linux
andx86_64-darwin
. Would be good to hear more build reports to see if the problem here is fixed. We still don’t know what’s up with the builds on Hydra, though.
I have tried this on macOS 15.0 x86_64 and it builds failed 😭
- system: `"x86_64-darwin"`
- host os: `Darwin 24.0.0, macOS 10.16`
- multi-user?: `yes`
- sandbox: `relaxed`
- version: `nix-env (Nix) 2.18.5`
- nixpkgs: `/nix/store/cjz8w4dgc3rd2n3dqv5c208vygndjyba-source`
Same failure when bumping devenv-nixpkgs: https://github.com/cachix/devenv/actions/runs/11140734654/job/30961906452?pr=1489#step:7:4516
Can someone try building swift on https://github.com/NixOS/nixpkgs/pull/346043
Can someone try building swift on #346043
Swift is definitely broken on #346043. I have a separate set of fixes for building Swift after that is merged. I’ll be opening that (and others) later today, but it won’t be able to merge until after that PR is merged.
https://github.com/NixOS/nixpkgs/pull/346947 is the follow up PR for Swift that fixes it to build with the new SDK.
Swift still built failed after https://github.com/NixOS/nixpkgs/pull/326588 has been merged.
Steps To Reproduce
Steps to reproduce the behavior:
Build log
Additional context
Add any other context about the problem here.
Notify maintainers
@dtzWill @trepetti @dduan @Trundle @stephank
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.