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

feat: Compatible compilation to other WebAssembly environments #99

Closed
wants to merge 1 commit into from

Conversation

cbbfcd
Copy link

@cbbfcd cbbfcd commented Aug 26, 2024

Troubleshooting a problem where WebAssembly compiles into a browser or Emscripten environment with an error that the is_valid implementation is not found.

Troubleshooting a problem where `WebAssembly` compiles into a browser or `Emscripten` environment with an error that the `is_valid` implementation is not found.
@Xaeroxe
Copy link
Collaborator

Xaeroxe commented Aug 26, 2024

I'm curious what you expect which to do here. wasi presents a filesystem, the target you've specified here, as far as I'm aware, doesn't have a filesystem. I could merge this and it would probably build, but then I suspect you'd have a runtime failure.

@cbbfcd
Copy link
Author

cbbfcd commented Aug 26, 2024

Thanks for the reply.
Because of the indirect dependency on which, which then needs to be compiled into WebAssembly to run on the browser side, there is really no filesystem, but it is guaranteed to compile without reporting errors.

@Xaeroxe
Copy link
Collaborator

Xaeroxe commented Aug 26, 2024

Okay, perhaps it would be better to make which an optional feature in your dependency tree. I'm not sure how it enters your dependency graph, but can you go to the dependency that brings which in and instead make which optional?

@cbbfcd
Copy link
Author

cbbfcd commented Aug 26, 2024

I've tried, but the reference hierarchy is a bit deep. Now, I also feel that this PR is not very reasonable, although adding this code doesn't seem to affect which.

@Xaeroxe
Copy link
Collaborator

Xaeroxe commented Aug 26, 2024

The thing that makes me a bit uncomfortable with it is that by adding this code we're implying that which could do something worthwhile in that environment, when that's just not true. I don't particularly want to knowingly ship broken code. I think a compile failure is preferable to an unexpected runtime failure. Please either target wasm32-wasi, or find a way to remove which from your dependency graph.

@Xaeroxe Xaeroxe closed this Aug 26, 2024
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

Successfully merging this pull request may close these issues.

2 participants