Skip to content

stdbuf: fix build.rs to propagate custom profiles to libstdbuf#12462

Open
Ecordonnier wants to merge 2 commits into
uutils:mainfrom
Ecordonnier:eco/stdbuf-profile
Open

stdbuf: fix build.rs to propagate custom profiles to libstdbuf#12462
Ecordonnier wants to merge 2 commits into
uutils:mainfrom
Ecordonnier:eco/stdbuf-profile

Conversation

@Ecordonnier
Copy link
Copy Markdown
Collaborator

The PROFILE env var only returns the base profile name ('release' or 'debug'), not the actual profile. For example, when building with --profile=release-small, PROFILE=release, so the old code would pass --release to the nested libstdbuf build, causing it to be compiled with release settings instead of release-small settings (opt-level=z, strip=true, etc.).

Fix this by extracting the actual profile name from OUT_DIR, which always contains the real profile name in its path (.../target/{profile}/build/...). This correctly handles all custom profiles like release-small, profiling, etc.

Fixes: #12434

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 24, 2026

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)

@oech3

This comment was marked as resolved.

… build

The PROFILE env var only returns the base profile name ('release' or 'debug'),
not the actual profile. For example, when building with --profile=release-small,
PROFILE=release, so the old code would pass --release to the nested libstdbuf
build, causing it to be compiled with release settings instead of release-small
settings (opt-level=z, strip=true, etc.).

Fix this by extracting the actual profile name from OUT_DIR, which always
contains the real profile name in its path (.../target/{profile}/build/...).
This correctly handles all custom profiles like release-small, profiling, etc.

Fixes: uutils#12434

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
@Ecordonnier Ecordonnier force-pushed the eco/stdbuf-profile branch from 83a11c9 to 96e6066 Compare May 24, 2026 20:15
Comment thread src/uu/stdbuf/build.rs Outdated
Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
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