Skip to content

Fix the build constraints on the assembly files - #4

Open
asp24 wants to merge 1 commit into
up/test-suitefrom
up/noasm-constraint
Open

Fix the build constraints on the assembly files#4
asp24 wants to merge 1 commit into
up/test-suitefrom
up/noasm-constraint

Conversation

@asp24

@asp24 asp24 commented Jul 31, 2026

Copy link
Copy Markdown
Member

Candidate for minio/simdjson-go. Cut from upstream master; based here on #2 only so that CI is green.

//+build !noasm !appengine gc is an OR, so it holds on essentially every build and all nine .s files are compiled even under -tags=noasm. Before:

$ go list -tags=noasm -f '{{.SFiles}}' .
[finalize_structurals_amd64.s find_newline_delimiters_amd64.s ... parse_string_amd64.s]

After, that list is empty, and the normal build still has all nine.

The tag did take effect, because the Go declarations beside the assembly use the AND form and were excluded, leaving the assembly compiled and unreferenced - so nothing was broken, but -tags=noasm still needed an assembler and the constraint said something other than what it meant. Only the //go:build form is written: go.mod asks for 1.22, well past the release that understands it, and one line cannot drift out of step with a second.

`//+build !noasm !appengine gc` is an OR - the file is built if any one term holds - so
it held on essentially every build, and all nine .s files were compiled even under
-tags=noasm. `go list -tags=noasm -f '{{.SFiles}}'` lists all nine today and none after
this change.

The tag did take effect, because the Go declarations beside the assembly use the AND
form and so were excluded; the assembly was compiled and left unreferenced. So nothing
was broken by it, but -tags=noasm still needed an assembler, and the constraint said
something other than what it meant.

Only the //go:build form is written: go.mod asks for 1.22, well past the release that
understands it, and keeping a single line means the two cannot drift apart again.
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.

1 participant