Skip to main content

Crate day_toolchain

Crate day_toolchain 

Source
Expand description

day-toolchain — ONE place that knows where host toolchains and SDKs live, shared by the day CLI and by crate build scripts (day-winui-sys, every day-piece-*/day-tweak-* that compiles its own native shim, and the scaffolds day new generates).

Two rules govern every lookup here (docs/environment.md):

  1. An environment variable always wins. Each function documents its override(s).
  2. No literal install paths. Default locations are derived from the platform’s own environment (%ProgramFiles%, $HOME, %LOCALAPPDATA%) — never a hardwired C:\…, so relocated installs (Windows Kits on D:, a portable SDK) work by setting one var.

Functions that are meant to be called from build scripts have _for_build_script variants that also emit the matching cargo:rerun-if-env-changed= lines, so changing an override re-runs the script instead of silently keeping stale results.

Functions§

android_sdk_dir
The Android SDK root.
cppwinrt_include
The newest Include\<version>\cppwinrt directory (the C++/WinRT projection headers), for compiling WinUI shims with cc.
cppwinrt_include_for_build_script
cppwinrt_include for build scripts: also emits the rerun-if-env-changed lines so an override change re-runs the script.
is_dir
True when dir looks like a usable directory (exists and is a dir) — small helper for callers validating overrides.
jdk21_home
A JDK 21 home for Gradle (AGP needs 21 exactly — newer JDKs break the jdk-image transform).
makensis
The makensis NSIS compiler (cross-platform: apt/brew/choco all put it on PATH).
rustup_cargo
The rustup toolchain to use for cross-std builds (mobile targets need rustup’s target std; a Homebrew/system rustc has none), as (cargo_path, bin_dir). The bin dir is prepended to PATH so the toolchain’s own rustc — not one earlier on PATH — is what cargo invokes.
windows_kit_tool
A Windows-Kits bin tool (signtool.exe, makeappx.exe, …): newest SDK version, host arch.
windows_kits_roots
Candidate Windows Kits\10-style roots, best first.