Skip to content

stdbuf: build on Windows (depending on cygwin dll)#12329

Merged
Ecordonnier merged 1 commit into
uutils:mainfrom
oech3:winstdbuf
May 25, 2026
Merged

stdbuf: build on Windows (depending on cygwin dll)#12329
Ecordonnier merged 1 commit into
uutils:mainfrom
oech3:winstdbuf

Conversation

@oech3

@oech3 oech3 commented May 16, 2026

Copy link
Copy Markdown
Contributor

Build Windows native stdbuf.exe depending on libstdbuf.dll built for Cygwin. Useful for MSYS2. Closes #12328

@github-actions

github-actions Bot commented May 16, 2026

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/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/rm/isatty (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/pipe-f is now being skipped but was previously passing.

@oech3
oech3 force-pushed the winstdbuf branch 2 times, most recently from a13cfd9 to 13529b2 Compare May 16, 2026 16:31
@oech3
oech3 marked this pull request as ready for review May 16, 2026 16:52
@oech3
oech3 force-pushed the winstdbuf branch 4 times, most recently from e879393 to 7a5a9d3 Compare May 22, 2026 04:17
@oech3

This comment was marked as resolved.

@Ecordonnier Ecordonnier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So if I understand correctly, stdbuf.exe will work only with binaries which use the msys-2.0.dll or cygwin1.dll runtime. Normal windows PE programs won't be impacted at all.
The tools in /mingw64/bin (grep, sed, awk, git) are native PE binaries linking against MSVCRT/UCRT.

It would be good to document this use-case / limitation, because AFAIK stdbuf won't have any effect for the vast majority of MSYS2 usage patterns.

Comment thread src/uu/stdbuf/src/libstdbuf/build.rs Outdated
Comment thread src/uu/stdbuf/src/libstdbuf/build.rs Outdated
Comment thread src/uu/stdbuf/src/libstdbuf/build.rs Outdated
@oech3
oech3 force-pushed the winstdbuf branch 2 times, most recently from 5391c60 to 7176250 Compare May 24, 2026 20:03
@oech3

oech3 commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

It would be good to document this use-case / limitation, because AFAIK stdbuf won't have any effect for the vast majority of MSYS2 usage patterns.

at manpage or --help?

@Ecordonnier

Copy link
Copy Markdown
Collaborator

It would be good to document this use-case / limitation, because AFAIK stdbuf won't have any effect for the vast majority of MSYS2 usage patterns.

at manpage or --help?

As far as I understand, if you edit the ftl files in src/uu/stdbuf/locales, both the man pages and the --help text willbe updated.
I think the documentation of the limitation could go to the ftl files, yes. If it's not possible, I would at least document it with a comment in the code.

@oech3

oech3 commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

I think people not on Windows does not want to see such document. #[cfg] on clap can avoid that. But if I added it to stdbuf-after-help key, *.ftlduplicates many things. What key should I put it on?

@oech3
oech3 force-pushed the winstdbuf branch 2 times, most recently from fd13482 to 86186b6 Compare May 24, 2026 21:07
@oech3
oech3 requested a review from Ecordonnier May 25, 2026 00:01
@oech3

oech3 commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

It would be nice if we could do partial dll injection on actual Windows.

@Ecordonnier
Ecordonnier merged commit db7b8a6 into uutils:main May 25, 2026
173 of 174 checks passed
@oech3
oech3 deleted the winstdbuf branch May 25, 2026 10:32
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: supporting Windows can be meaningfull if target is cygwin binary

2 participants