-
Notifications
You must be signed in to change notification settings - Fork 558
Add missing documentation for running tests with GCC backend #2587
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
# GCC codegen backend tests | ||
|
||
TODO: please add some more information to this page. | ||
To test the GCC codegen backend, you need to add `"gcc"` into the `rust.codegen-backends` | ||
setting in `bootstrap.toml`: | ||
|
||
```toml | ||
rust.codegen-backends = ["llvm", "gcc"] | ||
``` | ||
|
||
If you don't want to change your `bootstrap.toml` file, you can alternatively run your `x.py` | ||
commands with `--set rust.codegen-backends=["llvm", "gcc"]'`. For example: | ||
|
||
```bash | ||
x.py test --set 'rust.codegen-backends=["llvm", "gcc"]' | ||
``` | ||
|
||
If you don't want to build `gcc` yourself, you also need to set: | ||
|
||
```toml | ||
gcc.download-ci-gcc = true | ||
|
||
``` | ||
|
||
Then when running tests, add the `--test-codegen-backend gcc` option. For example: | ||
|
||
```bash | ||
./x.py test tests/ui --test-codegen-backend gcc | ||
|
||
``` | ||
|
||
If you want to build the sysroot using the GCC backend, you need to set it first | ||
in `rust.codegen-backends`: | ||
|
||
```toml | ||
rust.codegen-backends = ["llvm", "gcc"] | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this can hit any contributor in any PR, I think it should be possible to run these tests in a one-shot way without permanently altering one's configuration.
I don't know what exactly altering the config in this way does, but if it means during my next PR it will build this backend, then that's not great -- it's unlikely to be relevant again then.
Please put yourself into the shoes of a rustc contributor that has nothing to do with the GCC backend, and is unlikely to encounter it for most of their PRs -- and tell that contributor what they should do to fix the PR where this weird failure they didn't expect shows up. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done with
./x test ... --test-codegen-backend gcc --set 'rust.codegen-backends=["llvm", "gcc"]'
. A bit of a mouthful, but it will likely be copy-pasted from the docs anyway, or stored in some local helper file.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere on this page, in a super obvious place that the reader will find immediately when going here the first time (i.e., probably at the top), should be a command to copy-paste to run the tests. That's still not the case, isn't it? I have to copy multiple things together to get the actual command I need to use.
I don't know how much more clear I can be about optimizing this for an inexperienced contributor who doesn't want to do much work on the GCC backend, they just want to fix their PR. Or even an experienced contributor who doesn't normally touch GCC but has their tests fail in GCC every 4 months (i.e., too rarely to remember the command). Please, when writing this, put yourself in the shoes of such a contributor, not in the shoes of someone who's been working on rustc and its GCC backend for years.
I think that command is
but I am not actually sure.