Skip to content

Conversation

@cehoffman
Copy link
Contributor

CGO builds with zig toolchain fail because go_go_wrapper changes to a temp directory before invoking the C compiler. The generated wrapper scripts use relative paths that break once we're no longer in the project root:

# runtime/cgo
zig_cc.sh: line 2: buck-out/v2/gen/mise/.../zig: No such file or directory

After fixing that, zig also doesn't support nested argsfiles which the Go prelude generates:

error: unable to parse command line parameters: NestedResponseFile

This PR uses BASH_SOURCE to resolve paths from the script's location and adds recursive argsfile expansion before invoking zig.

The Windows path has the same issues but I don't have a way to test batch scripts. Would need %~dp0 for path resolution and similar expansion logic - happy to add it if someone can validate.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 14, 2026
@cehoffman cehoffman force-pushed the feat/cxx-zig-toolchain-bash-source branch from dcbdc56 to 9ca8eed Compare January 14, 2026 14:11
@cehoffman cehoffman force-pushed the feat/cxx-zig-toolchain-bash-source branch from 9ca8eed to a1cb132 Compare January 15, 2026 05:25
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 15, 2026

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D90741556. (Because this pull request was imported automatically, there will not be any future comments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant