rogpeppe / go-internal

Selected Go-internal packages factored out from the standard library
BSD 3-Clause "New" or "Revised" License
823 stars 67 forks source link

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

Closed bep closed 1 year ago

bep commented 1 year ago

By using os.Symlink on Darwin.

See #200

mvdan commented 1 year ago

I wonder if we should support hard links at all, then. I chose hard links because symlinks can cause more trouble, but empirically, hard links are causing trouble as well. Symlinks are better on MacOS, and they shouldn't be worse on Linux.

If you replace os.Link with os.Symlink, and add a brief comment about hard links having caused issues on Mac before, I'm happy to merge - with the assumption that we're pretty sure the flakes on Mac would be gone.

bep commented 1 year ago

@mvdan I have force pushed a version that uses os.Symlink for all (except Windows). I have also repeated my test a few times, and it 1. Never fails with this branch 2. Always fails on master.