Open baoyachi opened 1 month ago
It's difficult to determine what's going on here, but this line
error: failed to build archive: 'wasm32.o': section too large
Implies that perhaps too much code was being generated (although I'm not sure why that would be the case). Are you compiling with optimisations enabled?
It's difficult to determine what's going on here, but this line
error: failed to build archive: 'wasm32.o': section too large
Implies that perhaps too much code was being generated (although I'm not sure why that would be the case). Are you compiling with optimisations enabled?
I just use command:wasm-pack build --target bundler
This seems much more likely to be an issue with wasm-pack than chumsky, I'd recommend asking on the relevant GitHub repo instead.
Try building in release and see if the issue persists. In a project that I was working on, I found that the debug build included type information that was larger than some limitation in the wasm parser. When I built in release mode, that type information wasn't included, and so it worked. Its obviously not ideal, but at least its a workaround until a final solution is implemented.
An alternative there might be to just skip including that debug information:
[profile.dev]
debug = false
Obviously this is very non-ideal. I can't think of a good way to strip that information for specifically chumsky code though. You can declare crate-specific debug settings, but since chumsky is basically all generic code, it'll get inlined at the use site and probably won't be counted as code for chumsky-the-crate any longer.
build log:
[lib] crate-type = ["cdylib", "rlib"]
[dependencies] chumsky = "1.0.0-alpha.6"