-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tmpnet] Ensure tmpnet compatibility with windows #3002
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I don't get whether we can run tmpnets on windows with this PR alone or if is there other work to do.
scripts/build_test.sh
Outdated
GOOS=$(go env GOOS) | ||
if [[ "$GOOS" == "windows" ]]; then | ||
# tmpnet is not compatible with windows | ||
EXCLUDED_TARGETS="${EXCLUDED_TARGETS} | grep -v tests/fixture" | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess now tmpnet is windows compatible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compatible with test discovery, yes. But since we don't run e2e on windows I have no confidence in the compatibility for actually running tempory networks on windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the windows implementation to panic. The previous code was untested and I don't think there's value in maintaining an untested solution.
@@ -0,0 +1,17 @@ | |||
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should this file be renamed something like "detached_process_default.go"?
Windows seems to be the special case we have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
af01132
to
0b8982d
Compare
This avoids breaking unit test discovery for any package that imports tmpnet.
f82c711
to
da51a7f
Compare
Rebased |
cmd.SysProcAttr = &syscall.SysProcAttr{ | ||
Setsid: true, | ||
} | ||
configureDetachedProcess(cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify - this PR is to make it so that this code can compile on windows, but there is no expectation for it to run on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: marun <maru.newby@avalabs.org>
Why this should be merged
This avoids breaking unit test discovery on windows for any package that imports tmpnet.
How this works
Separate os-specific process configuration into files that are conditionally compiled.
How this was tested
CI should be sufficient