Skip to content

rust 1.51 fails to build on X86_64 with llvm 10 #108422

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

Closed
jackssirs opened this issue Feb 24, 2023 · 14 comments
Closed

rust 1.51 fails to build on X86_64 with llvm 10 #108422

jackssirs opened this issue Feb 24, 2023 · 14 comments
Labels
C-bug Category: This is a bug.

Comments

@jackssirs
Copy link

jackssirs commented Feb 24, 2023

I'm build rust 1.51 in a mock
llvm version llvm x86_64 10.0.1-2
cargo x86_64 1.50.0-1 build 3.8 M

-epoch, ya...
    Building [====================>      ] 51/63: clap, crossbeam-epoch, ya...
    Building [=====================>     ] 52/63: clap, lzma-sys(build), ya...
    Building [=====================>     ] 52/63: clap, lzma-sys(build), ya...
   Compiling crossbeam-deque v0.7.3
    Building [=====================>     ] 53/63: clap, yaml-rust, tar, cro...
    Building [======================>    ] 54/63: clap, lzma-sys, yaml-rust...
    Building [======================>    ] 54/63: clap, lzma-sys, yaml-rust...
    Building [======================>    ] 55/63: clap, yaml-rust, tar, ray...
   Compiling xz2 v0.1.6
    Building [=======================>   ] 56/63: clap, xz2, tar, rayon-core  
    Building [=======================>   ] 57/63: clap, rayon, tar, rayon-core
    Building [=======================>   ] 57/63: clap, rayon, tar, rayon-core
    Building [=======================>   ] 58/63: clap, rayon, tar            
   Compiling installer v0.0.0 (/builddir/build/BUILD/rustc-1.51.0-src/src/tools/rust-installer)
    Building [========================>  ] 59/63: clap, installer, rayon      
    Building [========================>  ] 59/63: clap, installer, rayon      
    Building [========================>  ] 60/63: clap, installer             
    Building [=========================> ] 61/63: clap                        
    Building [=========================> ] 62/63: fabricate(bin)              
    Building [=========================> ] 62/63: fabricate(bin)              
    Finished release [optimized + debuginfo] target(s) in 36.95s
Dist rust-docs-1.51.0-x86_64-unknown-linux-gnu
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `9223372035781033984`,
 right: `0`', library/std/src/sys/unix/kernel_copy.rs:589:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

command did not execute successfully: "/builddir/build/BUILD/rustc-1.51.0-src/build/x86_64-unknown-linux-gnu/stage0-tools-bin/fabricate" "generate" "--image-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/image" "--component-name=rust-docs" "--bulk-dirs" "share/doc/rust/html" "--rel-manifest-dir=rustlib" "--legacy-manifest-dirs=rustlib,cargo" "--product-name=Rust Documentation" "--success-message=rust-docs installed." "--package-name=rust-docs-1.51.0-x86_64-unknown-linux-gnu" "--non-installed-overlay" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/overlay" "--output-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/dist" "--work-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu"

expected success, got: exit code: 101


failed to run: /builddir/build/BUILD/rustc-1.51.0-src/build/bootstrap/debug/bootstrap install
Build completed unsuccessfully in 2:10:46
错误:/var/tmp/rpm-tmp.up5lQf (%install) 退出状态不好


RPM 构建错误:
    /var/tmp/rpm-tmp.up5lQf (%install) 退出状态不好
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/mockbuild/trace_decorator.py", line 95, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.7/site-packages/mockbuild/util.py", line 746, in do_with_status
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed:

# /usr/bin/systemd-nspawn -q -M 1718b39599a94a949b230129aca8a045 -D /var/lib/mock/v10-sp3-appstore-epel-devtoolset10-build-134105-70701/root -a --capability=cap_ipc_lock --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=zh_CN.UTF-8 -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/rust.spec
@jackssirs jackssirs added the C-bug Category: This is a bug. label Feb 24, 2023
@workingjubilee
Copy link
Member

workingjubilee commented Feb 24, 2023

I could be wrong, but I believe we actually were building with at least LLVM 11 at that time. We only fully support using our patched LLVM to build (but you are probably able to build that using your LLVM 10). But this shouldn't matter, this was in the rust doc building...

@workingjubilee
Copy link
Member

Also I strongly recommend disabling incremental, if your build hasn't already, if you're doing a clean bootstrap from around that time.

@workingjubilee
Copy link
Member

That said, feel free to ignore everything I just said. This was a problem for a much more mundane reason. You ran afoul of

Which was not fixed until several versions later: b490ccc

There likely isn't much to do except to retry until the kernel doesn't give anything that matches this arm, which may be a while if you are using a mildly interesting filesystem mounting:

                    Some(ENOSYS | EXDEV | EINVAL | EPERM | EOPNOTSUPP | EBADF) => {

@Noratrieb
Copy link
Member

Alternatively, you should be able to apply the diff in your tree and depending on where exactly it panicked for you, I should get picked up

@jackssirs
Copy link
Author

b490ccc The patch has been applied in rust1.51 the bug error is
command did not execute successfully: "/builddir/build/BUILD/rustc-1.51.0-src/build/x86_64-unknown-linux-gnu/stage0-tools-bin/fabricate" "generate" "--image-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/image" "--component-name=rust-docs" "--bulk-dirs" "share/doc/rust/html" "--rel-manifest-dir=rustlib" "--legacy-manifest-dirs=rustlib,cargo" "--product-name=Rust Documentation" "--success-message=rust-docs installed." "--package-name=rust-docs-1.51.0-x86_64-unknown-linux-gnu" "--non-installed-overlay" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/overlay" "--output-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/dist" "--work-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu"

@workingjubilee
Copy link
Member

If you still need help, I suggest ./x.py clean (assuming this build environment persists... it might not?) and then RUST_BACKTRACE=1 ./x.py build.

@jackssirs
Copy link
Author

ok,in spec file i add next and try
%build
export %{rust_env} RUST_BACKTRACE=1
%global common_libdir %{_prefix}/lib
%global rustlibdir %{common_libdir}/rustlib
%ifarch %{arm} %{ix86} s390x
%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
%else
%define enable_debuginfo --debuginfo-level=2
%endif
%ifnarch %{power64}
%define codegen_units_std --set rust.codegen-units-std=1
%endif
ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN)
max_cpus=$(( ($(free -g | awk '/^Mem:/{print $2}') + 1) / 2 ))
if [ "$max_cpus" -ge 1 -a "$max_cpus" -lt "$ncpus" ]; then
ncpus="$max_cpus"
fi
%configure --disable-option-checking
--libdir=%{common_libdir}
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple}
--python=%{python}
--local-rust-root=%{local_rust_root}
%{!?with_bundled_llvm: --llvm-root=%{llvm_root}
%{!?llvm_has_filecheck: --disable-codegen-tests}
%{!?with_llvm_static: --enable-llvm-link-shared } } \
--disable-rpath
%{enable_debuginfo}
--enable-extended
--tools=analysis,cargo,clippy,rls,rustfmt,src
--enable-vendor
--enable-verbose-tests
%{?codegen_units_std}
--release-channel=%{channel}
%{python} ./x.py clean
%{python} ./x.py build -j "$ncpus" --stage 2

%{python} ./x.py doc clean
%{python} ./x.py doc --stage 2

%install
export %{rust_env} RUST_BACKTRACE=1

DESTDIR=%{buildroot} %{python} ./x.py clean
DESTDIR=%{buildroot} %{python} ./x.py instal

@jackssirs
Copy link
Author

Dist rust-docs-1.51.0-x86_64-unknown-linux-gnu
thread 'main' panicked at 'assertion failed: (left == right)
left: 9223372035781033984,
right: 0', library/std/src/sys/unix/kernel_copy.rs:589:25
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: std::sys::unix::kernel_copy::copy_regular_files
3: std::sys::unix::fs::copy
4: std::fs::copy
at /builddir/build/BUILD/rustc-1.50.0-src/library/std/src/fs.rs:1696:5
5: installer::util::copy
at ./src/tools/rust-installer/src/util.rs:29:19
6: installer::util::copy_with_callback
at ./src/tools/rust-installer/src/util.rs:118:13
7: installer::generator::copy_and_manifest
at ./src/tools/rust-installer/src/generator.rs:119:5
8: installer::generator::Generator::run
at ./src/tools/rust-installer/src/generator.rs:63:9
9: fabricate::generate
at ./src/tools/rust-installer/src/main.rs:67:5
10: fabricate::main
at ./src/tools/rust-installer/src/main.rs:11:40
11: core::ops::function::FnOnce::call_once
at /builddir/build/BUILD/rustc-1.50.0-src/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

command did not execute successfully: "/builddir/build/BUILD/rustc-1.51.0-src/build/x86_64-unknown-linux-gnu/stage0-tools-bin/fabricate" "generate" "--image-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/image" "--component-name=rust-docs" "--bulk-dirs" "share/doc/rust/html" "--rel-manifest-dir=rustlib" "--legacy-manifest-dirs=rustlib,cargo" "--product-name=Rust Documentation" "--success-message=rust-docs installed." "--package-name=rust-docs-1.51.0-x86_64-unknown-linux-gnu" "--non-installed-overlay" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/overlay" "--output-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/dist" "--work-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu"
expected success, got: exit code: 101

failed to run: /builddir/build/BUILD/rustc-1.51.0-src/build/bootstrap/debug/bootstrap install
Build completed unsuccessfully in 1:07:09
error: Bad exit status from /var/tmp/rpm-tmp.0wlsA4 (%install)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.0wlsA4 (%install)
Finish: rpmbuild rust-1.51.0-7.ky10.src.rpm
Finish: build phase for rust-1.51.0-7.ky10.src.rpm
ERROR: Exception(/home/lvf/rpmbuild/SRPMS/rust-1.51.0-7.ky10.src.rpm) Config(test) 94 minutes 3 seconds
INFO: Results and/or logs in: /var/lib/mock/test/result
ERROR: Command failed:

/usr/bin/systemd-nspawn -q -M 63b78429de8441738cb9d70c5116a570 -D /var/lib/mock/test/root -a --capability=cap_ipc_lock --bind=/tmp/mock-resolv.8jmaavq8:/etc/resolv.conf --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;\007" --setenv=PS1= \s-\v$ --setenv=LANG=en_US.UTF-8 -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/rust.spec

@workingjubilee
Copy link
Member

at /builddir/build/BUILD/rustc-1.50.0-src/library/std/src/fs.rs:1696:5

Ah, to prevent this from happening, you would need to apply the diff to the version you are using to build, as the issue is recursive... but really, you should just build it on a different file system, and if you don't want to do that, then it's trying over and over until this build works (with the fix included). Sorry. :/

@jackssirs
Copy link
Author

i'm build in a mock environment ,Simultaneous compilation aarch64 and x86_64 ,The aarch64 no program,just x86_64 this problem occurs。i chroot in mock environment and execute: /builddir/build/BUILD/rustc-1.51.0-src/build/x86_64-unknown-linux-gnu/stage0-tools-bin/fabricate" "generate" "--image-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/image" "--component-name=rust-docs" "--bulk-dirs" "share/doc/rust/html" "--rel-manifest-dir=rustlib" "--legacy-manifest-dirs=rustlib,cargo" "--product-name=Rust Documentation" "--success-message=rust-docs installed." "--package-name=rust-docs-1.51.0-x86_64-unknown-linux-gnu" "--non-installed-overlay" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/overlay" "--output-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/dist" "--work-dir" "/builddir/build/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu" is not success

@workingjubilee
Copy link
Member

Maybe with a more recent kernel?

@jackssirs
Copy link
Author

jackssirs commented Mar 7, 2023

I replaced the underlying operating system centos8.2
Linux localhost.localdomain 4.18.0-193.el8.x86_64 #1 SMP Fri May 8 10:59:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
and compile with
mock -r mango-epkl --rebuild /home/lvf/rust-1.51.0-7.el8.src.rpm

Finish: rpmbuild rust-1.51.0-7.el8.src.rpm
Finish: build phase for rust-1.51.0-7.el8.src.rpm
INFO: Done(/home/lvf/rust-1.51.0-7.el8.src.rpm) Config(mango-epkl) 87 minutes 58 seconds
INFO: Results and/or logs in: /var/lib/mock/test/result
Finish: run

is susccess and don't know why

@jackssirs
Copy link
Author

Caused by:
0: failed to copy '/root/rpmbuild/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/image/share/doc/rust/html/.stamp' to '/root/rpmbuild/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/rust-docs-1.51.0-x86_64-unknown-linux-gnu/rust-docs/share/doc/rust/html/.stamp'
1: Invalid argument (os error 22)

command did not execute successfully: "/root/rpmbuild/BUILD/rustc-1.51.0-src/build/x86_64-unknown-linux-gnu/stage0-tools-bin/fabricate" "generate" "--image-dir" "/root/rpmbuild/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/image" "--component-name=rust-docs" "--bulk-dirs" "share/doc/rust/html" "--rel-manifest-dir=rustlib" "--legacy-manifest-dirs=rustlib,cargo" "--product-name=Rust Documentation" "--success-message=rust-docs installed." "--package-name=rust-docs-1.51.0-x86_64-unknown-linux-gnu" "--non-installed-overlay" "/root/rpmbuild/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu/overlay" "--output-dir" "/root/rpmbuild/BUILD/rustc-1.51.0-src/build/dist" "--work-dir" "/root/rpmbuild/BUILD/rustc-1.51.0-src/build/tmp/tarball/rust-docs/x86_64-unknown-linux-gnu"
expected success, got: exit code: 1

failed to run: /root/rpmbuild/BUILD/rustc-1.51.0-src/build/bootstrap/debug/bootstrap install
Build completed unsuccessfully in 0:49:59
错误:/var/tmp/rpm-tmp.slRWnL (%install) 退出状态不好

RPM 构建错误:
/var/tmp/rpm-tmp.slRWnL (%install) 退出状态不好

@workingjubilee
Copy link
Member

is susccess and don't know why

I'm going to go with "the kernel didn't give a buggy response this time". Where "buggy" is relative. But I am glad to hear this succeeded, and I strongly suggest using that success to move on past Rust 1.51. I don't think we can help further here. My apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants