Skip to content

stdbuf: honor custom cargo profiles for libstdbuf#12480

Open
favilances wants to merge 1 commit into
uutils:mainfrom
favilances:fix/stdbuf-release-small-profile
Open

stdbuf: honor custom cargo profiles for libstdbuf#12480
favilances wants to merge 1 commit into
uutils:mainfrom
favilances:fix/stdbuf-release-small-profile

Conversation

@favilances
Copy link
Copy Markdown

Summary

Fixes #12434.

stdbuf manually builds libstdbuf from build.rs so the shared library is available for include_bytes!. The nested cargo invocation only distinguished debug/release builds, so cargo build --profile=release-small -p uu_stdbuf still built libstdbuf with the release profile.

This derives the active profile from OUT_DIR and forwards custom profiles to the nested cargo build with --profile.

Tests

  • cargo fmt --check -- src/uu/stdbuf/build.rs
  • cargo check -p uu_stdbuf --profile release-small
  • cargo test -p uu_stdbuf --profile release-small

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented May 26, 2026

Sorry. But this PR is duplicated.

Comment thread src/uu/stdbuf/build.rs
.parent()?
.parent()?
.file_name()
.map(|profile| profile.to_string_lossy().into_owned())
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.

Invalid unicode is not supported.

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Congrats! The gnu test tests/expand/bounded-memory is now passing!

@xtqqczze
Copy link
Copy Markdown
Contributor

Duplicate of #12462

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stdbuf: build.rs bypasses --profile=release-small

3 participants