Repository navigation
Refactor unix-only signal and dup2 handling into build-tagged files - #106
Merged
Merged
Conversation
ernestrc
reviewed
Sep 20, 2026
| import "syscall" | ||
|
|
||
| func init() { | ||
| sigMap[syscall.SIGUSR1] = "USR1" |
Contributor
There was a problem hiding this comment.
rather than mutating the default map, I think it would be better if we just defined the full map here, and a signal_windows.go which what we need for windows. Reading std_remote.go no longer tells you what sigMap contains; worse, it leads you to think that that's the entire set.
| // You should have received a copy of the GNU General Public License | ||
| // along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| //go:build windows |
Contributor
There was a problem hiding this comment.
nit: this is redundant. _windows.go suffix already implies it
cmd/rune/main.go referenced syscall.SIGURG and unix.Dup2, and the ssh workspace's signal map referenced syscall.SIGUSR1 and SIGUSR2. None of these exist on Windows, so both packages fail to compile there (unstablebuild#68). Move them into !windows files unchanged. Windows gets its own small counterparts: SIGURG never arrives, the launch log takes over the standard error handle with SetStdHandle, which the runtime also uses for fatal writes, and USR1/USR2 are simply absent from the map. Behavior on Linux and macOS is unchanged; new tests pin the SIGURG check and the forwarded user signals. Signed-off-by: Eric Brooks <[email protected]>
Signed-off-by: ernestrc <[email protected]>
ernestrc
force-pushed
the
guard-unix-signals
branch
from
September 30, 2026 12:06
b0d1bf6 to
9e8aaad
Compare
ernestrc
approved these changes
Sep 30, 2026
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Part of Windows support (#68, coordinated on #81). First of a few small slices that move unix-only
syscalls behind build tags so the tree compiles for
GOOS=windows; graphics stay with #82.cmd/rune/main.goreferencedsyscall.SIGURGandunix.Dup2, and the ssh workspace's signal mapreferenced
SIGUSR1/SIGUSR2. None of these exist on Windows, so both packages fail to compilethere.
The unix bodies move into
!windowsfiles unchanged. Windows gets small counterparts:SIGURGnever arrives, the launch log takes over the standard error handle with
SetStdHandle(which theruntime also consults for fatal writes, so crash output lands in the log too), and
USR1/USR2aresimply absent from the map.
Behavior on Linux and macOS is unchanged. New tests pin the
SIGURGcheck and the forwarded usersignals.
After this,
cmd/rune's only remaining Windows compile errors aredetachFromTerminalandpresetStandardYAML, which #82 already provides inenv_windows.goandpreset_standard_windows.go;workspacesshhas none.