Closed aaron42net closed 2 years ago
Thanks for the report @aaron42net
It seems we could improve our automated tests to detect issues when compiling with purego
or testing with -race
on different architectures 👍
If you are able to help, we would always welcome contributions!
@aaron42net thanks for the report! this is fixed by https://github.com/segmentio/asm/pull/64 and https://github.com/segmentio/encoding/pull/111
While running a test suite on Go 1.17.3 on an M1 Mac with github.com/segmentio/encoding v0.3.2 and github.com/segmentio/asm v1.1.0, I ran into https://github.com/segmentio/encoding/issues/84 again. I believe the fix in https://github.com/segmentio/encoding/pull/85 was incomplete and may not apply to non-Intel CPUs, or maybe the rules are slightly different in newer Go and/or on ARM.
The same test code triggers it:
Run the same way:
And the results are:
I've tried to run on an Intel CPU with
-tags purego
, but it won't compile due to duplicated function definitions. Perhaps add a build !purego to the generated _amd64.go files to get this to work and addgo test -race -tags purego
to your test suite?Thanks! -- Aaron