filecoin-project / filecoin-ffi

C and CGO bindings for Filecoin's Rust libraries
Other
93 stars 136 forks source link

CI fails on ARM due to cgocheck > 1 mode is no longer supported at runtime #431

Closed vmx closed 9 months ago

vmx commented 10 months ago

Currently master if failing on CI: https://app.circleci.com/pipelines/github/filecoin-project/filecoin-ffi/3025/workflows/6477ffa8-3057-4d33-82f5-cdc665d478e1/jobs/18154

due to:

fatal error: cgocheck > 1 mode is no longer supported at runtime. Use GOEXPERIMENT=cgocheck2 at build time instead.

runtime stack:
runtime.throw({0x629cd8?, 0xa?})
        runtime/panic.go:1077 +0x40 fp=0xffffe98f7810 sp=0xffffe98f77e0 pc=0x48c30
runtime.parsegodebug({0x4000000020?, 0x7?}, 0x0)
        runtime/runtime1.go:498 +0x240 fp=0xffffe98f78b0 sp=0xffffe98f7810 pc=0x5b7f0
runtime.parsedebugvars()
        runtime/runtime1.go:406 +0x11c fp=0xffffe98f78f0 sp=0xffffe98f78b0 pc=0x5b3fc
runtime.schedinit()
        runtime/proc.go:744 +0x15c fp=0xffffe98f7940 sp=0xffffe98f78f0 pc=0x4c62c
runtime.rt0_go()
        runtime/asm_arm64.s:86 +0xa4 fp=0xffffe98f7970 sp=0xffffe98f7940 pc=0x7cca4

Exited with code exit status 2

Note that it only fails on ARM.

It seems to be triggered by these lines:

https://github.com/filecoin-project/filecoin-ffi/blob/441fa8e61189dc32c2960c1f8d8ba56269f20366/.circleci/config.yml#L354-L357

snadrus commented 10 months ago

This error is from a Go 1.21 runtime. My fix is failing because it's running on a Go 1.17 runtime.

Your CI link avoids the Go 1.17 install step.

The proper command for Go >= 1.21 is in branch: fix431 Otherwise the line is correct for Go <= 1.20

What version of Go should be be using here? We should probably ensure it because it appears that tests are being ran with different Go versions. I don't think we require Go 1.21 yet in Lotus, so we really shouldn't be seeing the bug (yet). So the right fix will be to pin the right version of Go.

If you would like help with that, let me know which version you're building this for.

vmx commented 10 months ago

So the right fix will be to pin the right version of Go.

The Lotus team should make the call on which version of Go it makes sense to run the CI on. I agree that all tests should be run on the same Go version.

vmx commented 10 months ago

As Lotus is requiring Go 1.20 I decided to go for that in https://github.com/filecoin-project/filecoin-ffi/pull/435.

vmx commented 9 months ago

https://github.com/filecoin-project/filecoin-ffi/pull/435 fixed this issue.