Skip to content

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

Closed
@devurandom

Description

@devurandom
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

Activity

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on May 20, 2017
alexcrichton

alexcrichton commented on May 20, 2017

@alexcrichton
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

devurandom commented on May 20, 2017

@devurandom
ContributorAuthor

@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

alexcrichton commented on May 21, 2017

@alexcrichton
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

devurandom commented on May 21, 2017

@devurandom
ContributorAuthor

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

alexcrichton commented on May 22, 2017

@alexcrichton
Member

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

devurandom

devurandom commented on May 23, 2017

@devurandom
ContributorAuthor

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

alexcrichton commented on May 23, 2017

@alexcrichton
Member

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

devurandom

devurandom commented on May 24, 2017

@devurandom
ContributorAuthor

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).

added 5 commits that reference this issue on May 24, 2017

Rollup merge of rust-lang#42186 - devurandom:fix/bootstrap-verbose, r…

8c88656

Rollup merge of rust-lang#42186 - devurandom:fix/bootstrap-verbose, r…

4a3b3f3

Rollup merge of rust-lang#42186 - devurandom:fix/bootstrap-verbose, r…

f916be3

Rollup merge of rust-lang#42186 - devurandom:fix/bootstrap-verbose, r…

685edf6

Rollup merge of rust-lang#42186 - devurandom:fix/bootstrap-verbose, r…

96328fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @devurandom@alexcrichton@Mark-Simulacrum

        Issue actions

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