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

[Request] Support wasm with chrono #16

Open
und3fined opened this issue Aug 8, 2024 · 10 comments
Open

[Request] Support wasm with chrono #16

und3fined opened this issue Aug 8, 2024 · 10 comments

Comments

@und3fined
Copy link

Same in title, The team can support wasm?

time::SystemTime not support in wasm, but chrono support it

@mplanchard
Copy link
Owner

Thanks for the suggestion! I'll take a look at this as soon as I get a chance. In the meantime, I'd have no issue accepting an MR

@mplanchard
Copy link
Owner

As far as I can tell SytemTime is supported in WASM. I have pushed some updates and am now testing WASM builds in CI against the wasm32-unknown-unknown and wasm32-wasi targets.

Please check e2d994a or later and see if it works for you

@erenaspire7
Copy link

Hi @mplanchard. It doesn't work for me. However, prisma has a wasm-compatible fix at prisma/prisma#17102 (comment)

@mplanchard
Copy link
Owner

@erenaspire7 doesn't work in what way? The wasm build works fine in CI for those targets.

@erenaspire7
Copy link

@mplanchard . So my use-case was inter-oping the package with typescript using wasm. It failed due to not having an equivalent for SystemTime within rust from the standard library

Prisma addressed this by using a web_time dependency

@mplanchard
Copy link
Owner

Oh, is it this runtime issue? rust-lang/rust#48564

Didn't realize the stdlib had stuff that would compile for a target but unequivocally panic at runtime

@erenaspire7
Copy link

Yeah, that's the issue. Thanks!

@mplanchard
Copy link
Owner

Great. I've got a wasm test now that shows the issue. I'll update to a different time dependency and get that pushed. Thanks for the lead!

@jkomyno
Copy link

jkomyno commented Jan 9, 2025

Hey @mplanchard, hopefully I can push a PR within the next 7 days.
I am the author of the fix in Prisma mentioned by @erenaspire7 above

@mplanchard
Copy link
Owner

Hey @mplanchard, hopefully I can push a PR within the next 7 days.
I am the author of the fix in Prisma mentioned by @erenaspire7 above

Thanks! I may have it done by then, depends on work stuff. The master branch should work now, just working on getting the github actions tests cleaned up

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

No branches or pull requests

4 participants