-
Couldn't load subscription status.
- Fork 83
document combination of flags #756
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
fcf5820
6d92a19
dd34120
d0adbbd
16f4d41
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 |
|---|---|---|
|
|
@@ -25,6 +25,43 @@ We encourage new contributors to join our communication channels and introduce t | |
|
|
||
| ## Understanding Core Concepts | ||
|
|
||
|
|
||
|
|
||
| ### Sysroot & compilation flags | ||
|
|
||
| #### What *is* the sysroot? | ||
| The **sysroot** is the directory that stores the compiled standard | ||
| library (`core`, `alloc`, `std`, `test`, …) and compiler built-ins. | ||
| Rustup ships these libraries **pre-compiled with LLVM**. | ||
|
|
||
| **rustc_codegen_gcc** replaces LLVM with the GCC backend. | ||
|
|
||
| The freshly compiled sysroot ends up in | ||
| `build/build_sysroot/...`. | ||
|
|
||
| A rebuild of sysroot is needed when | ||
|
|
||
| * the backend changes in a way that affects code generation, or | ||
| * the user switches toolchains / updates submodules. | ||
|
|
||
| Both backend and sysroot can be built using different [profiles](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles). | ||
| That is exactly what the `--sysroot`, `--release-sysroot` and `--release` flag supported by the build system script `y.sh` take care of. | ||
|
|
||
|
|
||
| #### Typical flag combinations | ||
|
|
||
| | Command | Backend Profile | Sysroot Profile | Usage Scenario | | ||
| |--------------------------------------------|-------------------------------|----------------------------------|------------------------------------------------------------| | ||
| | `./y.sh build` | dev (optimized + debuginfo) | X | Build backend in dev. mode with optimized dependencies without rebuilding sysroot | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you write "dev (optimized + debuginfo)" because this is what There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another idea could be to specify in a footnote that only the dependencies are compiled with optimizations. |
||
| | `./y.sh build --release` | release (optimized) | X | Build backend in release mode with optimized dependencies without rebuilding sysroot | | ||
| | `./y.sh build --release --sysroot` | release (optimized) | dev (unoptimized + debuginfo) | Build backend in release mode with optimized dependencies and sysroot in dev. mode (unoptimized) | | ||
| | `./y.sh build --sysroot` | dev (optimized + debuginfo) | dev (unoptimized + debuginfo) | Build backend in dev. mode with optimized dependencies and sysroot in dev. mode (unoptimized) | | ||
| | `./y.sh build --release-sysroot --sysroot`| dev (optimized + debuginfo) | release (optimized) | Build backend in dev. mode and sysroot in release mode, both with optimized dependencies | | ||
|
|
||
|
|
||
| Note: `--release-sysroot` should not be used without `--sysroot`. | ||
|
|
||
|
|
||
| ### Common Development Tasks | ||
|
|
||
| #### Running Specific Tests | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,8 +45,16 @@ impl BuildArg { | |
| println!( | ||
| r#" | ||
| `build` command help: | ||
|
|
||
| --sysroot : Build with sysroot"# | ||
| --release : Build backend in release mode with optimized dependencies without rebuilding sysroot | ||
FrancescoV1985 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --sysroot : When used on its own, build backend in dev. mode with optimized dependencies | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The flag |
||
| and sysroot in dev. mode (unoptimized) | ||
| When used together with --release, build backend in release mode with optimized dependencies | ||
| When used together with --release-sysroot, | ||
| build the sysroot in release mode with optimized dependencies instead of in dev. mode | ||
| --release-sysroot : When combined with --sysroot, additionally | ||
| build the sysroot in release mode with optimized dependencies. | ||
| When combined with --release, it has no effect. | ||
FrancescoV1985 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| It should not be used on its own."# | ||
| ); | ||
| ConfigInfo::show_usage(); | ||
| println!(" --help : Show this help"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.