Skip to content

Move the Rust test debug info setting into [profile.test] - #1581

Merged
oguzkocer merged 2 commits into
trunkfrom
fix/rust-test-debuginfo-profile
Aug 20, 2026
Merged

Move the Rust test debug info setting into [profile.test]#1581
oguzkocer merged 2 commits into
trunkfrom
fix/rust-test-debuginfo-profile

Conversation

@oguzkocer

Copy link
Copy Markdown
Contributor

Description

#1580 capped Rust test debug info by prefixing two Makefile targets with env CARGO_PROFILE_TEST_DEBUG=line-tables-only. This reverts that commit and reapplies the same setting as [profile.test] in the workspace Cargo.toml.

The environment variable reached test-rust-lib and test-rust-doc only. The four other cargo test invocations in the Makefile — one of them behind scripts/run-rust-integration-tests.sh — and any cargo test run outside make still built with full debug info, and every test target added later would have needed the prefix repeated. A profile entry covers all of them and cannot be forgotten. It also keeps local runs and CI on one setting, so alternating between make test-rust-lib and the cargo test --lib that CLAUDE.md documents no longer rebuilds the dependency graph each way.

The profile applies to every crate a cargo test run builds, dependencies included, rather than only the crate under test — confirmed with cargo test -p wp_serde_helper --lib --no-run -v, where the dependencies compile with -C debuginfo=line-tables-only.

Shipped artifacts are untouched: the Apple libraries build with --profile $(CARGO_PROFILE) (release on CI) under --config profile.$(CARGO_PROFILE).debug=true, and the Android JNI libraries with cargo ndk ... build --release under RUSTFLAGS=-g. Crash-report symbolication is unaffected on both platforms.

Changes

  • Reverted a68ebeb, dropping the env CARGO_PROFILE_TEST_DEBUG=line-tables-only prefix from test-rust-lib and test-rust-doc, and removing its changelog entry — which had landed inside the released ## [0.7.0] section rather than ## [Unreleased].
  • Added [profile.test] debug = "line-tables-only" to the workspace Cargo.toml, commented with the tradeoff (backtraces still resolve to file and line; a debugger can no longer print locals) and the CARGO_PROFILE_TEST_DEBUG=full override for a debugging session.
  • Added the changelog entry under ## [Unreleased], filed as Changed to match the other **Internal:** build and CI entries.

Changelog

  • I've added an entry to CHANGELOG.md under ## [Unreleased], using the Keep a Changelog categories (Added, Changed, Deprecated, Removed, Fixed, Security). Prefix breaking changes with **BREAKING:**.

This reverts commit a68ebeb.

Reverted so the setting can be reapplied as `[profile.test]` in the workspace
`Cargo.toml`, where it also reaches the `cargo test` invocations the two
patched `Makefile` targets missed.
Reapply the CI memory cap as a workspace profile rather than an environment
variable on two `Makefile` targets. As a profile it reaches every `cargo test`
invocation — the four others in the `Makefile` and direct `cargo test` runs
outside it — and it applies to the whole dependency graph, not only the crate
under test.

Changes:
- Add `[profile.test] debug = "line-tables-only"` to the workspace `Cargo.toml`
- Add the changelog entry under `## [Unreleased]`
@wpmobilebot

Copy link
Copy Markdown
Collaborator

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1581")

Built from d829248

@oguzkocer
oguzkocer marked this pull request as ready for review August 20, 2026 00:53
@oguzkocer
oguzkocer requested a review from iangmaia August 20, 2026 00:53
Comment thread Cargo.toml
# This profile covers every crate a `cargo test` run builds, dependencies
# included — not just the crate under test.
[profile.test]
debug = "line-tables-only"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@iangmaia

Copy link
Copy Markdown
Contributor

@oguzkocer Thanks for the changelog fix and the config improvement and apologies for rushing the previous PR -- I was too focused on getting the test tasks with the debug info setting and running it on CI.
I appreciate the [profile.test] also affecting other test as well as local cargo runs and potential future test targets 👍

@oguzkocer
oguzkocer merged commit a926046 into trunk Aug 20, 2026
36 checks passed
@oguzkocer
oguzkocer deleted the fix/rust-test-debuginfo-profile branch August 20, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants