Skip to content

Conversation

@dawedawe
Copy link
Contributor

What does this PR try to resolve?

fixes #16363 by splitting the documentation of DEBUG and OPT_LEVEL and listing the only possible values for DEBUG as commented by ehuss. (I hope it's okay to just take your comment as documentation 😄 )

How to test and review this PR?

With mdbook build --open for example.

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 17, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 17, 2025

r? @epage

rustbot has assigned @epage.
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

content of `CARGO_MAKEFLAGS` to activate the use of Cargo's GNU Make compatible
[jobserver] for sub-make invocations.
* `OPT_LEVEL`, `DEBUG` --- values of the corresponding variables for the profile currently being built.
* `DEBUG` --- `true` or `false`. `false` corresponds to when the debug profile setting is `0`, `false`, or `"none"`.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably state something like "all other values map to true"

Alternatively, we could adopt language from the doc comment

    /// Returns true if any debuginfo will be generated. Helper
    /// for a common operation on the usual `Option` representation.

and say

true if any debug information will be generated and false otherwise

or appended to the existing comment

otherwise true indicating debug information will be generated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, it's probably good to not replicate the possible profile values here.

Comment on lines 380 to 381
* `DEBUG` --- `true` or `false`. `false` corresponds to when the debug profile setting is `0`, `false`, or `"none"`.
* `OPT_LEVEL` --- values of the corresponding variable for the profile currently being built.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@epage
Copy link
Contributor

epage commented Dec 17, 2025

Thanks for working to improve the documentation!

@epage
Copy link
Contributor

epage commented Dec 18, 2025

Thanks!

@epage epage enabled auto-merge December 18, 2025 00:09
@epage epage added this pull request to the merge queue Dec 18, 2025
Merged via the queue into rust-lang:master with commit 6f706c2 Dec 18, 2025
28 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 18, 2025
@dawedawe dawedawe deleted the docs_fix_debug_env branch December 18, 2025 06:45
bors added a commit to rust-lang/rust that referenced this pull request Dec 20, 2025
Update cargo submodule

13 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..3861f60f6b58f57524c0e7aab1f5c1ad83e35409
2025-12-13 16:29:21 +0000 to 2025-12-19 21:53:33 +0000
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
@rustbot rustbot added this to the 1.94.0 milestone Dec 20, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 21, 2025
Update cargo submodule

13 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..3861f60f6b58f57524c0e7aab1f5c1ad83e35409
2025-12-13 16:29:21 +0000 to 2025-12-19 21:53:33 +0000
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
bors added a commit to rust-lang/rust that referenced this pull request Dec 27, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Dec 28, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 28, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Dec 29, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
Kobzol pushed a commit to Kobzol/rustc_codegen_cranelift that referenced this pull request Dec 29, 2025
Update cargo submodule

13 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..3861f60f6b58f57524c0e7aab1f5c1ad83e35409
2025-12-13 16:29:21 +0000 to 2025-12-19 21:53:33 +0000
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
Kobzol pushed a commit to Kobzol/rustc_codegen_cranelift that referenced this pull request Dec 29, 2025
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/stdarch that referenced this pull request Jan 1, 2026
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Jan 8, 2026
Update cargo submodule

17 commits in e91b2baa632c0c7e84216c91ecfe107c37d887c1..94c368ad2b9db0f0da5bdd8421cea13786ce4412
2025-12-13 16:29:21 +0000 to 2025-12-26 19:39:15 +0000
- fix(vendor): unpack from local-registry cache path (rust-lang/cargo#16435)
- feat(index): Stabilize pubtime (rust-lang/cargo#16372)
- Experiment: Render timing pipeline in SVG (rust-lang/cargo#15091)
- chore(triagebot): auto-label `Command-report` (rust-lang/cargo#16429)
- fix(sbom): Don't set CARGO_SBOM_PATH when empty (like stable)  (rust-lang/cargo#16419)
- chore(ci): report-timings to upload HTML report (rust-lang/cargo#16416)
- fix(report): get the same feature parity of `--timings` (rust-lang/cargo#16414)
- fix(docs): Document the only possible values for DEBUG in build scripts (rust-lang/cargo#16413)
- fix(log): emit fingeprint log also for no-rebuild unit (rust-lang/cargo#16408)
- Fix link to `doc_cfg` docs in cargo book (rust-lang/cargo#16404)
- Add best pratice for how to check in generated files (rust-lang/cargo#16405)
- test: Use a larger default term width (rust-lang/cargo#16403)
- Document more services and permissions of the cargo team (rust-lang/cargo#16402)
- fix(new): Improve quality of package name error messages (rust-lang/cargo#16398)
- feat(log): add more log events (rust-lang/cargo#16390)
- chore: bump to 0.95.0; update changelog (rust-lang/cargo#16395)
- Cache submodule into git db (rust-lang/cargo#16246)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-documenting-cargo-itself Area: Cargo's documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build scripts: DEBUG environment variable is always "true" or "false"

3 participants