Closed
Description
Cargo's new experimental -Ztimings
flag is really cool. See here for sample output. It would be great to add support for this to x.py
. It would help a lot with #65031.
I tried and failed to get -Ztimings
working with rustc, according to some instructions here. One complication is that rustc normally builds with a beta version of Cargo, but -Ztimings
is nightly only.
@ehuss : what steps did you take to get the rustc measurements? Thanks!
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
ehuss commentedon Oct 7, 2019
I didn't run it against rustc, that was Alex. You have to edit
config.toml
and setbuild.cargo
to a nightly version of cargo (like from the.rustup
directory, or build it yourself). Then edit thecargo
function to add-Ztimings
. It looks like someone has made a PR to make that read from an env.nnethercote commentedon Oct 7, 2019
@alexcrichton: can you give the exact steps here? I tried to do this but failed. Thanks!
ehuss commentedon Oct 7, 2019
What kind of error did you run into? Here's what my rust
config.toml
looks like (adjust for your setup):And here's what the diff might look like:
I have nightly 2019-10-02, which seems to work. Sometimes bootstrapping won't work on the latest cargo because the bootstrap code needs updating, but it seems to be working at this point in time.
alexcrichton commentedon Oct 7, 2019
@nnethercote oh I didn't actually add support to
./x.py
when I generated my graphs, I literally just did:and then fixed any missing env vars that the crates reported. I would expect that @ehuss's patch would work as expected, although it may also require a temporary check for
if stage != 0
somewhereRollup merge of rust-lang#65129 - andjo403:cargo_args, r=alexcrichton
Auto merge of #65129 - andjo403:cargo_args, r=alexcrichton
Zoxc commentedon Dec 25, 2019
You can now do this with
CARGOFLAGS=-Ztimings
.andjo403 commentedon Mar 7, 2020
@nnethercote do you want more support then
CARGOFLAGS_BOOTSTRAP=-Ztimings ./x.py build --stage 1
or can this be closed now?nnethercote commentedon Mar 7, 2020
I used
CARGOFLAGS=-Ztimings ./x.py build
for the first time yesterday and it worked great!