Is it possible to make export_bindings
work for WASI targets?
#396
Answered
by
NyxCode
josephwynn-sc
asked this question in
Q&A
-
One of our backends is built on Fastly's Rust SDK, which is only built for WASI targets. I cannot run
I also cannot run
Am I missing an obvious solution here? Is there any way ts-rs could get around WASI's lack of filesystem implementation? |
Beta Was this translation helpful? Give feedback.
Answered by
NyxCode
Apr 3, 2025
Replies: 1 comment 3 replies
-
Interesting issue! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, that's particularly annoying. We need some way to actually run tests locally, with access to the filesystem. No way around that.
Splitting your crate into two (
types
andapi
) should work, if that's acceptable to you.Besides that, maybe there is some way to get filesystem access when running the thing with the fastly CLI. I have never used it, so I have no idea why it doesn't work by default and what you'd need to do to make it work.
Also, you could find some other way to get the bindings out of the running binary - maybe by writing them to stdout by calling
TS::export_to_string
on all types yourself. For this, we might be able to offer a better API in the future - e.g by writing to s…