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

go run mage.go build failed #286

Closed
darkforest42 opened this issue Jul 31, 2024 · 5 comments · Fixed by #287
Closed

go run mage.go build failed #286

darkforest42 opened this issue Jul 31, 2024 · 5 comments · Fixed by #287

Comments

@darkforest42
Copy link

go version: 1.21.6
tinygo version: 0.32.0
OS: Apple M1

go run mage.go build failed

github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm/internal

../../../../../go/pkg/mod/github.com/tetratelabs/[email protected]/proxywasm/internal/hostcall_utils_tinygo.go:31:9: cannot use uintptr(size) (value of type uintpt
r) as int value in struct literal
../../../../../go/pkg/mod/github.com/tetratelabs/[email protected]/proxywasm/internal/hostcall_utils_tinygo.go:32:9: cannot use uintptr(size) (value of type uintpt
r) as int value in struct literal
../../../../../go/pkg/mod/github.com/tetratelabs/[email protected]/proxywasm/internal/hostcall_utils_tinygo.go:39:9: cannot use uintptr(size) (value of type uintpt
r) as int value in struct literal
../../../../../go/pkg/mod/github.com/tetratelabs/[email protected]/proxywasm/internal/hostcall_utils_tinygo.go:40:9: cannot use uintptr(size) (value of type uintpt
r) as int value in struct literal
Error: running "tinygo build -gc=custom -opt=2 -o build/mainraw.wasm -scheduler=none -target=wasi -tags='custommalloc nottinygc_envoy no_fs_access memoize_builders coraza.
rule.multiphase_evaluation'" failed with exit code 1
exit status 1

@M4tteoP
Copy link
Member

M4tteoP commented Jul 31, 2024

Hi @darkforest42, I confirm this. The repo currently requires tinygo 0.31.2. Some changes that I had half backed are needed to make 0.32.0 work, and they are not yet in main

@darkforest42
Copy link
Author

Hi @M4tteoP, i reinstall tinygo 0.31.2, but build still fail, details are as follows:

`panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1052429e0]

goroutine 87 [running]:
github.com/tinygo-org/tinygo/compiler.getPos({0x0, 0x0})
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:1402 +0x20
github.com/tinygo-org/tinygo/compiler.(*builder).createInstruction(0x1401e8dec00, {0x0, 0x0})
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:1442 +0xb20
github.com/tinygo-org/tinygo/compiler.(*builder).createFunction(0x1401e8dec00)
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:1336 +0x704
github.com/tinygo-org/tinygo/compiler.(*compilerContext).getFunction(0x1401d7243c0, 0x1401b4d36c0)
/Users/runner/work/tinygo/tinygo/compiler/symbol.go:222 +0xc08
github.com/tinygo-org/tinygo/compiler.(*compilerContext).getTypeMethodSet(0x1401d7243c0, {0x10ad52308, 0x14019928fc0})
/Users/runner/work/tinygo/tinygo/compiler/interface.go:619 +0x1d4
github.com/tinygo-org/tinygo/compiler.(*compilerContext).getTypeCode(0x1401d7243c0, {0x10ad52308, 0x14019928fc0})
/Users/runner/work/tinygo/tinygo/compiler/interface.go:417 +0x2b64
github.com/tinygo-org/tinygo/compiler.(*compilerContext).getTypeCode(0x1401d7243c0, {0x10ad521f0, 0x140000fd9d0})
/Users/runner/work/tinygo/tinygo/compiler/interface.go:291 +0x226c
github.com/tinygo-org/tinygo/compiler.(*compilerContext).getTypeCode(0x1401d7243c0, {0x10ad52268, 0x14005ab1c68})
/Users/runner/work/tinygo/tinygo/compiler/interface.go:311 +0x2128
github.com/tinygo-org/tinygo/compiler.(*builder).createMakeInterface(0x14019923680, {0x10ad55ed8?}, {0x10ad52268, 0x14005ab1c68}, 0x1401b08f008?)
/Users/runner/work/tinygo/tinygo/compiler/interface.go:80 +0x6c
github.com/tinygo-org/tinygo/compiler.(*builder).createExpr(0x14019923680, {0x10ad55ce0, 0x1400b1dafa0})
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:2209 +0x1838
github.com/tinygo-org/tinygo/compiler.(*builder).createInstruction(0x14019923680, {0x10ad56dc0, 0x1400b1dafa0})
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:1447 +0x89c
github.com/tinygo-org/tinygo/compiler.(*builder).createFunction(0x14019923680)
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:1336 +0x704
github.com/tinygo-org/tinygo/compiler.(*compilerContext).createPackage(0x1401d7243c0, {0x1400ee94ea0?}, 0x14001ff3b00)
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:852 +0x3ac
github.com/tinygo-org/tinygo/compiler.CompilePackage({0x140032c55dc?, 0x60?}, 0x140032fb2c0, 0x14001ff3b00, {0x1400005ccc8?}, 0x1092ad190?, 0x18?)
/Users/runner/work/tinygo/tinygo/compiler/compiler.go:311 +0x3a0
github.com/tinygo-org/tinygo/builder.Build.func3(0x1400be70000)
/Users/runner/work/tinygo/tinygo/builder/build.go:370 +0x18c
github.com/tinygo-org/tinygo/builder.runJob(0x1400be70000, 0x1401508b740)
/Users/runner/work/tinygo/tinygo/builder/jobs.go:222 +0x48
created by github.com/tinygo-org/tinygo/builder.runJobs in goroutine 1
/Users/runner/work/tinygo/tinygo/builder/jobs.go:123 +0x454
Error: running "tinygo build -gc=custom -opt=2 -o build/mainraw.wasm -scheduler=none -target=wasi -tags='custommalloc nottinygc_envoy no_fs_access memoize_builders coraza.rule.multiphase_evaluation'" failed with exit code 2
exit status 2
`

@M4tteoP
Copy link
Member

M4tteoP commented Jul 31, 2024

My setup is very close to yours (tinygo 0.31.2, go 1.21.9 on a M1 machine) and I'm not able to reproduce it :(.
Is it deterministic? I just found tinygo-org/tinygo#4206 and I was wondering if by any chance it could be related.

@M4tteoP
Copy link
Member

M4tteoP commented Jul 31, 2024

I pushed #287, if you want to give it a go with tinygo 0.32.0. Looks like that it is working fine in my local, CI is running

@darkforest42
Copy link
Author

I pushed #287, if you want to give it a go with tinygo 0.32.0. Looks like that it is working fine in my local, CI is running

it does work, thanks

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 a pull request may close this issue.

2 participants