Skip to content

build: no debug info in a default build profile #8

Closed

Description

@shinaoka

The shared Rust rules require that no default Cargo profile carries debug info (Debug Info Is Not A Default, added in tensor4all/tensor4all-agent-rules#18).

Finding

The workspace root Cargo.toml (crate computegraph, with a trailing [workspace]) declares no [profile.*], so it builds dev/test with Cargo's default debug = 2.

Evidence: Cargo.toml @ 594cdcec60cf

Why it matters

debug = 0 is not Cargo's default for dev/test: without it the dev profile uses debug = 2, so every local cargo build, cargo test and cargo nextest run emits DWARF. Neither command reads it, and DWARF -- not code -- is what makes build output large. Measured on one machine: a single strided_kernel dev rlib reached 1.13 GiB, and the shared compiler cache held 320 GiB of dev-profile artifacts out of a 335 GiB store. debug = 1 and debug = "line-tables-only" are not a size compromise either: both emit DWARF.

Smallest useful correction

Add to the workspace root Cargo.toml:

[profile.dev]
debug = 0

[profile.test]
debug = 0

Keep debug-assertions, overflow-checks and incremental compilation as they are; they are unrelated to DWARF. A session that needs symbols asks for them with CARGO_PROFILE_DEV_DEBUG=2, and a workspace that needs readable backtraces for everyone adds one narrow opt-in profile (release-debug, profiling) instead of a default one. Cargo reads [profile.*] from the workspace root only, so a member's or a dependency's own profile block must not be changed for this.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions