Enable specs for close_on_exec on Windows#14716
Merged
straight-shoota merged 4 commits intocrystal-lang:masterfrom Aug 13, 2025
Merged
Enable specs for close_on_exec on Windows#14716straight-shoota merged 4 commits intocrystal-lang:masterfrom
close_on_exec on Windows#14716straight-shoota merged 4 commits intocrystal-lang:masterfrom
Conversation
Collaborator
|
Looks good, but I would wait a bit for #14717 to decide if we change the default (IMO: we should) and do it in one go. |
Member
Author
|
I'd actually prefer to merge this first, and then the PR for #14717 on top. That way the effective change in behaviour will be explicitly documented in the spec changes. Also there's really no reason to postpone this addition. It's merely enabling specs for current behaviour. And as such is a different concern than changing behaviour. |
ysbaddaden
reviewed
Jun 17, 2024
Collaborator
ysbaddaden
left a comment
There was a problem hiding this comment.
As you want.
We could consider the current behavior to be faulty: enabling the specs fails on Windows because the default there is false, so for the specs to pass and be correct, the behavior must change (aka: fix the implementation, not the spec) :)
mverzilli
approved these changes
Aug 11, 2025
straight-shoota
added a commit
that referenced
this pull request
Aug 17, 2025
`#system_close_on_exec=` (and thus `#close_on_exec=`) returns `Nil` on Windows. But #15698 added a type-restriction to `Bool`. We didn't notice this discrepancy before, because this method was never called on Windows until we enabled the specs for that in #14716. Changing the return value to `false` on Windows should be the correct behaviour. If the parameter is `true`, the method raises. This is a classic integration issue. It could've been avoided by testing each change against current master directly before merging it. But luckily they are pretty rare, so there's no urgent need to do something about it.
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.
These specs be enabled on Windows as well to ensure the expected behaviour (even though there's no mechanism for changing the value).