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

fix build tags and become a module #5

Merged
merged 3 commits into from
Mar 16, 2022
Merged

fix build tags and become a module #5

merged 3 commits into from
Mar 16, 2022

Conversation

chappjc
Copy link
Contributor

@chappjc chappjc commented Mar 15, 2022

The old style build tags were not working as intended due misplaced spaces.

// +build amd64, !gccgo, !appengine

In the above old style +build line, which is now replaced with //go:build lines that use a standard boolean syntax, the spaces mean OR, while commas mean AND.

When go fmt is run on the source with Go 1.17 or 1.18, it translates the above line into the following:

//go:build (amd64 && ignore) || (!gccgo && ignore) || !appengine
// +build amd64,ignore !gccgo,ignore !appengine

So this build line was not considering either the amd64 or gccgo tags, just the !appengine.

The intended build tags for siphash_amd64.go seem to be the following:

//go:build amd64 && !gccgo && !appengine && !nacl
// +build amd64,!gccgo,!appengine,!nacl

The tags for siphash_ref.go are still the following:

//go:build (!amd64 && !386) || gccgo || appengine || nacl
// +build !amd64,!386 gccgo appengine nacl

This resolves a build error with multiple definitions of core when gccgo is set.

This also makes github.com/aead/siphash into a Go module.

This adds the equivalient go:build tags, and fixes the tags used in the
amd64 and 386 code.
@aead aead merged commit 38947f5 into aead:master Mar 16, 2022
@chappjc chappjc deleted the build-tags branch March 16, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants