Repository navigation
cygwin: Change POSIX_SPAWN_* flags to c_short - #5572
Merged
tgross35 merged 1 commit intoOct 1, 2026
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
vignesh-chaturvedi
force-pushed
the
cygwin-posix-spawn-c-short
branch
from
September 29, 2026 15:54
fe413e0 to
598cbe6
Compare
Member
|
Seems reasonable to me, @Berrysoft could you ack? |
tgross35
enabled auto-merge
October 1, 2026 08:12
These flags are passed to `posix_spawnattr_setflags`, which takes a `short` in newlib's `spawn.h` and is already bound with `c_short` here. Every other platform uses `c_short` for them. Linux was changed in rust-lang#3629, and Cygwin support was added after that with `c_int`. The values are unchanged. Link: https://github.com/cygwin/cygwin/blob/6fde14c0e24aa7e6dd73ba96b8ec60962261e2d5/newlib/libc/include/spawn.h#L42-L47 Link: https://github.com/cygwin/cygwin/blob/6fde14c0e24aa7e6dd73ba96b8ec60962261e2d5/newlib/libc/include/spawn.h#L92-L93 Link: https://github.com/cygwin/cygwin/blob/6fde14c0e24aa7e6dd73ba96b8ec60962261e2d5/newlib/libc/include/spawn.h#L105
tgross35
force-pushed
the
cygwin-posix-spawn-c-short
branch
from
October 1, 2026 08:12
598cbe6 to
44cdb48
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Member
|
@vignesh-chaturvedi it looks like your PR description may have been AI-assisted, it's a bit verbose. Please handwrite all user-facing communication, including PR descriptions and commit messages (in accordance with the Rust policy). |
Contributor
Author
|
Yes, I used an AI assistant for the PR description and commit message. Sorry about that, and thanks for pointing it out. I’ll write them myself from now on. |
Merged
renovate-bot
pushed a commit
to renovate-bot/rust-lang-_-libc
that referenced
this pull request
Oct 1, 2026
These flags are passed to `posix_spawnattr_setflags`, which takes a `short` in newlib's `spawn.h` and is already bound with `c_short` here. Every other platform uses `c_short` for them. Linux was changed in rust-lang#3629, and Cygwin support was added after that with `c_int`. The values are unchanged. Link: https://github.com/cygwin/cygwin/blob/6fde14c0e24aa7e6dd73ba96b8ec60962261e2d5/newlib/libc/include/spawn.h#L42-L47 Link: https://github.com/cygwin/cygwin/blob/6fde14c0e24aa7e6dd73ba96b8ec60962261e2d5/newlib/libc/include/spawn.h#L92-L93 Link: https://github.com/cygwin/cygwin/blob/6fde14c0e24aa7e6dd73ba96b8ec60962261e2d5/newlib/libc/include/spawn.h#L105 (backport <rust-lang#5572>) (cherry picked from commit 8cc9013)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On every other platform the
POSIX_SPAWN_*flags arec_short, matchingposix_spawnattr_setflagsandposix_spawnattr_getflags. Linux was changed in #3629, which fixed #3627, a duplicate of #2268. Cygwin support was added after that withc_int, even though itsposix_spawnattr_setflagsbinding in this crate already takesc_shortand newlib'sspawn.hdeclares the parameter asshort. This makes Cygwin match.The values are unchanged. Since this changes the type, it is a breaking change and is meant for
mainonly.Cygwin is not built in CI, so I checked it locally with
RUSTFLAGS=-Dwarnings cargo +nightly check -Zbuild-std=core --target x86_64-pc-cygwin.The
posix_spawnpath in std is used on Cygwin, and it infers the type of itsflagsvariable from these constants and then passesflags as _. That is the same as on FreeBSD and illumos, where the flags are alreadyc_short, so std should not need any changes.With this, the flags are
c_shorton every platform, so this closes #2268.Checklist
libc-test/semverhave been updated (nothing to update, the names are already listed incygwin.txtand only the types change)*LASTor*MAXhave the standard doc comment (not applicable)cargo test -p libc-test --target mytarget); especially relevant for platforms that may not be checked in CII do not have a Cygwin environment to run
libc-test, so the change was only type checked with the command above.