The DotSlash Windows Shim aims to workaround the fact that Windows does not support shebangs and depends on a file's extension to determine if it is executable.
Place the DotSlash Windows Shim executable next to a DotSlash file with the
same file name as the DotSlash file plus the .exe extension. For example, if
the DotSlash file is named node, copy the shim executable as node.exe into
the same directory as node. When node.exe is run, it will run dotslash
with the sibiling DotSlash file, and forward all arguments and IO streams.
The DotSlash Windows Shim does this:
- Gets it own executable name (e.g.
C:\dir\node.exe) and removes the extention (e.g.C:\dir\node). - It takes this path, plus whatever arguments were passed, and runs
dotslash C:\dir\node arg1 arg2 .... - Waits to exit and forwards the exit code.
DotSlash Windows Shim builds without a standard library and only uses Windows APIs. Release binaries are around ~5KB.
A nightly toolchain is required:
cargo +nightly build --releaseAlternatively, though not recommended:
RUSTC_BOOTSTRAP=1 cargo build --releaseIt may be useful to have the standard library (e.g. dbg!) when debugging.
Build with --no-default-features (avoids the default no_std feature) to have
access to the standard library.
cargo build --no-default-features