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

obfuscate syscall again to fix x/sys/unix #834

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

mvdan
Copy link
Member

@mvdan mvdan commented Feb 18, 2024

(see commit message)

Fixes #830.

When updating Garble to support Go 1.22.0, CI on MacOS spotted
that the syscall package was failing to build given that it uses
assembly code which is only allowed in some std packages.

That allowlist is based on import paths, and we were obfuscating
the syscall package's import path, so that was breaking GOOS=darwin.
As a fix, I added syscall to runtimeAndDeps to not obfuscate it.

That wasn't a great fix; it's not part of runtime and its dependencies,
and there's no reason we should avoid obfuscating the package contents.
Not obfuscating the contents in fact broke x/sys/unix,
as it contains a copy of syscall.Rlimit which it type converted with.

Undo that fix and reinstate the gogarble.txtar syscall test.
Implement the fix where we only leave syscall's import path alone.
Add a regression test, and add a note about adding x/net and x/sys
to check-third-party.sh so that we can catch these bugs earlier.

Fixes burrowers#830.
@mvdan
Copy link
Member Author

mvdan commented Feb 18, 2024

I forgot that syscall.Rlimit is not declared on windows; the test should be fixed now.

@pagran pagran merged commit 66b6140 into burrowers:master Feb 18, 2024
5 checks passed
@mvdan mvdan deleted the obfuscate-syscall branch February 25, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

x/sys/unix no longer builds with garble v0.12.0
2 participants