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

./x.py build --verbose and config.toml build.verbose=2 don't trigger cargo --verbose #42099

Closed
devurandom opened this issue May 19, 2017 · 8 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@devurandom
Copy link
Contributor

Passing --verbose to ./x.py build and setting build.verbose in config.toml does not cause --verbose to be passed to cargo, which results in a non-verbose build.

I am trying to build rust-1.17.0 as follows:

   cat <<- EOF > "${S}"/config.toml
        [llvm]
        optimize = $(toml_usex !debug)
        release-debuginfo = $(toml_usex debug)
        assertions = $(toml_usex debug)
        [build]
        build = "${CTARGET}"
        host = "${CTARGET}"
        target = "${CTARGET}"
        cargo = "${WORKDIR}/${cargo_stage0}/cargo/bin/cargo"
        rustc = "${WORKDIR}/${rustc_stage0}/rustc/bin/rustc"
        docs = $(toml_usex doc)
        submodules = false
        python = "${EPYTHON}"
        locked-deps = true
        vendor = true
        verbose = 2
        [install]
        prefix = "${EPREFIX}/usr"
        libdir = "$(get_libdir)/${P}"
        docdir = "share/doc/${P}"
        mandir = "share/${P}/man"
        [rust]
        optimize = $(toml_usex !debug)
        debuginfo = $(toml_usex debug)
        debug-assertions = $(toml_usex debug)
        use-jemalloc = $(toml_usex jemalloc)
        default-linker = "${linker}"
        default-ar = "${archiver}"
        rpath = false
        [target.x86_64-unknown-linux-gnu]
        cc = "${c_compiler}"
        cxx = "${cxx_compiler}"
        llvm-config = "${llvm_config}"
    EOF

   ./x.py build --verbose --config="${S}"/config.toml
@Mark-Simulacrum Mark-Simulacrum added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label May 20, 2017
@alexcrichton
Copy link
Member

@devurandom just to confirm, this is the build for rustbuild itself? I know that location doesn't handle --verbose for Cargo, but all others should.

@devurandom
Copy link
Contributor Author

@alexcrichton I was trying to build rustc.

You can find the complete, but WIP ebuild in my Gentoo overlay. It is based on the Gentoo ebuild for 1.16.0, but tries to adapt to the changes in the build-system from 1.16 to 1.17 and switch from Makefiles to x.py.

@alexcrichton
Copy link
Member

@devurandom do you have logs or a gist of the wrong behavior, maybe with comments as to what the expected correct behavior is?

@devurandom
Copy link
Contributor Author

E.g. when I run cargo build --verbose, I see the rustc commandline for every package being build. I would like to see the same when building Rust using ./x.py, but I can't convince the build-system to show it to me (s.a.).

This makes it very hard for me to debug another issue, where the bootstrapping rustc complains that it can't find crate for std (error[E0463]). I was hoping that seeing the actual invocation of rustc would give me a fresh idea what's going on there.

@alexcrichton
Copy link
Member

Do you have logs of what's going on? The logs in the linked thread there look like --verbose is working?

@devurandom
Copy link
Contributor Author

Build log when using the current ebuild: https://gist.github.com/devurandom/1223ee18f46c6ed866b386ec7009dbbb

You are right that, after bootstrapping, the build was verbose in the logs linked from the forums post. But even there you will notice that the bootstrap process is not verbose (see lines 108 to 118 of the Gist). It just so happens that at the time I posted that Gist I tricked the bootstrap process into succeeding, which is why most of what you see is output of later stages of the build.

The major difference between the ebuild posted in the Gist and the current version of the ebuild is that the former uses the system Rust compiler to bootstrap (which is why it works during bootstrapping, but fails later), while the latter uses the Rust compiler it downloads from https://static.rust-lang.org/dist/rustc-1.16.0-x86_64-unknown-linux-gnu.tar.gz (which shows the libstd issue already during bootstrapping).

@alexcrichton
Copy link
Member

Ok thanks for the clarification! In that case I believe the fix would just go somewhere around here

@devurandom
Copy link
Contributor Author

Thanks for the hint. I came across that part about a hundred times, but failed to make the connection. Please find the fix in #42186.

On the other topic: Is it possible to make Cargo / rustc output a list of directories where it searched for a "crate"? I tried setting LD_LIBRARY_PATH and RUSTC_SYSROOT, but I cannot make rustc pickup the libstd-13f36e2630c2d79b.so in rustc-1.16.0-x86_64-unknown-linux-gnu/rustc/lib, so I would like to know what exactly (i.e. actual library name) it is searching where (which sysroot and library path does it see).

devurandom added a commit to devurandom/rust that referenced this issue May 24, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 24, 2017
…=alexcrichton

bootstrap: Make bootstrap verbose if requested

Fixes: rust-lang#42099
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 24, 2017
…=alexcrichton

bootstrap: Make bootstrap verbose if requested

Fixes: rust-lang#42099
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 24, 2017
…=alexcrichton

bootstrap: Make bootstrap verbose if requested

Fixes: rust-lang#42099
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 25, 2017
…=alexcrichton

bootstrap: Make bootstrap verbose if requested

Fixes: rust-lang#42099
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 25, 2017
…=alexcrichton

bootstrap: Make bootstrap verbose if requested

Fixes: rust-lang#42099
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