Skip to content

Cargo should use Node.js to launch targets built for asmjs #3626

Description

@koute

Currently when doing cargo run --target=asmjs-unknown-emscripten or cargo test --target=asmjs-unknown-emscripten you get the following error:

error: could not execute process `target/asmjs-unknown-emscripten/debug/foobar.js` (never executed)

While the asmjs backend is mostly meant to be used on the Web it would be quite useful to have the targets compiled for the asmjs to be launched through Node.js, if nothing else for running tests.

There is, of course, a partial workaround for Linux where you could technically do this:

echo ":js:E::js::/usr/bin/node:" | sudo tee /proc/sys/fs/binfmt_misc/register

and the OS would take care of launching the files through Node.js; this, however, doesn't work currently as Cargo doesn't set the executable bits on the .js files it produces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions