Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swift: 3.1.1 -> 4.0.3 #34893

Merged
merged 2 commits into from Feb 18, 2018
Merged

swift: 3.1.1 -> 4.0.3 #34893

merged 2 commits into from Feb 18, 2018

Conversation

taku0
Copy link
Contributor

@taku0 taku0 commented Feb 12, 2018

Motivation for this change

Fixed build. Version bump.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Tested swift command, swiftc command, and swift run command against example-package-dealer.


@joachifm
Copy link
Contributor

@GrahamcOfBorg build swift

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

Package ‘swift-4.0.3’ in /var/lib/gc-of-borg/nix-test-rs-3/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-3/pkgs/development/compilers/swift/default.nix:301 is not supported on ‘aarch64-linux’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘swift-4.0.3’ in /private/var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/development/compilers/swift/default.nix:301 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@joachifm
Copy link
Contributor

cc @dtzWill

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

gzipping man pages under /nix/store/fri1fklyrbim8gqx27bvnpq80x6rbfi1-swift-4.0.3/share/man/
strip is /nix/store/adidfx4pa7vmvby0gjqqmiwg2x49yr27-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/fri1fklyrbim8gqx27bvnpq80x6rbfi1-swift-4.0.3/lib  /nix/store/fri1fklyrbim8gqx27bvnpq80x6rbfi1-swift-4.0.3/libexec  /nix/store/fri1fklyrbim8gqx27bvnpq80x6rbfi1-swift-4.0.3/bin 
patching script interpreter paths in /nix/store/fri1fklyrbim8gqx27bvnpq80x6rbfi1-swift-4.0.3
checking for references to /tmp/nix-build-swift-4.0.3.drv-0 in /nix/store/fri1fklyrbim8gqx27bvnpq80x6rbfi1-swift-4.0.3...
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
/nix/store/fri1fklyrbim8gqx27bvnpq80x6rbfi1-swift-4.0.3

@dtzWill
Copy link
Member

dtzWill commented Feb 18, 2018

Apologies for not seeing this earlier! Also, wow thanks for working on this! Testing and reviewing presently...

};
libdispatch = fetch {
repo = "swift-corelibs-libdispatch";
sha256 = "0ckjg41fjak06i532azhryckjq64fkxzsal4svf5v4s8n9mkq2sg";
sha256 = "0x8zzq3shhvmhq4sbhaaa0ddiv3nw347pz6ayym6jyzq7j9n15ia";
fetchSubmodules = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: No longer need to fetch submodules, doesn't change hash though:
apple/swift-corelibs-libdispatch@703b1d5

-e 's|/usr/bin/make|${gnumake}/bin/make|g' \
-e 's|/bin/mkdir|${coreutils}/bin/mkdir|g' \
-e 's|/bin/cp|${coreutils}/bin/cp|g' \
-e 's|/usr/bin/file|${file}/bin/file|g'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit heavy-handed, but if it does the trick... works for me!

@@ -232,23 +244,21 @@ stdenv.mkDerivation rec {
# https://bugs.swift.org/browse/SR-4633
patch -p1 -d swift -i ${./patches/icu59.patch}

# https://bugs.swift.org/browse/SR-5779
sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if this can be made to work with libc++ instead of gcc-based (libstdc++-based) clang? Just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libatomic.so is required for __atomic_load and other __atomic_* functions. If libc++ provides them, we may eliminate dependency to GCC apckage.

Copy link
Member

@dtzWill dtzWill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT works as well as it ever did, thanks again!

@dtzWill
Copy link
Member

dtzWill commented Feb 18, 2018

When merged to master will need to work with LLVM/Clang 5 (now the default), or specifically use LLVM 4.

@joachifm joachifm merged commit dc2b7b9 into NixOS:master Feb 18, 2018
@dtzWill
Copy link
Member

dtzWill commented Feb 19, 2018

Don't know what the cause is, but the 'ar' is a broken link it appears, at least on this branch (haven't tried it post-merge yet). Is that what you're seeing?

@taku0
Copy link
Contributor Author

taku0 commented Feb 19, 2018

@dtzWill ar is pointing to binutils-wrapper package while it doesn't contains ar. The link should point to binutils.

@fragamus
Copy link
Contributor

fragamus commented Feb 26, 2018

running 17.09 stable, I did this:

git clone git@github.com:NixOS/nixpkgs.git
cd nixpkgs
nix-build -A swift

And I got this:

/tmp/nix-build-swift-4.0.3.drv-0/src/lldb/include/lldb/Utility/TaskPool.h:122:12: error: no member named 'bind' in namespace 'std'

Should I start a new issue on this?

@dtzWill
Copy link
Member

dtzWill commented Feb 26, 2018

Looks like gcc7 broke it? (edit: speculation given timing ^_^)

Build log: https://hydra.nixos.org/build/69887235/nixlog/1

Last successful build: https://hydra.nixos.org/build/69575672

And sure:re issue. Don't have time to look into it currently but hopefully this is just a matter of building with gcc6 not the new default gcc7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants