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

[feature request] Add a user-facing compiler/linker switch to add a node-invoking hashbang #23041

Open
vadimkantorov opened this issue Nov 30, 2024 · 0 comments

Comments

@vadimkantorov
Copy link

vadimkantorov commented Nov 30, 2024

Some build scripts will try to immediately execute freshly-built binaries, bypassing this can be nasty and sometimes it's easier to have the emscripten-produced binaries have the node-invoking hashbang and have executable bit via chmod +x. At least surfacing this as a compiler option would be useful (and also may be useful to ask emscripten to produce both the node-invokable JS and sidecar *.wasm file).

It also appears that now hashbang is also accepted in JavaScript as comment: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#hashbang_comments, so in theory might be okay to always produce this hashbang and at least it should not prevent these hashbang-prefixed files to be consummable by conventional JavaScript engines

Originally discussed in:

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

1 participant