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

Linking with cargo-zigbuild failed on armv7-unknown-linux-{gnu, musl}eabihf due to missing symbols #108392

Open
NobodyXu opened this issue Feb 23, 2023 · 19 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. P-medium Medium priority requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@NobodyXu
Copy link
Contributor

release-builds / armv7-unknown-linux-musleabihf

release-builds / armv7-unknown-linux-gnueabihf

This can be reproduced by running:

git clone https://github.com/cargo-bins/cargo-binstall
cd cargo-binstall

export CI=true
export JUST_FOR_RELEASE=true
export CARGO_BUILD_TARGET="armv7-unknown-linux-gnueabihf"
export GLIBC_VERSION='2.17'
export JUST_USE_CARGO_ZIGBUILD=true
just build

Or by running the following cmds on the clone:

export RUSTFLAGS='-Z share-generics -C linker-plugin-lto -C link-arg=-static-libgcc -C link-arg=-Wl,--icf=safe'

cargo-zigbuild build  --release --target armv7-unknown-linux-musleabihf -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --config='profile.release.split-debuginfo="packed"' --config=profile.release.debug=2 --features static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto

The CI failed with several missing symbols.

Also, cargo-zigbuild failed to handle several link args:

  = note: warning: unsupported linker arg: -znoexecstack
          warning: unsupported linker arg: -plugin-opt
          warning: unsupported linker arg: O2
          warning: unsupported linker arg: -plugin-opt
          warning: unsupported linker arg: mcpu=generic
          warning: unsupported linker arg: -zrelro
          warning: unsupported linker arg: -znow
          warning: unsupported linker arg: --icf
          warning: unsupported linker arg: safe

Version it worked on

It most recently worked on: rust version 1.69.0-nightly (7aa413d59 2023-02-19)

Version with regression

rust version 1.69.0-nightly (5243ea5c2 2023-02-20)

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

@NobodyXu NobodyXu added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Feb 23, 2023
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. and removed regression-untriaged Untriaged performance or correctness regression. labels Feb 23, 2023
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 24, 2023
@Urgau
Copy link
Member

Urgau commented Feb 26, 2023

#108307 should have fixed the -z args. Could you try with the lastest nightly and report if anything has changed.

@NobodyXu
Copy link
Contributor Author

#108307 should have fixed the -z args. Could you try with the lastest nightly and report if anything has changed.

@Urgau The CI still failed on 1.69.0-nightly (34e6673a0 2023-02-25).

@Urgau
Copy link
Member

Urgau commented Feb 26, 2023

I see that the warnings for the unsupported -z args have now disappear (which is good), the other warnings are still there.

I also see that every linking errors have lto.tmp in them, which makes me thing that there might be an issue with LTO. Have to tried disabling it (to see if it fixes the problem) ?


Looking at the PR merged on the 2023-02-19 I don't see anything suspect. Could you try using cargo-rustc-bisect with a custom script to try to find the the commit that regressed your workflow.

@NobodyXu
Copy link
Contributor Author

I also see that every linking errors have lto.tmp in them, which makes me thing that there might be an issue with LTO. Have to tried disabling it (to see if it fixes the problem) ?

I've tried disabling cross-lang-lto and feature "zstd/cross-lang-fat-lto".

It could be a lto problem, since the debug build, which does not turn on lto, works just fine.

Could you try using cargo-rustc-bisect with a custom script to try to find the the commit that regressed your workflow.

Yeah I could try this tomorrow.

@NobodyXu
Copy link
Contributor Author

NobodyXu commented Feb 26, 2023

I'm using:

./test-regression.sh:

export CI=true
export JUST_FOR_RELEASE=true
export CARGO_BUILD_TARGET=armv7-unknown-linux-gnueabihf
export GLIBC_VERSION=2.17
export JUST_USE_CARGO_ZIGBUILD=true
just build

And then I am running cargo bisect-rustc --script ./test-regression.sh.
Will post the result tomorrow since it's too late now.

Edit:

It didn't work, will figure it out tomorrow.

@NobodyXu
Copy link
Contributor Author

@Urgau Running:

export RUSTFLAGS='-Z share-generics -C linker-plugin-lto  -C link-arg=-Wl,--icf=safe'

cargo bisect-rustc \
    --by-commit --start '7aa413d59'\
    --target armv7-unknown-linux-gnueabihf --with-src --verbose -- \
    zigbuild --release --target armv7-unknown-linux-gnueabihf.2.17 \
    -Z build-std=std,panic_abort \
    -Z build-std-features=panic_immediate_abort \
    --config='profile.release.split-debuginfo="packed"' \
    --config=profile.release.debug=2 \
    --features static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto

gives me:

checking the start range to verify it passes
installing 7aa413d59206fd511137728df3d9e0fd377429bd
rust-std-nightly-armv7-unknown-linux-gnueabihf: 26.55 MB / 26.55 MB [============] 100.00 % 949.12 KB/s 
testing...
RESULT: 7aa413d59206fd511137728df3d9e0fd377429bd, ===> Yes
uninstalling 7aa413d59206fd511137728df3d9e0fd377429bd

ERROR: the commit at the start of the range (7aa413d59206fd511137728df3d9e0fd377429bd) includes the regr
ession

which is strange, because this is the one that worked.

@Urgau
Copy link
Member

Urgau commented Feb 27, 2023

The bisection wasn't successful. cargo-rustc-bisect needs to start from a known good commit/date. You need to choose a commit before this one, because 7aa413d5920 include the regression.

I would recommend using --start=2023-02-15 instead of --by-commit --start '7aa413d59'.

But I wouldn't be surprised if 7aa413d59 was the commit that regressed since it's the only one who modified the codegen on the 19 feb.

@NobodyXu
Copy link
Contributor Author

@Urgau I got a panic when using --start=2023-02-15:

finding commit range that corresponds to dates specified
thread 'main' panicked at 'internal error: entered unreachable code', /Users/nobodyxu/.cargo/registry/sr
c/git.luolix.top-1ecc6299db9ec823/cargo-bisect-rustc-0.6.5/src/main.rs:417:22
stack backtrace:
   0:        0x102c65964 - __mh_execute_header
   1:        0x102b05344 - __mh_execute_header
   2:        0x102c42378 - __mh_execute_header
   3:        0x102c69bb0 - __mh_execute_header
   4:        0x102c69810 - __mh_execute_header
   5:        0x102c6a6f0 - __mh_execute_header
   6:        0x102c6a258 - __mh_execute_header
   7:        0x102c6a1ec - __mh_execute_header
   8:        0x102c6a1c8 - __mh_execute_header
   9:        0x102d39c7c - __mh_execute_header
  10:        0x102d39d1c - __mh_execute_header
  11:        0x102a93554 - __mh_execute_header
  12:        0x102a8d81c - __mh_execute_header
  13:        0x102ab96d0 - __mh_execute_header
  14:        0x102a8d490 - __mh_execute_header

@Urgau
Copy link
Member

Urgau commented Feb 27, 2023

Have you removed the --by-commit? if not try with removing it; if it doesn't work you may need to add an end, like --end=2023-02-26. If you still have the error/panic, could please also post the command line you used.

@NobodyXu

This comment was marked as outdated.

@NobodyXu

This comment was marked as outdated.

@NobodyXu

This comment was marked as outdated.

@NobodyXu
Copy link
Contributor Author

@Urgau Seems that 2023-02-15 contains the regression:

checking the start range to find a passing nightly
installing nightly-2023-02-15
rust-std-nightly-armv7-unknown-linux-gnueabihf: 27.50 MB / 27.50 MB [================] 100.00 % 4.32 MB/s 
testing...
RESULT: nightly-2023-02-15, ===> Yes
uninstalling nightly-2023-02-15

ERROR: the start of the range (nightly-2023-02-15) must not reproduce the regression

@NobodyXu
Copy link
Contributor Author

Command I ran:

#!/bin/sh

export RUSTFLAGS='-Z share-generics -C linker-plugin-lto  -C link-arg=-Wl,--icf=safe'

#--by-commit --start '7aa413d59'\

exec cargo bisect-rustc \
    --start=2023-02-15 \
    --target armv7-unknown-linux-gnueabihf --with-src --verbose -- \
    zigbuild --release --target armv7-unknown-linux-gnueabihf.2.17 \
    -Z build-std=std,panic_abort \
    -Z build-std-features=panic_immediate_abort \
    --config='profile.release.split-debuginfo="packed"' \
    --config=profile.release.debug=2 \
    --features static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto

@NobodyXu
Copy link
Contributor Author

NobodyXu commented Feb 27, 2023

I just upgrade to cargo-zigbuild 0.16.2 and there is a new error "modules of different target armv7 and armv6kz is linked together:

echo "env RUSTFLAGS=$RUSTFLAGS"
env RUSTFLAGS=-Z share-generics -C linker-plugin-lto  -C link-arg=-Wl,--icf=safe
cargo-zigbuild build  --release --target armv7-unknown-linux-gnueabihf.2.17 -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --config='profile.release.split-debuginfo="packed"' --config=profile.release.debug=2 --features static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto
   Compiling cargo-binstall v0.20.1 (/Users/nobodyxu/Dev/cargo-binstall/crates/bin)
error: linking with `/Users/nobodyxu/Library/Caches/cargo-zigbuild/0.16.2/zigcc-armv7-unknown-linux-gnueabihf.2.17.sh` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/nobodyxu/.wasmer/bin:/Users/nobodyxu/.wasmtime/bin:/Users/nobodyxu/.local/bin:/Users/nobodyxu/Library/Python/3.10/bin:/Users/nobodyxu/Library/Python/3.9/bin:/opt/homebrew/opt/llvm/bin:/Users/nobodyxu/Library/Python/3.8/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/nobodyxu/.cargo/bin:/Users/nobodyxu/.wasmer/globals/wapm_packages/.bin" VSLANG="1033" "/Users/nobodyxu/Library/Caches/cargo-zigbuild/0.16.2/zigcc-armv7-unknown-linux-gnueabihf.2.17.sh" "/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/symbols.o" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/deps/cargo_binstall-034005960a70ec2c.cargo_binstall.c1e0cf3f-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/deps" "-L" "/Users/nobodyxu/Dev/cargo-binstall/target/release/deps" "-L" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/build/bzip2-sys-e260e71e9683d6c2/out/lib" "-L" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/build/lzma-sys-7bf6d81e3ac313d8/out" "-L" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/build/zstd-sys-a94ed1b6652639e9/out" "-L" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/build/ring-4a2871aa10ce2276/out" "-L" "/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "-Wl,-Bstatic" "/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib" "/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/liblzma_sys-3f4791b9f78b1a3d.rlib" "/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libbzip2_sys-f100c6f9c714fbe5.rlib" "/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libring-92a2bff5da05ef49.rlib" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/deps/libcompiler_builtins-ea9bd470e6fc855d.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-Wl,-plugin-opt=O2,-plugin-opt=mcpu=generic" "-L" "/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "-o" "/Users/nobodyxu/Dev/cargo-binstall/target/armv7-unknown-linux-gnueabihf/release/deps/cargo_binstall-034005960a70ec2c" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs" "-Wl,--icf=safe"
  = note: warning: unsupported linker arg: -plugin-opt
          warning: unsupported linker arg: O2
          warning: unsupported linker arg: -plugin-opt
          warning: unsupported linker arg: mcpu=generic
          warning: unsupported linker arg: --icf
          warning: unsupported linker arg: safe
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(zstd_common.o at 119596)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(error_private.o at 47236)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(zstd_decompress.o at 2073264)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(zstd_ddict.o at 2035772)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(huf_decompress.o at 1966936)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(entropy_common.o at 12076)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(fse_decompress.o at 54884)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: warning: Linking two modules of different target triples: '/var/folders/4h/3pck4_r16tn6960znvv4w0nw0000gn/T/rustccZtFJh/libzstd_sys-64f575b0c38a9396.rlib(zstd_decompress_block.o at 2257684)' is 'armv6kz-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'
          
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h162454b1bee8ad3c
          >>> referenced by unix.rs:29 (/Users/nobodyxu/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/command-group-2.0.1/src/tokio/child/unix.rs:29)
          >>>               lto.tmp:(binstalk::ops::resolve::resolution::ResolutionSource::install::_$u7b$$u7b$closure$u7d$$u7d$::h0b4a5b4e0291ee15)
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::hccc33318f84d4a0f
          >>> referenced by value.rs:476 (/Users/nobodyxu/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/toml-0.7.2/src/value.rs:476)
          >>>               lto.tmp:(_$LT$serde..__private..de..content..ContentRefDeserializer$LT$E$GT$$u20$as$u20$serde..de..Deserializer$GT$::deserialize_any::h1383e06dbfc9c9e5)
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h89552025043e439b
          >>> referenced by uint_macros.rs:942 (/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:942)
          >>>               lto.tmp:(bytes::bytes_mut::BytesMut::reserve_inner::h02eb8cadf8c50b3e)
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h55dd6fa0ceaae35e
          >>> referenced by unix.rs:31 (/Users/nobodyxu/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/terminal_size-0.1.17/src/unix.rs:31)
          >>>               lto.tmp:(miette::eyreish::get_default_printer::h279f3e817bba8be1)
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h4eb04d05023f007e
          >>> referenced by pacing.rs:78 (/Users/nobodyxu/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/quinn-proto-0.8.4/src/connection/pacing.rs:78)
          >>>               lto.tmp:(_$LT$quinn..connection..ConnectionDriver$u20$as$u20$core..future..future..Future$GT$::poll::hcde9dd238955be6a)
          >>> referenced by varint.rs:95 (src/varint.rs:95)
          >>>               lto.tmp:(_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h47468ab1c2dfccac)
          >>> referenced by varint.rs:95 (src/varint.rs:95)
          >>>               lto.tmp:(_$LT$quinn_proto..config..TransportConfig$u20$as$u20$core..default..Default$GT$::default::h1dc2b3eaf7c62822)
          >>> referenced 8 more times
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h046479349e85827a
          >>> referenced by uint_macros.rs:942 (/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:942)
          >>>               lto.tmp:(quinn_proto::connection::Connection::handle_decode::hab52476dcdc20b11)
          >>> referenced by uint_macros.rs:942 (/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:942)
          >>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h48fbc6afd2817205)
          >>> referenced by uint_macros.rs:990 (/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:990)
          >>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h48fbc6afd2817205)
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h10407e5d2dbaeec1
          >>> referenced by uint_macros.rs:942 (/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:942)
          >>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h48fbc6afd2817205)
          >>> referenced by uint_macros.rs:990 (/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:990)
          >>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h48fbc6afd2817205)
          >>> referenced by parser.rs:25 (/Users/nobodyxu/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/net/parser.rs:25)
          >>>               lto.tmp:(trust_dns_proto::quic::quic_client_stream::QuicClientStreamBuilder::connect::_$u7b$$u7b$closure$u7d$$u7d$::hf734dfd91c9bf3ac)
          >>> referenced 1 more times
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h8018dd4223bc8a68
          >>> referenced by parser.rs:25 (src/net/parser.rs:25)
          >>>               lto.tmp:(std::net::parser::Parser::read_ipv4_addr::h602025f872c7eb38)
          >>> referenced by parser.rs:29 (src/net/parser.rs:29)
          >>>               lto.tmp:(std::net::parser::Parser::read_ipv4_addr::h602025f872c7eb38)
          
          ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::hf96b91c8ce55ce84
          >>> referenced by parser.rs:29 (src/net/parser.rs:29)
          >>>               lto.tmp:(std::net::parser::Parser::read_number::had37b5d438f58ade)
          >>> referenced by parser.rs:25 (src/net/parser.rs:25)
          >>>               lto.tmp:(std::net::parser::Parser::read_number::had37b5d438f58ade)
          

error: could not compile `cargo-binstall` due to previous error
error: Recipe `build` failed on line 158 with exit code 101

@Urgau
Copy link
Member

Urgau commented Feb 27, 2023

I setup-ed an archlinux container to try to bisect it myself and I was unable to find any working toolchain with your args (I search from 2023-02-10). This makes me wonder if it is a regression at all, maybe it just work by accident. Who knows.

Second I think you are missing build after zigbuild, you should use -vv to see the output of the intermediate builds. I had the same problem, and it made the build failed instantly.

Third I was able to build cargo-bininstall on the latest nightly with (and no RUSTFLAGS):

cargo-zigbuild build \
    --release --target armv7-unknown-linux-gnueabihf \
    --config='profile.release.split-debuginfo="packed"' \
    --config=profile.release.debug=2 \
    --features static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug

ie, without -Zbuild-std which makes me think that the issue this maybe related to it, especially considering that the linking errors are all coming from functions defined in core.

To be clear, the only thing that made a difference was removing the -Zbuild-std args.

Fourth, if this is indeed a regression it's not one from stable (since I'm able to build it from stable with cargo-zigbuild) and because of the use of unstable options. So adjusting the labels.

@rustbot label: +regression-from-nightly-to-nightly -regression-from-stable-to-nightly
The bot seems to be down, or at least don't want to respond to this query. :-|


Lastly, I've reached my (current) limits on my debugging abilities. Maybe if we had a regression I could have help more but without one I don't know what to do now. Sorry.

@NobodyXu
Copy link
Contributor Author

@Urgau Thank you, removing build-std indeed fixed the regression.

cargo-binstall will probably switch back to stable since relying on nightly is quite fragile and I hope that nightly features build-std, build-std-features, share-generics, gcc-ld=lld can be stablised so we can use them on stable.

@apiraino
Copy link
Contributor

apiraino commented Mar 1, 2023

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Mar 1, 2023
@apiraino apiraino removed the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Mar 1, 2023
@apiraino apiraino added the requires-nightly This issue requires a nightly compiler in some way. label Mar 1, 2023
@workingjubilee workingjubilee added the A-linkage Area: linking into static, shared libraries and binaries label Mar 5, 2023
@kleisauke
Copy link
Contributor

For reference, here are the salient parts of these logs (GitHub Actions keeps these for 90 days before they are automatically deleted):

release-builds / armv7-unknown-linux-musleabihf

Details
ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h2302cd0aa19169af
>>> referenced by unix.rs:29 (/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/command-group-2.0.1/src/tokio/child/unix.rs:29)
>>>               lto.tmp:(binstalk::ops::resolve::resolution::ResolutionSource::install::_$u7b$$u7b$closure$u7d$$u7d$::hd3abe8150b67ddfc)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::hcd19764587633cc5
>>> referenced by value.rs:476 (/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/toml-0.7.2/src/value.rs:476)
>>>               lto.tmp:(_$LT$serde..__private..de..content..ContentRefDeserializer$LT$E$GT$$u20$as$u20$serde..de..Deserializer$GT$::deserialize_any::had41023df13da389)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h788589be0451f4f8
>>> referenced by function.rs:250 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250)
>>>               lto.tmp:(binstalk_downloader::download::Download::and_extract::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h885e894613e6bcb4)
>>> referenced by pacing.rs:78 (/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/quinn-proto-0.8.4/src/connection/pacing.rs:78)
>>>               lto.tmp:(_$LT$quinn..connection..ConnectionDriver$u20$as$u20$core..future..future..Future$GT$::poll::h97a973e09a5ac617)
>>> referenced by varint.rs:95 (src/varint.rs:95)
>>>               lto.tmp:(_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h08b2eb84e2485aee)
>>> referenced 9 more times

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h7bb25eab4ae51928
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(bytes::bytes_mut::BytesMut::reserve_inner::h898abdfc47020faa)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h28d21b2a2cd4b287
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(quinn_proto::connection::Connection::handle_decode::he269f07f6892704e)
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h1ff3b36b788fe9dc)
>>> referenced by uint_macros.rs:972 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:972)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h1ff3b36b788fe9dc)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h0b5e19f1f414a624
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h1ff3b36b788fe9dc)
>>> referenced by uint_macros.rs:972 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:972)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h1ff3b36b788fe9dc)
>>> referenced by parser.rs:25 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/net/parser.rs:25)
>>>               lto.tmp:(trust_dns_proto::quic::quic_client_stream::QuicClientStreamBuilder::connect::_$u7b$$u7b$closure$u7d$$u7d$::hc5134720629b4c19)
>>> referenced 1 more times

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h3ad5fd32bc67a7a0
>>> referenced by parser.rs:25 (src/net/parser.rs:25)
>>>               lto.tmp:(std::net::parser::Parser::read_ipv4_addr::h437c3dea9a4c7949)
>>> referenced by parser.rs:29 (src/net/parser.rs:29)
>>>               lto.tmp:(std::net::parser::Parser::read_ipv4_addr::h437c3dea9a4c7949)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h88a59245c56a1cc1
>>> referenced by parser.rs:29 (src/net/parser.rs:29)
>>>               lto.tmp:(std::net::parser::Parser::read_number::h32d3af77ef448570)
>>> referenced by parser.rs:25 (src/net/parser.rs:25)
>>>               lto.tmp:(std::net::parser::Parser::read_number::h32d3af77ef448570)

release-builds / armv7-unknown-linux-gnueabihf

Details
ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h585cb2f6c97a5620
>>> referenced by unix.rs:29 (/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/command-group-2.0.1/src/tokio/child/unix.rs:29)
>>>               lto.tmp:(binstalk::ops::resolve::resolution::ResolutionSource::install::_$u7b$$u7b$closure$u7d$$u7d$::hde7913c78b76c629)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::hb63aaaa3987f28d3
>>> referenced by value.rs:476 (/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/toml-0.7.2/src/value.rs:476)
>>>               lto.tmp:(_$LT$serde..__private..de..content..ContentRefDeserializer$LT$E$GT$$u20$as$u20$serde..de..Deserializer$GT$::deserialize_any::haf92b445cd7a9ccc)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h19d0644e34ac2110
>>> referenced by function.rs:250 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250)
>>>               lto.tmp:(binstalk_downloader::download::Download::and_extract::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h5e1bd7c12bd7ce45)
>>> referenced by pacing.rs:78 (/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/quinn-proto-0.8.4/src/connection/pacing.rs:78)
>>>               lto.tmp:(_$LT$quinn..connection..ConnectionDriver$u20$as$u20$core..future..future..Future$GT$::poll::hd2f51d8b8689d4b3)
>>> referenced by varint.rs:95 (src/varint.rs:95)
>>>               lto.tmp:(_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::he2a62cd8086b8b6f)
>>> referenced 9 more times

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::hbeb38da9a5e1d98f
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(bytes::bytes_mut::BytesMut::reserve_inner::hfc095dc3131116b8)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$::into::h508a70ae588c6414
>>> referenced by unix.rs:31 (/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/terminal_size-0.1.17/src/unix.rs:31)
>>>               lto.tmp:(miette::eyreish::get_default_printer::h5cae39ea52af6318)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h2fae84facad90144
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(quinn_proto::connection::Connection::handle_decode::h0f1d941094d3525d)
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h9538f22fa632aa41)
>>> referenced by uint_macros.rs:972 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:972)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h9538f22fa632aa41)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h864aa1d5a15a27f2
>>> referenced by uint_macros.rs:924 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:924)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h9538f22fa632aa41)
>>> referenced by uint_macros.rs:972 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:972)
>>>               lto.tmp:(_$LT$futures_util..future..try_future..try_flatten..TryFlatten$LT$Fut$C$$LT$Fut$u20$as$u20$futures_core..future..TryFuture$GT$..Ok$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h9538f22fa632aa41)
>>> referenced by parser.rs:25 (/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/net/parser.rs:25)
>>>               lto.tmp:(trust_dns_proto::quic::quic_client_stream::QuicClientStreamBuilder::connect::_$u7b$$u7b$closure$u7d$$u7d$::hb0cf20d9b5d134f4)
>>> referenced 1 more times

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h300b9e324d3f533c
>>> referenced by parser.rs:25 (src/net/parser.rs:25)
>>>               lto.tmp:(std::net::parser::Parser::read_ipv4_addr::h26d2880a9c00b2a9)
>>> referenced by parser.rs:29 (src/net/parser.rs:29)
>>>               lto.tmp:(std::net::parser::Parser::read_ipv4_addr::h26d2880a9c00b2a9)

ld.lld: error: undefined symbol: _$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h851daca5434a2fc4
>>> referenced by parser.rs:29 (src/net/parser.rs:29)
>>>               lto.tmp:(std::net::parser::Parser::read_number::h3c4f9197e7f16e19)
>>> referenced by parser.rs:25 (src/net/parser.rs:25)
>>>               lto.tmp:(std::net::parser::Parser::read_number::h3c4f9197e7f16e19)

This looks similar to issue #108853.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. P-medium Medium priority requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants