Skip to content

Rustbuild fails with ./x.py test src/libtest --stage 1 #37745

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
Mark-Simulacrum opened this issue Nov 13, 2016 · 9 comments
Closed

Rustbuild fails with ./x.py test src/libtest --stage 1 #37745

Mark-Simulacrum opened this issue Nov 13, 2016 · 9 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Mark-Simulacrum
Copy link
Member

I suspect that the dependencies for libtest need to be updated, but I'm not sure; it's also possible this isn't intended to work, but a more user-friendly error would be nice.

Full output:

    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Synchronizing submodule url for 'src/compiler-rt'
Synchronizing submodule url for 'src/jemalloc'
Synchronizing submodule url for 'src/liblibc'
Synchronizing submodule url for 'src/llvm'
Synchronizing submodule url for 'src/rt/hoedown'
Synchronizing submodule url for 'src/rust-installer'
HEAD is now at 3bc0272 Merge pull request #26 from TimNN/arm-cc
HEAD is now at e058ca6 Change how the default zone is found
HEAD is now at 7d9b71f Merge pull request #435 from raphlinus/aarch64
HEAD is now at c1d9622 Backport r285278 [ARM] Predicate UMAAL selection on hasDSP.
HEAD is now at a3736a0 Merge pull request #6 from intelfx/patch-1
HEAD is now at 4f99485 Merge pull request #54 from brson/docdir
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage1 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Testing libtest stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling test v0.0.0 (file:///home/mark/Edit/rust/src/libtest)
error[E0463]: can't find crate for `getopts`
  --> src/libtest/lib.rs:44:1
   |
44 | extern crate getopts;
   | ^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

error: Could not compile `test`.

To learn more, run the command again with --verbose.


command did not execute successfully: "/home/mark/Edit/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "-j" "8" "--target" "x86_64-unknown-linux-gnu" "--release" "--manifest-path" "/home/mark/Edit/rust/src/rustc/test_shim/Cargo.toml" "--features" "" "-p" "test"
expected success, got: exit code: 101
@Mark-Simulacrum
Copy link
Member Author

Mark-Simulacrum commented Nov 13, 2016

In fact, this sort of error seems to happen all the time:

$ ./x.py test src/test/compile-fail src/test/run-pass
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Synchronizing submodule url for 'src/compiler-rt'
Synchronizing submodule url for 'src/jemalloc'
Synchronizing submodule url for 'src/liblibc'
Synchronizing submodule url for 'src/llvm'
Synchronizing submodule url for 'src/rt/hoedown'
Synchronizing submodule url for 'src/rust-installer'
HEAD is now at 3bc0272 Merge pull request #26 from TimNN/arm-cc
HEAD is now at e058ca6 Change how the default zone is found
HEAD is now at 7d9b71f Merge pull request #435 from raphlinus/aarch64
HEAD is now at c1d9622 Backport r285278 [ARM] Predicate UMAAL selection on hasDSP.
HEAD is now at a3736a0 Merge pull request #6 from intelfx/patch-1
HEAD is now at 4f99485 Merge pull request #54 from brson/docdir
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage1 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling rustc_platform_intrinsics v0.0.0 (file:///home/mark/Edit/rust/src/librustc_platform_intrinsics)
   Compiling serialize v0.0.0 (file:///home/mark/Edit/rust/src/libserialize)
   Compiling rustc_llvm v0.0.0 (file:///home/mark/Edit/rust/src/librustc_llvm)
   Compiling syntax_pos v0.0.0 (file:///home/mark/Edit/rust/src/libsyntax_pos)
   Compiling rustc_data_structures v0.0.0 (file:///home/mark/Edit/rust/src/librustc_data_structures)
   Compiling rustc_errors v0.0.0 (file:///home/mark/Edit/rust/src/librustc_errors)
error[E0463]: can't find crate for `term`
  --> src/librustc_errors/lib.rs:30:1
   |
30 | extern crate term;
   | ^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

Build failed, waiting for other jobs to finish...
error: Could not compile `rustc_errors`.

To learn more, run the command again with --verbose.


command did not execute successfully: "/home/mark/Edit/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-j" "8" "--target" "x86_64-unknown-linux-gnu" "--release" "--features" " jemalloc" "--manifest-path" "/home/mark/Edit/rust/src/rustc/Cargo.toml"
expected success, got: exit code: 101

@Mark-Simulacrum
Copy link
Member Author

Hmm, seems spurious. This went away after rm -rf build tmp. Closing.

@sanxiyn
Copy link
Member

sanxiyn commented Dec 4, 2016

I get the same error:

   Compiling rustc_errors v0.0.0 (file:///home/sanxiyn/rust/src/librustc_errors)
error[E0463]: can't find crate for `term`

@sanxiyn sanxiyn added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Dec 4, 2016
@sanxiyn
Copy link
Member

sanxiyn commented Dec 4, 2016

Steps to reproduce:

$ mkdir rustbuild
$ cd rustbuild
$ ../x.py build ../src/libtest
$ ../x.py test ../src/test/compile-fail

Doing ../x.py test ../src/test/compile-fail directly does not reproduce.

@Mark-Simulacrum
Copy link
Member Author

I've found a painful, but simple, way to fix this sort of error: ./x.py build src/libtest if it's complaining about libtest not existing. Unfortunately, this does require rebuilding everything past that.

@alexcrichton
Copy link
Member

I'm unfortunately having trouble finding time to generate all the logs necessary to debug this, but a gist of a run like this would be quite helpful:

export RUST_LOG=cargo::ops::cargo_rustc::fingerprint
./x.py build src/libtest -v
./x.py test src/test/compile-fail -v

@Mark-Simulacrum or @sanxiyn would one of you be willing to generate those logs?

@Mark-Simulacrum
Copy link
Member Author

@alexcrichton In a fresh clone? Or when we see this bug?

@sanxiyn
Copy link
Member

sanxiyn commented Dec 12, 2016

Here is a lightly edited (I deleted LLVM build log, specifically from "Building LLVM" to "finished") log of the requested run: https://gist.github.com/sanxiyn/c30498b8d139301c375cd18f29f4d17b

alexcrichton added a commit to alexcrichton/rust that referenced this issue Dec 16, 2016
This erroneously truncated files when the destination already existed and was an
existing hard link to the source. This in turn caused weird bugs!

Closes rust-lang#37745
@alexcrichton
Copy link
Member

Thanks @sanxiyn! I believe I've tracked this down and fixed it in #38405.

bors added a commit that referenced this issue Dec 19, 2016
rustbuild: Fix `copy` helper with existing files

This erroneously truncated files when the destination already existed and was an
existing hard link to the source. This in turn caused weird bugs!

Closes #37745
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants