-
Notifications
You must be signed in to change notification settings - Fork 330
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
Support pure = "on"
for [email protected]
#1629
Conversation
Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (circl) have been updated in this PR. Please review the changes. |
RFC: @fmeum |
59b9dbe
to
d3fd88f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fmeum my question here would be: is switching to !cgo
the correct thing or should rules_go
be setting the purego
build tag when pure = "on"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that purego
is the community accepted flag: golang/go#23172
Should we drop this and add purego
build flag to rules_go
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch mirrors this comment in that cgo
is basically !purego
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the Go thread you linked, I would prefer to add purego
support to rules_go instead of moving this module further away from upstream.
Does that sound reasonable to you? Let me know if you want help with the change to rules_go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that sound reasonable to you?
Yeah. That's a better, more general solution assuming that the community aligns on purego
. We can always upstream purego
tags to projects or patch them in the BCR. I'll get on that patch now
Any views on the noasm
flag? Seems that various projects use that to control adding .S
files in but I'm unsure what that means for rules_go
? If rules_go
also specified noasm
when pure = "on"
then the gazelle
generation for circl
would likely "Just Work ™️"
Personally, I don't really understand the intersection between cgo
, purego
and noasm
. To myself, they seem mutually exclusive. If purego
is on, surely that means !cgo
? Also, if you want purego
, surely that means noasm
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, the go
developers do not include assembly when purego
is on: https://go-review.googlesource.com/c/go/+/561935
circl
has a separate noasm
and purego
tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have raised cloudflare/circl#491 for upstream discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cloudflare/circl#492 aligns on purego
.
b3d72af
to
bfbe7ef
Compare
This switches the `purego` build tag to use the `cgo` tag which allows the source files to be correctly conditionally included in the build actions. There is a second patch that adds a couple of unit tests that have `pure = "on"` enabled to prevent regressions.
bfbe7ef
to
e141836
Compare
cloudflare/circl#492 is in Once Closing this. |
@mattyclarkson Wouldn't the module still be needed for the CGO version of circl? Have you observed a difference in performance? |
The CGO version will be compiled if |
Sure, but does gazelle generate the correct build files for it to find the assembly without a patch? That's what I introduced the module for in the first place. |
You are correct, sorry. It doesn't correctly find the header file. We will still need a patch. I was only testing with I'll get one up once the |
This switches out
purego
build tags for the inverse!cgo
build tags.The correct files are then conditionally added and compiled.
This supports
pure = "on"
binaries.A patch adds a
pure = "on"
unit test to prevent regressions.