Comments (20)
The only thing that pops to mind is that I don't know how to use git bisect
to do what's mentioned there, but I am unsure of whether that's worth including. When I'll need that I'll just google for it :)
from rustc-dev-guide.
You forgot liballoc, but yeah, I think this book should have a section about it somewhere. I just landed here to report that https://rust-lang-nursery.github.io/rustc-guide/tests/running.html does not show how to run liballoc
tests
from rustc-dev-guide.
@kennytm @gnzlbg would rather if either of you be able to make a PR? It would be much appreciated!
EDIT: autocorrect stinks :(
from rustc-dev-guide.
I know nothing and must be doing everything wrong:
- it takes forever to build
liballoc
for me (~1 h) - it takes forever to
edit-compile-debug
liballoc
for me - running before/after benchmarks takes forever because I need to build it twice, and it takes 2x forever (~2 h)
- I can't have two rustc folders because each folder takes ~20-30 Gb of HDD space, etc
So I am more in the avoid touching any std
library component as much as possible camp, and also, in the camp of people that would benefit most from all this information.
from rustc-dev-guide.
For example, I just wanted to run the vec
benchmarks of the liballoc
crate, and ./x.py bench -h
doesn't return anything meaningful. So I don't even know how to run only the vec benchmarks there.
from rustc-dev-guide.
Hmm... that's interesting. I do a lot of no_std stuff, and I don't recall liballoc or libcore taking more than a couple of minutes to compile (i5-7500T, 8GB RAM, SSD drive). I'm totally guessing, but
- Are you using a network filesystem? That is really slow in my experience.
- What compiler debugging options turned on in your config toml? I've seen some of these blow up compile time. And if you are only working on libraries, maybe that's a waste.
from rustc-dev-guide.
Are you using a network filesystem? That is really slow in my experience
I have an SSD, I am running, for example, ./x.py bench src/liballoc
, and that compiles the whole rustc first in release mode (which duplicates my hdd space usage) and then runs all benchmarks, instead of only the ones I am interested about.
What compiler debugging options turned on in your config toml? I've seen some of these blow up compile time. And if you are only working on libraries, maybe that's a waste.
I work on both, but I am willing to have two different config.toml
files for when working only on the library. This is my config.toml: https://gist.github.com/gnzlbg/a3fe5be837986773b3b7204726eb83b3
from rustc-dev-guide.
./x.py bench src/liballoc, and that compiles the whole rustc first in release mode (which duplicates my hdd space usage) and then runs all benchmarks, instead of only the ones I am interested about.
I think this kind of makes sense. Since the compiler also uses these libraries, if you change one, you are changing a dependency of the compiler, which could in theory change the performance of the compiler or the code it produces.
Perhaps using --stage 1
might be good enough for quick prototyping? @kennytm Is that the purpose of the flags you mentioned in the OP?
This is my config.toml
IIRC, when I turned on rust.debug-assertions and llvm.assertions things got slow for me too (though, this was a while back...). Perhaps try turning them off?
from rustc-dev-guide.
Does this section cover any of the things you wanted: https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html#suggested-workflows-for-faster-builds-of-the-compiler
from rustc-dev-guide.
That does look really nice. Thanks!
from rustc-dev-guide.
Is there anything you think should be added to that section?
from rustc-dev-guide.
cc #78 "Bisecting against PRs"
from rustc-dev-guide.
I know nothing and must be doing everything wrong:
- it takes forever to build
liballoc
for me (~1 h)- it takes forever to
edit-compile-debug
liballoc
for me- running before/after benchmarks takes forever because I need to build it twice, and it takes 2x forever (~2 h)
- I can't have two rustc folders because each folder takes ~20-30 Gb of HDD space, etc
So I am more in the avoid touching any
std
library component as much as possible camp, and also, in the camp of people that would benefit most from all this information.
That's me, too. I recently learnt that part of the problem was a misunderstanding of the stages, so I was testing at stage 1 instead of stage 0: rust-lang/rust#57963
With regards to disk space, I wonder if it's possible reuse the LLVM part, for both disk usage and build time reasons: #276
from rustc-dev-guide.
That's me, too. I recently learnt that part of the problem was a misunderstanding of the stages, so I was testing at stage 1 instead of stage 0
As I mentioned on the other thread, a PR would be much appreciated.
cc the related #201
from rustc-dev-guide.
The #1
item is incredibly useful. It's a shame that it's buried in this issue and not up-to-date on:
https://rust-lang.github.io/rustc-guide/tests/running.html
@kennytm Do you have an example for #2
?
- developing from stage0: one could use
./x.py test --stage 0 --no-doc src/libstd
to quickly build and test the standard library, if features from a pre-built compiler is sufficient.- developing from stage1 (e.g. a new intrinsic is added): Suggest the proper
--keep-stage
syntax so the compiler will only be built once and then kept frozen?
from rustc-dev-guide.
Hi, is there any up-to-date info how to run quickly tests for stdlib or liballoc without bootstrapping the compiler? I'm not touching the compiler itself, I'd like just to have a quick sanity checks while developing stdlib APIs. I tried: ./x.py test --stage 0 --no-doc src/liballoc
, but it errors out with a huge number of `error[E0063]: missing field test_type in initializer of test::TestDesc errors. I'm using a recent nightly (2019-10-03).
from rustc-dev-guide.
@golddranks does this help? https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html#suggested-workflows-for-faster-builds-of-the-compiler
Otherwise, perhaps @Mark-Simulacrum has suggestions?
from rustc-dev-guide.
That's your best bet command these days, but as you've noted it doesn't quite work if the bootstrap compiler you're using (typically beta) has diverged its test executable sufficiently from what we're using in-tree. When you say "I'm using a recent nightly (2019-10-03)." I'm not sure what you mean, x.py typically doesn't look in your environment for a rustc at all.
You might be able to resolve this behavior by setting rustc
to something more recent (e.g., $HOME/.rustup/toolchains/nightly.*/bin/rustc
, though expanded), but it's basically not guaranteed to work out of the box.
from rustc-dev-guide.
Ah, sorry, I meant that my default compiler (via rustup
) is a recent nightly, but it seems that x.py manages it's own toolchain, so never mind. Thanks for the pointers, I'll try them out.
from rustc-dev-guide.
Triage: closing. Now that https://github.com/rust-lang/std-dev-guide exists, we will no longer have the need to document standard library development in this guide.
from rustc-dev-guide.
Related Issues (20)
- Date Reference Triage for 2023-12
- Example in "Getting diagnostic through `rustc_interface`" is outdated and meaningless
- Modifying AST
- Date Reference Triage for 2024-01
- Getting Started page "help-wanted-search" link goes to a 404 Github page HOT 2
- Broken link in Canonicalization chapter HOT 3
- In Compiler Architecture section, state explicitly you assume the compiler do not change between build
- Clarify what is a UI test HOT 4
- Clarify why Salsa is mentioned HOT 2
- Not clear sentence "Eager expansion generally performs a subset of the things that lazy (normal) expansion does."
- In macro expansion section, explains why import and collections must be redone
- Clarify "call site hierarchy" in macro
- Date Reference Triage for 2024-02 HOT 1
- Appendix D: Compiler Lecture Series: Update
- HIR documentation is outdated
- Diagnostic/subdiagnostic example struct /struct field fluent slugs outdated
- Date Reference Triage for 2024-03 HOT 1
- Date Reference Triage for 2024-04 HOT 1
- Automated Dead Link Detection HOT 1
- Guide answers "what" but not "why" and "how" for codegen tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rustc-dev-guide.