Skip to content

Build failure: swift for aarch64 #295322

@natsukium

Description

@natsukium

Since #291901 was merged into the master, swift cannot be built on aarch64.

Steps To Reproduce

Steps to reproduce the behavior:

nix build github:NixOS/nixpkgs/0dd6aae052b3748d761c93efa16b49c02f8a14e4#swift

Build log

Run Build Command(s): /nix/store/40wywa8y2nsgws1lwj7nhmkbbsx1arq4-ninja-1.11.1/bin/ninja -v cmTC_809f1
[1/1] : && /private/tmp/nix-build-swift-5.8.drv-0/build/swift/bin/swiftc -j 8 -num-threads 8 -emit-executable -o cmTC_809f1 -emit-dependencies  -output-file-map CMakeFiles/cmTC_809f1.dir//output-file-map.json  /tmp/nix-build-swift-5.8.drv-0/build/swift-concurrency-backdeploy/CMakeFiles/CMakeScratch/TryCompile-DsXkpX/main.swift    && :
FAILED: cmTC_809f1 CMakeFiles/cmTC_809f1.dir/main.swift.o 
: && /private/tmp/nix-build-swift-5.8.drv-0/build/swift/bin/swiftc -j 8 -num-threads 8 -emit-executable -o cmTC_809f1 -emit-dependencies  -output-file-map CMakeFiles/cmTC_809f1.dir//output-file-map.json  /tmp/nix-build-swift-5.8.drv-0/build/swift-concurrency-backdeploy/CMakeFiles/CMakeScratch/TryCompile-DsXkpX/main.swift    && :
<unknown>:0: error: unknown argument: '-march=armv8.3-a+crypto+sha2+aes+crc+fp16+lse+simd+ras+rdm+rcpc'
ninja: build stopped: subcommand failed.

https://hydra.nixos.org/build/252498280
https://hydra.nixos.org/build/252595108

Additional context

reported in #291901 (comment)

I'm not familiar with swift or clang, but I'm using the following overlay as a workaround until it's fixed.

self: super: {
  swiftPackages = super.swiftPackages // {
    clang = super.swiftPackages.clang.overrideAttrs (oldAttrs: {
      postFixup =
        (oldAttrs.postFixup or "")
        + ''
          sed -i "s/'-march=.*'//g" $out/nix-support/add-local-cc-cflags-before.sh
        '';
    });
  };
};

Notify maintainers

@dtzWill @trepetti @dduan @Trundle @stephank

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.3.0, macOS 14.3.1`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/store/8ny3r3jvj17ljzc89h9rpfr56a7nyn8c-source`

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions