Add an opt-in low-disk Cargo profile (#951)

* PR-02: add opt-in low-disk Cargo profile

* PR-02: document low-disk Cargo profile

---------

Co-authored-by: Brandon Thomas <[email protected]>
This commit is contained in:
cyfung1031andBrandon Thomas authored and GitHub committed 2026-10-11 14:02:06 -04:00
1 parent 134b98b0a8
commit 575f99f9be
2 files changed
+24

No files matched your search

+5
View File
@@ -89,6 +89,11 @@ debug = "line-tables-only"
[profile.dev]
opt-level = 1
[profile.low-disk]
inherits = "dev"
debug = "line-tables-only"
incremental = false
[profile.release]
lto = "thin"
codegen-units = 1
+19
View File
@@ -3,6 +3,25 @@
Working instructions for agents and contributors are in `AGENTS.md` and `CLAUDE.md`. This page
collects what the desktop app reads from its environment and where it writes its diagnostics.
## Low-disk Cargo profile
When local build storage is constrained, select the opt-in `low-disk` profile explicitly:
```sh
cargo build --profile low-disk -p pdfcraft-cli
cargo test --profile low-disk -p pdfcraft-cos --lib
```
The profile inherits the normal development settings, including debug assertions and overflow
checks. It uses line-table-only debug information for workspace code, which keeps file and line
numbers in backtraces but omits local-variable and parameter details, and it disables incremental
compilation for this profile only. Ordinary `cargo build`, `cargo test`, and release builds keep
their existing profiles.
Cargo stores custom-profile artifacts separately under `target/low-disk`. Switching between the
normal and low-disk profiles can therefore leave both sets of artifacts on disk. To remove only
the low-disk artifacts, run `cargo clean --profile low-disk`.
The UI crate and complete desktop/web builds require Rust 1.95 or later, matching the pinned
`craft-ui` dependency. The workspace's core-crate minimum is unchanged.