Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions website/docs/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,22 @@ of this documentation.

### DotSlash Windows Shim

**This is the preferred method.** The _DotSlash Windows Shim_ is a tiny `.exe`
executable that is placed next to the DotSlash file that performs the same
function as the [batch script](#sibling-batch-script) above, but is a native
executable rather than a batch script. This is the _ideal_ method that allows
for easy execution without any of the drawbacks of batch scripts. But this
method requires compiling a small executable and keeping it next to the DotSlash
file.
**This is the preferred method.** The _DotSlash Windows Shim_ is a tiny 4KB
`.exe` executable that is placed next to the DotSlash file that performs the
same function as the [batch script](#sibling-batch-script) above, but is a
native executable rather than a batch script. This is the _ideal_ method that
allows for easy execution without any of the drawbacks of batch scripts. But
this method requires compiling a small executable and keeping it next to the
DotSlash file.

The _DotSlash Windows Shim_ is available under the
[`windows_shim`](https://github.com/facebook/dotslash/tree/main/windows_shim)
folder in the
[DotSlash GitHub repository](https://github.com/facebook/dotslash).

A pre-built version can also be downloaded from there:
[`dotslash_windows_shim-x86_64.exe`](https://github.com/facebook/dotslash/raw/main/windows_shim/dotslash_windows_shim-x86_64.exe)

## `MAX_PATH` limits

DotSlash stores fetched artifacts in a cache directory and they're executed from
Expand Down
83 changes: 83 additions & 0 deletions windows_shim/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions windows_shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ name = "dotslash_windows_shim"
path = "dotslash_windows_shim.rs"
test = false

[dependencies]
cfg-if = "1.0.1"
windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_Globalization", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console", "Win32_System_Environment", "Win32_System_IO", "Win32_System_LibraryLoader", "Win32_System_Memory", "Win32_System_Threading", "Win32_UI_Shell"] }

[features]
default = ["no_std"]
no_std = []

[profile.release]
opt-level = "z"
lto = true
Expand Down
28 changes: 26 additions & 2 deletions windows_shim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,29 @@ The _DotSlash Windows Shim_ does this:

## Binary size

The current "reference implementation" is rather large. A no_std version that
uses only Windows APIs will be added soon. Stay tuned!
_DotSlash Windows Shim_ builds without a standard library and only uses Windows
APIs. Release binaries are around ~5KB.

## Release

A nightly toolchain is required:

```shell
cargo +nightly build --release
```

Alternatively, though not recommended:

```shell
RUSTC_BOOTSTRAP=1 cargo build --release
```

## Debugging

It 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.

```shell
cargo build --no-default-features
```
Binary file not shown.
Binary file added windows_shim/dotslash_windows_shim-x86_64.exe
Binary file not shown.
Loading
Loading