Skip to content

unstable-book: Add stubs for environment variables; document some of the important ones #141624

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

Merged
merged 2 commits into from
Aug 10, 2025

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented May 27, 2025

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc @madsmtm @flba-eb - do the docs for SDKROOT and QNX_TARGET look right?):

  • COLORTERM
  • QNX_TARGET
  • SDKROOT
  • TERM

and generates stubs for the following env vars:

  • RUST_BACKTRACE
  • RUSTC_BLESS
  • RUSTC_BREAK_ON_ICE
  • RUSTC_CTFE_BACKTRACE
  • RUSTC_FORCE_RUSTC_VERSION
  • RUSTC_GRAPHVIZ_FONT
  • RUSTC_ICE
  • RUSTC_LOG
  • RUSTC_RETRY_LINKER_ON_SEGFAULT
  • RUSTC_TRANSLATION_NO_DEBUG_ASSERT
  • RUST_DEP_GRAPH_FILTER
  • RUST_DEP_GRAPH
  • RUST_FORBID_DEP_GRAPH_EDGE
  • RUST_MIN_STACK
  • RUST_TARGET_PATH
  • UNSTABLE_RUSTDOC_TEST_LINE
  • UNSTABLE_RUSTDOC_TEST_PATH

rendered: screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar

@rustbot
Copy link
Collaborator

rustbot commented May 27, 2025

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 27, 2025
This uses a very hacky regex that will probably miss some variables. But
having some docs seems better than none at all.

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this generates stubs for the following env vars:

- COLORTERM
- QNX_TARGET
- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BOOTSTRAP
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_OVERRIDE_VERSION_STRING
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- SDKROOT
- TERM
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

[rendered](![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd))
Copy link
Member

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u said you'd get someone else to review the hand written documentation

@BoxyUwU BoxyUwU added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 8, 2025
Copy link
Contributor

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDKROOT docs look good with nits applied (sorry, forgot about the PR until the ping)

Co-authored-by: Florian Bartels <[email protected]>
Co-authored-by: Mads Marquart <[email protected]>
@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2025

⚠️ Warning ⚠️

@BoxyUwU
Copy link
Member

BoxyUwU commented Aug 9, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 9, 2025

📌 Commit f4d3dd0 has been approved by BoxyUwU

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 9, 2025
@jyn514
Copy link
Member Author

jyn514 commented Aug 9, 2025

🔥

Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 10, 2025
unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc `@madsmtm` `@flba-eb` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 10, 2025
unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc ``@madsmtm`` ``@flba-eb`` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 10, 2025
unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc ```@madsmtm``` ```@flba-eb``` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 10, 2025
unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc ````@madsmtm```` ````@flba-eb```` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
bors added a commit that referenced this pull request Aug 10, 2025
Rollup of 19 pull requests

Successful merges:

 - #141624 (unstable-book: Add stubs for environment variables; document some of the important ones)
 - #143093 (Simplify polonius location-sensitive analysis)
 - #144402 (Stabilize loongarch32 inline asm)
 - #144403 (`tests/ui/issues/`: The Issues Strike Back [4/N])
 - #144544 (Start reporting future breakage for `ILL_FORMED_ATTRIBUTE_INPUT` in dependencies)
 - #144739 (Use new public libtest `ERROR_EXIT_CODE` constant in rustdoc)
 - #145089 (Improve error output when a command fails in bootstrap)
 - #145112 ([win][arm64ec] Partial fix for raw-dylib-link-ordinal on Arm64EC)
 - #145129 ([win][arm64ec] Add `/machine:arm64ec` when linking LLVM as Arm64EC)
 - #145130 (improve "Documentation problem" issue template.)
 - #145135 (Stabilize `duration_constructors_lite` feature)
 - #145145 (some `derive_more` refactors)
 - #145147 (rename `TraitRef::from_method` to `from_assoc`)
 - #145156 (Override custom Cargo `build-dir` in bootstrap)
 - #145160 (Change days-threshold to 28 in [behind-upstream])
 - #145162 (`{BTree,Hash}Map`: add "`Entry` API" section heading)
 - #145175 (Enable limit_rdylib_exports on Solaris)
 - #145187 (Fix an unstable feature comment that wasn't a doc comment)
 - #145191 (`suggest_borrow_generic_arg`: use the correct generic args)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 10, 2025
unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc `````@madsmtm````` `````@flba-eb````` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
bors added a commit that referenced this pull request Aug 10, 2025
Rollup of 18 pull requests

Successful merges:

 - #141624 (unstable-book: Add stubs for environment variables; document some of the important ones)
 - #143093 (Simplify polonius location-sensitive analysis)
 - #144402 (Stabilize loongarch32 inline asm)
 - #144403 (`tests/ui/issues/`: The Issues Strike Back [4/N])
 - #144739 (Use new public libtest `ERROR_EXIT_CODE` constant in rustdoc)
 - #145089 (Improve error output when a command fails in bootstrap)
 - #145112 ([win][arm64ec] Partial fix for raw-dylib-link-ordinal on Arm64EC)
 - #145129 ([win][arm64ec] Add `/machine:arm64ec` when linking LLVM as Arm64EC)
 - #145130 (improve "Documentation problem" issue template.)
 - #145135 (Stabilize `duration_constructors_lite` feature)
 - #145145 (some `derive_more` refactors)
 - #145147 (rename `TraitRef::from_method` to `from_assoc`)
 - #145156 (Override custom Cargo `build-dir` in bootstrap)
 - #145160 (Change days-threshold to 28 in [behind-upstream])
 - #145162 (`{BTree,Hash}Map`: add "`Entry` API" section heading)
 - #145175 (Enable limit_rdylib_exports on Solaris)
 - #145187 (Fix an unstable feature comment that wasn't a doc comment)
 - #145191 (`suggest_borrow_generic_arg`: use the correct generic args)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 10, 2025
unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc ``````@madsmtm`````` ``````@flba-eb`````` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 10, 2025
unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc ```````@madsmtm``````` ```````@flba-eb``````` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
bors added a commit that referenced this pull request Aug 10, 2025
Rollup of 17 pull requests

Successful merges:

 - #141624 (unstable-book: Add stubs for environment variables; document some of the important ones)
 - #143093 (Simplify polonius location-sensitive analysis)
 - #144402 (Stabilize loongarch32 inline asm)
 - #144403 (`tests/ui/issues/`: The Issues Strike Back [4/N])
 - #144739 (Use new public libtest `ERROR_EXIT_CODE` constant in rustdoc)
 - #145089 (Improve error output when a command fails in bootstrap)
 - #145112 ([win][arm64ec] Partial fix for raw-dylib-link-ordinal on Arm64EC)
 - #145129 ([win][arm64ec] Add `/machine:arm64ec` when linking LLVM as Arm64EC)
 - #145130 (improve "Documentation problem" issue template.)
 - #145135 (Stabilize `duration_constructors_lite` feature)
 - #145145 (some `derive_more` refactors)
 - #145147 (rename `TraitRef::from_method` to `from_assoc`)
 - #145156 (Override custom Cargo `build-dir` in bootstrap)
 - #145160 (Change days-threshold to 28 in [behind-upstream])
 - #145162 (`{BTree,Hash}Map`: add "`Entry` API" section heading)
 - #145187 (Fix an unstable feature comment that wasn't a doc comment)
 - #145191 (`suggest_borrow_generic_arg`: use the correct generic args)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Aug 10, 2025
Rollup of 17 pull requests

Successful merges:

 - #141624 (unstable-book: Add stubs for environment variables; document some of the important ones)
 - #143093 (Simplify polonius location-sensitive analysis)
 - #144402 (Stabilize loongarch32 inline asm)
 - #144403 (`tests/ui/issues/`: The Issues Strike Back [4/N])
 - #144739 (Use new public libtest `ERROR_EXIT_CODE` constant in rustdoc)
 - #145089 (Improve error output when a command fails in bootstrap)
 - #145112 ([win][arm64ec] Partial fix for raw-dylib-link-ordinal on Arm64EC)
 - #145129 ([win][arm64ec] Add `/machine:arm64ec` when linking LLVM as Arm64EC)
 - #145130 (improve "Documentation problem" issue template.)
 - #145135 (Stabilize `duration_constructors_lite` feature)
 - #145145 (some `derive_more` refactors)
 - #145147 (rename `TraitRef::from_method` to `from_assoc`)
 - #145156 (Override custom Cargo `build-dir` in bootstrap)
 - #145160 (Change days-threshold to 28 in [behind-upstream])
 - #145162 (`{BTree,Hash}Map`: add "`Entry` API" section heading)
 - #145187 (Fix an unstable feature comment that wasn't a doc comment)
 - #145191 (`suggest_borrow_generic_arg`: use the correct generic args)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 652429a into rust-lang:master Aug 10, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 10, 2025
rust-timer added a commit that referenced this pull request Aug 10, 2025
Rollup merge of #141624 - jyn514:env-var-stubs, r=BoxyUwU

unstable-book: Add stubs for environment variables; document some of the important ones

This uses a very hacky regex that will probably miss some variables. But having some docs seems better than none at all.

In particular, this documents the following env vars explicitly (cc ````````@madsmtm```````` ````````@flba-eb```````` - do the docs for SDKROOT and QNX_TARGET look right?):

- COLORTERM
- QNX_TARGET
- SDKROOT
- TERM

and generates stubs for the following env vars:

- RUST_BACKTRACE
- RUSTC_BLESS
- RUSTC_BREAK_ON_ICE
- RUSTC_CTFE_BACKTRACE
- RUSTC_FORCE_RUSTC_VERSION
- RUSTC_GRAPHVIZ_FONT
- RUSTC_ICE
- RUSTC_LOG
- RUSTC_RETRY_LINKER_ON_SEGFAULT
- RUSTC_TRANSLATION_NO_DEBUG_ASSERT
- RUST_DEP_GRAPH_FILTER
- RUST_DEP_GRAPH
- RUST_FORBID_DEP_GRAPH_EDGE
- RUST_MIN_STACK
- RUST_TARGET_PATH
- UNSTABLE_RUSTDOC_TEST_LINE
- UNSTABLE_RUSTDOC_TEST_PATH

rendered: ![screenshot of unstable-book running locally, with 14 environment variables shown in the sidebar](https://github.com/user-attachments/assets/8238d094-fb7a-456f-ad43-7c07aa2c44dd)
@jyn514 jyn514 deleted the env-var-stubs branch August 10, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants