Request: support bundling
jakajancar opened this issue · 2 comments
Unless I’m missing something, only single file transforms are supported now.
I've just implemented the build
API in the latest version, however on my machine it seems to crash with a bad pointer on stack frame panic from Go. The transform
API appears to work fine with millions of concurrent calls, so not sure why it's not working for build
, but will take a further look later on.
Feel free to test it out and see how it goes on your end. If you get different results I'd be interested to see them.
Update: got it to work now. Turns out Rust provides 0x1 as the pointer for empty allocations like strings and vectors (rust-lang/rust#39625). When passed to Go, it panics because 0x1 is not a valid pointer.
This was a frustrating one to solve, as this was not made clear in the Rust documentation and Cgo is a bit unsafe and raw as well, so I was focused on the Go end for a long time.