Skip to main content

Crate day_toolchain

Crate day_toolchain 

Source
Expand description

day-toolchain is the one place that knows where host toolchains and SDKs live, shared by the day CLI and by crate build scripts (day-toolkit-xaml-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.

Modules§

winappsdk
The Windows App SDK (WinUI 3) a windows-winui build compiles against. The Windows App SDK (WinUI 3) inputs a windows-winui build compiles against: the NuGet packages’ headers and runtime DLLs, and C++/WinRT projection headers generated from their metadata (docs/winui.md).

Enums§

WasmCc
How a web-dom build gets the C compiler for its cc-built dependencies (day-sqlite-worker’s bundled SQLite), resolved by wasm_cc.

Functions§

adb_bin
The adb this machine should use: the SDK’s own copy first, then whatever is on PATH.
android_sdk_dir
The Android SDK root.
android_sdkmanager
The sdkmanager of the SDK’s command-line tools, if they are installed. Android Studio installs them into the SDK (SDK Tools ▸ Android SDK Command-line Tools), not onto PATH.
android_studio_homes
Every Android Studio installation this machine has, most likely first.
android_studio_jbr
The JDK Android Studio bundles (its JetBrains Runtime), from the first installation that has one. It is the JDK Studio itself runs Gradle with, so the Android build is known to work on it, whatever other Java the machine has.
android_studio_sdk_setting
The SDK location Android Studio’s own settings record (Settings ▸ Languages & Frameworks ▸ Android SDK), from the newest Studio configuration directory that has one: its options/android.sdk.path.xml, whose path may start with Studio’s $USER_HOME$ macro.
cppwinrt_include
The newest Include\<version>\cppwinrt directory (the C++/WinRT projection headers), for compiling XAML 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.
emits_wasm32
Whether the clang-style driver at cc can emit wasm32 objects (--print-targets lists a wasm32 row). Apple’s Xcode clang is the notable no.
is_dir
True when dir looks like a usable directory (exists and is a dir); a small helper for callers validating overrides.
jdk_home
A JDK home for the Gradle/AGP build. AGP 9’s minimum is JDK 17, and Gradle must support the exact version. Gradle 9.6 runs on 17…26 (verified: the day scaffold builds on 17, 21 and 26 alike, so the old “21 exactly / 22+ breaks the jdk-image transform” restriction was an AGP-8-era carryover and no longer holds).
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 rustc, not one earlier on PATH, is what cargo invokes.
wasm_cc
The C compiler a web-dom build’s cc-built dependencies will use for wasm32-unknown-unknown.
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.