rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Exclude assembly files in cgo packages in pure mode

Open hugelgupf opened this issue 2 years ago • 2 comments

This matches go build behavior: assembly files in packages with cgo are processed through cgo first. This means that noncgo compilation excludes assembly files in packages with cgo.

Note https://github.com/golang/go/blob/2184a394777ccc9ce9625932b2ad773e6e626be0/src/cmd/go/internal/work/exec.go#L758 in Go build source

Example package: https://github.com/cloudflare/circl/tree/main/dh/x25519 curve_amd64.(h|s)

Does not compile correctly before this patch when pure = "on".

hugelgupf avatar Dec 24 '23 05:12 hugelgupf

Could you explain how this relates to https://github.com/bazelbuild/rules_go/pull/3661, which I thought had fixed this issue? Sorry, I'm not very familiar with how the vanilla Go toolchain handles cgo.

fmeum avatar Dec 24 '23 10:12 fmeum

Hi @hugelgupf, did you have a chance to check @fmeum's comment?

If this by any chance fixes depending on cloudflare/circl with pure = on this will be greatly appreciated.

Thanks!

albertocavalcante avatar Aug 14 '24 08:08 albertocavalcante