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

Disable Rust doctests on Darwin. #49839

Closed
wants to merge 1 commit into from

Conversation

danieldk
Copy link
Contributor

@danieldk danieldk commented Nov 6, 2018

Motivation for this change

Since Rust 1.30 (?) some Rust crates do not build, see e.g. #49693 and #49708
and fail with:

dyld: Symbol not found: __ZTIN4llvm2cl18GenericOptionValueE

So far, the common pattern seems to be that the linking fails in doctests. This
change is a temporary workaround that disables doctests for Rust crates on
Darwin. This avoids the need to patch individual derivations and still runs
library tests.

Tested: building alacritty and nix-index on Darwin with tests enabled.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Since Rust 1.30 (?) some Rust crates do not build, see e.g. NixOS#49693 and NixOS#49708
and fail with:

dyld: Symbol not found: __ZTIN4llvm2cl18GenericOptionValueE

So far, the common pattern seems to be that the linking fails in doctests. This
change is a temporary workaround that disables doctests for Rust crates on
Darwin. This avoids the need to patch individual derivations and still runs
library tests.
@GrahamcOfBorg GrahamcOfBorg added the 6.topic: darwin Running or building packages on Darwin label Nov 6, 2018
@danieldk
Copy link
Contributor Author

danieldk commented Nov 6, 2018

@GrahamcOfBorg build alacritty nix-index

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: alacritty, nix-index

Partial log (click to expand)

copying path '/nix/store/6amr35ylmd648qcif3migqcq1yxcl8v8-libglvnd-1.0.0' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/9xhc56gqhrsy1p0xhwzw6j79ddh31ikc-libpng-apng-1.6.34' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/z0bh4cgaj6z1g2gkw7i54g3hspbb64rf-libGL-1.0.0' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/g9p94w6fx4hckhalmsk3rk9anapckfwp-freetype-2.9' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/rzsazacxnj78fiwm15v804ykpkpm4dyp-nix-index-0.1.2' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/c394zcr40gx8x97iwyc4xng6glbk02by-fontconfig-2.12.6-lib' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/kvadmbyjd8lg86rz29b1w8n7vzhd9akn-xclip-0.13' from 'https://nix-cache.s3.amazonaws.com'...
copying path '/nix/store/q812836bwhcyd0535pfn1zxha80b5qbq-alacritty-unstable-0.2.1' from 'https://nix-cache.s3.amazonaws.com'...
/nix/store/q812836bwhcyd0535pfn1zxha80b5qbq-alacritty-unstable-0.2.1
/nix/store/rzsazacxnj78fiwm15v804ykpkpm4dyp-nix-index-0.1.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nix-index

The following builds were skipped because they don't evaluate on aarch64-linux: alacritty

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2
shrinking /nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2/bin/nix-locate
shrinking /nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2/bin/nix-index
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2/bin
patching script interpreter paths in /nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2
/nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2/etc/profile.d/command-not-found.sh: interpreter directive changed from "/bin/sh" to "/nix/store/dsyc1z7ck08ga7l0b1jcxx35wj69qcii-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2...
/nix/store/299bcy5rp0qg8q5iihbbfj7rlahc739l-nix-index-0.1.2

@danieldk
Copy link
Contributor Author

danieldk commented Nov 7, 2018

This fails when there are no library targets in a Rust project.

@danieldk danieldk closed this Nov 7, 2018
@danieldk danieldk deleted the darwin-no-doctest branch June 4, 2019 05:55
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

2 participants