CI and releases on Windows; README

- CI runs the lint gate and the tests on windows-2025 beside Ubuntu, on
  the same pinned toolchain.
- A tag also publishes disktree-<version>-x86_64-windows.zip, built after
  the Linux job, which checks the tag and creates the release. The C
  runtime is linked in, so it runs without the Visual C++
  redistributable.
- README says how to install on Windows and what differs there; AGENTS
  points at windows.rs and says how to run the gate without make.
This commit is contained in:
Oleg Shevchuk
2026-09-25 15:09:27 +05:00
parent 5aa98e3818
commit 82d73fbcf8
4 changed files with 119 additions and 1 deletions
+24
View File
@@ -43,3 +43,27 @@ jobs:
- name: Test
run: cargo xtask test
windows:
name: Lint and test (Windows)
runs-on: windows-2025
steps:
# Check out with the repository's own line endings, as on Linux.
- run: git config --global core.autocrlf false
- uses: actions/checkout@v5
# Pinned with the Linux job, for the same reason. GPUI needs nothing
# beyond the Windows SDK the runner already has.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Lint
run: cargo xtask lint
- name: Test
run: cargo xtask test
+53
View File
@@ -23,6 +23,9 @@ jobs:
# The oldest supported runner: its glibc is what the binary needs at
# least, so building here runs on the most systems.
runs-on: ubuntu-22.04
outputs:
tag: ${{ steps.version.outputs.tag }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v5
with:
@@ -86,3 +89,53 @@ jobs:
gh release create "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" \
--title "disktree ${TAG#v}" --generate-notes
fi
windows:
name: Build and publish (Windows)
# After the Linux job, which checks the tag and creates the release.
needs: release
runs-on: windows-2025
env:
# The C runtime linked in, so disktree.exe also runs where the Visual
# C++ runtime was never installed. For the tests too, so both steps
# share one build.
RUSTFLAGS: -C target-feature=+crt-static
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v5
with:
ref: ${{ inputs.tag || github.ref }}
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo xtask test
- name: Build
run: cargo build --release --locked -p disktree-app
- name: Package
id: package
shell: pwsh
run: |
$name = "disktree-${{ needs.release.outputs.version }}-x86_64-windows"
New-Item -ItemType Directory -Force "dist/$name" | Out-Null
Copy-Item target/release/disktree.exe, README.md, LICENSE "dist/$name/"
Compress-Archive -Path "dist/$name" -DestinationPath "dist/$name.zip"
$hash = (Get-FileHash "dist/$name.zip" -Algorithm SHA256).Hash.ToLower()
# The format `sha256sum -c` reads, with a Unix line ending.
[IO.File]::WriteAllText("dist/$name.zip.sha256", "$hash $name.zip`n")
"archive=dist/$name.zip" >> $env:GITHUB_OUTPUT
- name: Publish
shell: bash
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ needs.release.outputs.tag }}
ARCHIVE: ${{ steps.package.outputs.archive }}
run: gh release upload "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" --clobber
+5 -1
View File
@@ -32,6 +32,8 @@ entry's `Categories` to a single main category plus additional ones, or
`cargo xtask lint` is the gate. It must be green before anything is called
done, and it must not fix anything: a red local run is the same signal CI gives.
On Windows, where there is no make, run `cargo xtask lint`, `cargo xtask test`
and `cargo build --release` directly; CI runs the gate on both systems.
## House rules
@@ -54,7 +56,8 @@ done, and it must not fix anything: a red local run is the same signal CI gives.
## Invariants
1. **Sizes come from `st_blocks * 512` unless apparent size was asked for.**
That is the number that comes back when a file is deleted.
That is the number that comes back when a file is deleted. On Windows it
is the allocation the directory listing reports; see `windows.rs`.
2. **`own_bytes`/`own_files` are derived, never tracked.** `tree::aggregate`
computes the totals from the children. Hardlink de-duplication rewrites a
leaf's weight and re-aggregates; anything that patches `bytes` directly will
@@ -89,6 +92,7 @@ done, and it must not fix anything: a red local run is the same signal CI gives.
| tile geometry, nesting, the merged tail | `crates/disktree-core/src/treemap.rs` |
| anything that deletes, or refuses to | `crates/disktree-core/src/removal.rs` |
| free space and projections | `crates/disktree-core/src/space.rs` |
| what Windows lists, measures and compares differently | `crates/disktree-core/src/windows.rs` — the only `unsafe` |
| a key, a screen transition, a mark | `crates/disktree-app/src/state.rs` |
| spacing, type and size | `crates/disktree-app/src/ui.rs` — tokens only, no `px` in layout |
| the mosaic's painting or labels | `crates/disktree-app/src/treemap_view.rs` |
+37
View File
@@ -43,6 +43,18 @@ removes exactly what was installed.
You need Rust 1.97 or newer and a Wayland or X11 session with a GPU that GPUI
can drive (Vulkan).
On Windows 10 or 11, download `disktree-*-x86_64-windows.zip` from the same
release, unpack it anywhere and run `disktree.exe`. Or build it with the MSVC
toolchain (Visual Studio Build Tools, C++ workload):
```powershell
git clone https://github.com/tobi/disktree
cd disktree
cargo build --release # target\release\disktree.exe
```
See [On Windows](#on-windows) for what differs there.
## Use
```sh
@@ -184,6 +196,31 @@ twice. `-X` crosses into everything.
Without root, some system directories cannot be read; they are counted as
unreadable in the top bar rather than guessed at.
## On Windows
The same program, with Windows' answers to the questions above:
- **Disk usage** is the allocation NTFS reports for each file: whole
clusters, less for a compressed or sparse file, nothing for one small
enough to live in its file record. It arrives with the directory listing
itself (`FileIdExtdDirectoryInfo`), so it costs no more than the walk.
Hardlinks count once on NTFS.
- **The whole disk** is the drive your profile is on, usually `C:\`. A
folder another volume is mounted on is a link, like a junction, and is
not entered, so a scan stays on one volume; `-l` follows links, and with
them mounted folders.
- **Move to trash** is the Recycle Bin, through the shell, which asks
before destroying anything it cannot recycle.
- **Refused besides the rules below:** Windows, Program Files and
ProgramData, what Windows keeps at the top of its drive (System Volume
Information, Recovery, Boot), and any folder holding your profile, such as
`C:\Users`. Names compare without regard to case, as Windows compares
them.
- **Hidden** still means a name starting with a dot; the hidden attribute is
not consulted, so `-H` does not drop `AppData`.
- **The theme** is gpui-omarchy's default, since there is no Omarchy theme
to follow.
## What it refuses to do
The removal rules live in `crates/disktree-core/src/removal.rs`, and each one is