Closed leongross closed 1 month ago
This has been fixed on Go tip
with the purego
build tag.
This has been fixed on Go
tip
with thepurego
build tag.
That would be a better long-term fix, yes. But the change seems fine by me if it unblocks someone right now, any reason not to merge this?
If it works it's probably fine to merge, assuming it doesn't then break stuff when we build with the purego
build tag. (But yes, let's merge for now and fix later if needed.)
Thanks for the code @leongross and for the review @dgryski and @aykevl now merging.
Great, thanks for taking care of this!
I have quite a few new cryptography functions that I need to use; what is the status of adjusting tinygo to make use purego
usable? Adding them all manually to the aliasing does not seem to be a good and reliable idea.
Could you tell me what steps need to be taken? I would we willing to help with this if needed. @dgryski @deadprogram @aykevl
@leongross Does simply adding -tags=purego
to your build command line not work? What pieces are missing? IIRC that should start working (starting with 1.23).
Since go 1.23 is not yet released, I would have to use the go1.23rc1 for that right?
What I did was
go1.23rc1
GOROOT=$HOME/sdk/go1.23rc1 tinygo build -tags=purego .
I get the following errors:
$HOME/sdk/go1.23rc1/src/bytes/bytes.go:116:18: undefined: bytealg.LastIndexByte
$HOME/sdk/go1.23rc1/src/bytes/bytes.go:125:17: undefined: bytealg.LastIndexRabinKarp
$HOME/sdk/go1.23rc1/src/bytes/bytes.go:130:17: undefined: bytealg.LastIndexByte
$HOME/sdk/go1.23rc1/src/bytes/bytes.go:1329:32: cannot use s[i:] (value of type []byte) as string value in argument to bytealg.IndexRabinKarp
$HOME/sdk/go1.23rc1/src/bytes/bytes.go:1329:39: cannot use sep (variable of type []byte) as string value in argument to bytealg.IndexRabinKarp
Using the default golang compiler on that version works fine although (go1.23rc1 build -tags=purego .
)
Tinygo is the upstream dev branch tinygo version 0.33.0-dev-e6caa3fe linux/amd64 (using go version go1.21.11 and LLVM version 18.1.2)
. I see that tinygo version states that it uses go1.21.11, but I'm not sure how to change that.
Also, the purego tag seems to be set as default build tag for a while now
Building applications with cryptographic operations still lacks a lot of support due to excessive usage of assembly in the golang standard library. This PR intends to replace them in the tinygo build process with the generic implementations.