Skip to content

Upgrade Rust to >= 1.56.0 #277

@webmaster128

Description

@webmaster128

When upgrading Rust to 1.56.0 or 1.57.0 in the builder images, we get linkage errors when trying to link the static library (.a) to a Go project (go build and go test) on Alpine Linux. The error message indicates problems regarding position independent code.

cp libwasmvm/target/release/libwasmvm.a api/libwasmvm_muslc.a
make update-bindings
# After we build libwasmvm, we have to copy the generated bindings for Go code to use.
# We cannot use symlinks as those are not reliably resolved by `go get` (https://github.com/CosmWasm/wasmvm/pull/235).
cp libwasmvm/bindings.h api
# try running go tests using this lib with muslc
docker run --rm -u 501:20 -v [...]/wasmvm:/mnt/testrun -w /mnt/testrun cosmwasm/go-ext-builder:0008-alpine go build -tags muslc .
go: downloading github.com/stretchr/testify v1.7.0
go: downloading github.com/tendermint/tm-db v0.6.4
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading github.com/google/btree v1.0.0
go: downloading github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
go: downloading github.com/golang/snappy v0.0.1
docker run --rm -u 501:20 -v [...]/wasmvm:/mnt/testrun -w /mnt/testrun cosmwasm/go-ext-builder:0008-alpine go test -tags muslc ./api ./types
go: downloading github.com/stretchr/testify v1.7.0
go: downloading github.com/tendermint/tm-db v0.6.4
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
go: downloading github.com/google/btree v1.0.0
go: downloading github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
go: downloading github.com/golang/snappy v0.0.1
SIGABRT: abort
PC=0xb1a6fc m=11 sigcode=18446744073709551610

goroutine 0 [idle]:
runtime: unknown pc 0xb1a6fc
stack: frame={sp:0x7f1120bad3a8, fp:0x0} stack=[0x7f1120bb0cd0,0x7f1120bd08d0)

runtime: unknown pc 0xb1a6fc
stack: frame={sp:0x7f1120bad3a8, fp:0x0} stack=[0x7f1120bb0cd0,0x7f1120bd08d0)


goroutine 531 [syscall]:
runtime.cgocall(0x75df30, 0xc0000b1748)
        /usr/local/go/src/runtime/cgocall.go:156 +0x5c fp=0xc0000b16b0 sp=0xc0000b1678 pc=0x55f7bc
github.com/CosmWasm/wasmvm/api._C2func_execute(0x2b085a0, {0x0, 0xc00001d840, 0x20}, {0x0, 0xc000016d20, 0x6b}, {0x0, 0xc0004f6240, 0x3b}, ...)
        _cgo_gotypes.go:287 +0x85 fp=0xc0000b1748 sp=0xc0000b16b0 pc=0x7519c5
github.com/CosmWasm/wasmvm/api.Execute.func1({0xc0002fee40}, {0x0, 0xc00001d840, 0x6c3289}, {0x0, 0xc000016d20, 0x5690b4}, {0x0, 0xc0004f6240, 0x3b}, ...)
        /mnt/testrun/api/lib.go:209 +0x247 fp=0xc0000b18d8 sp=0xc0000b1748 pc=0x758a47
github.com/CosmWasm/wasmvm/api.Execute({0x24}, {0xc00001d840, 0x0, 0xe7dd0c}, {0xc000016d20, 0x2f4, 0xc000165498}, {0xc0004f6240, 0x3b, 0x40}, ...)
        /mnt/testrun/api/lib.go:209 +0x6fa fp=0xc0000b1bd8 sp=0xc0000b18d8 pc=0x75849a
github.com/CosmWasm/wasmvm/api.TestExecuteCpuLoop(0xc000289ba0)
        /mnt/testrun/api/lib_test.go:427 +0x9c5 fp=0xc0000b1f70 sp=0xc0000b1bd8 pc=0x749445
testing.tRunner(0xc000289ba0, 0xd81990)
        /usr/local/go/src/testing/testing.go:1259 +0x102 fp=0xc0000b1fc0 sp=0xc0000b1f70 pc=0x638602
testing.(*T).Run·dwrap·21()
        /usr/local/go/src/testing/testing.go:1306 +0x2a fp=0xc0000b1fe0 sp=0xc0000b1fc0 pc=0x63930a
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0000b1fe8 sp=0xc0000b1fe0 pc=0x5c34a1
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:1306 +0x35a

goroutine 1 [chan receive]:
testing.(*T).Run(0xc000083ba0, {0xd6f7f6, 0x5c5c33}, 0xd81990)
        /usr/local/go/src/testing/testing.go:1307 +0x375
testing.runTests.func1(0xc000083ba0)
        /usr/local/go/src/testing/testing.go:1598 +0x6e
testing.tRunner(0xc000083ba0, 0xc000119d18)
        /usr/local/go/src/testing/testing.go:1259 +0x102
testing.runTests(0xc0000d8100, {0x10ebae0, 0x1c, 0x1c}, {0x5da22d, 0xd6e3b0, 0x1120180})
        /usr/local/go/src/testing/testing.go:1596 +0x43f
testing.(*M).Run(0xc0000d8100)
        /usr/local/go/src/testing/testing.go:1504 +0x51d
main.main()
        _testmain.go:97 +0x14b

rax    0x0
rbx    0x0
rcx    0xb1a6fc
rdx    0x0
rdi    0x2
rsi    0x7f1120bad3b0
rbp    0x7f1120bad3b0
rsp    0x7f1120bad3a8
r8     0x0
r9     0x7f114802cbe7
r10    0x8
r11    0x246
r12    0x7f1120bad900
r13    0x7f1120bad4a0
r14    0x901870
r15    0x7f1120bcf520
rip    0xb1a6fc
rflags 0x246
cs     0x33
fs     0x0
gs     0x0
FAIL    github.com/CosmWasm/wasmvm/api  1.578s
ok      github.com/CosmWasm/wasmvm/types        0.010s
FAIL
make: *** [release-build-alpine] Error 1

I don't understand the problem. It might be caused by the LLVM 13 upgrade that is part of Rust 1.56. At least I did not find anything else.

Using Rust 1.55.0 for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions