Skip to content
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

testscript: fix "signal: killed" exec errors on MacOS by using os.Symlink on darwin #221

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion testscript/exe.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ func RunMain(m TestingM, commands map[string]func() int) (exitCode int) {
// as that can lead to "access denied" errors when removing.
func copyBinary(from, to string) error {
if runtime.GOOS != "windows" {
if err := os.Link(from, to); err == nil {
// Note: We used to use os.Link here, but there were
// "signal: killed" unexpected command failure type of errors on newer MacOS versions.
// Testing this show that os.Symlink works on MacOS without the above issue.
if err := os.Symlink(from, to); err == nil {
return nil
}
}
Expand Down