diff --git a/CHANGELOG.md b/CHANGELOG.md index ede8d4b..ad56828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -419,6 +419,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial project scaffold from auto-gen-py-project +[0.15.2]: https://github.com/axcel-blade/DevKit/releases/tag/v0.15.2 [0.15.1]: https://github.com/axcel-blade/DevKit/releases/tag/v0.15.1 [0.15.0]: https://github.com/axcel-blade/DevKit/releases/tag/v0.15.0 [0.14.0]: https://github.com/axcel-blade/DevKit/releases/tag/v0.14.0 diff --git a/Cargo.lock b/Cargo.lock index 22bc2a6..5cc6bbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -344,7 +344,7 @@ dependencies = [ [[package]] name = "devkit" -version = "0.15.1" +version = "0.15.2" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index cdd5e66..7f21a9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "devkit" -version = "0.15.1" +version = "0.15.2" edition = "2021" description = "DevKit application — install developer SDKs and configure environment variables" license = "MIT" diff --git a/README.md b/README.md index 43ce3cb..47da5c8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DevKit -[![Version](https://img.shields.io/badge/version-0.15.1-blue.svg)](CHANGELOG.md) +[![Version](https://img.shields.io/badge/version-0.15.2-blue.svg)](CHANGELOG.md) [![CI](https://github.com/axcel-blade/DevKit/actions/workflows/ci.yml/badge.svg)](https://github.com/axcel-blade/DevKit/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.md) [![Rust](https://img.shields.io/badge/rust-2021_edition-orange.svg?logo=rust)](https://www.rust-lang.org/) @@ -31,7 +31,7 @@ Checking for available versions ... DevKit OS: Windows -Version: 0.15.1 +Version: 0.15.2 # ID NAME STATUS INSTALLED AVAILABLE -------------------------------------------------------------------------------------------------------- 1 anaconda Anaconda not_installed - 2026.07-1 diff --git a/SUPPORT.md b/SUPPORT.md index 6531a27..af3408b 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -18,7 +18,7 @@ ## What to include in a bug report -- DevKit version (`cargo run --release -- --version`) — current is **0.15.1** +- DevKit version (`cargo run --release -- --version`) — current is **0.15.2** - OS and architecture - Command you ran - Full error output diff --git a/devkit.bat b/devkit.bat index c6afd02..09360dd 100644 --- a/devkit.bat +++ b/devkit.bat @@ -5,9 +5,15 @@ REM 1. Use Rust from the machine `dev` folder (`C:\dev\rust`, or DEVKIT_HOME\rus REM If cargo is missing there, require an internet connection and install REM rustup stable into that folder (same rustup-init flags as the rust REM plugin: -y --no-modify-path). -REM 2. Rebuild the release binary (a no-op when it is already up to date), so +REM 2. Make sure the MSVC linker (link.exe from Visual Studio Build Tools with +REM the "Desktop development with C++" workload) is present. The msvc Rust +REM toolchain cannot link anything without it, and several dependencies +REM (ring, zstd-sys, lzma-sys, bzip2-sys) also need its C compiler. When +REM missing, install the Build Tools through winget, or through Microsoft's +REM vs_BuildTools.exe bootstrapper when winget is unavailable. +REM 3. Rebuild the release binary (a no-op when it is already up to date), so REM a stale binary from an older checkout never hides new features. -REM 3. Run it. With no arguments (e.g. double-clicking this file) the +REM 4. Run it. With no arguments (e.g. double-clicking this file) the REM interactive plugin menu is shown. setlocal EnableDelayedExpansion @@ -76,14 +82,20 @@ if not exist "%CARGO_EXE%" ( echo Rust installed at %DEVROOT%\rust. ) -REM Step 2: always run cargo build. Cargo only recompiles when sources +set "BUILD_LOG=%TEMP%\devkit-build.log" +if exist "%BUILD_LOG%" del /f /q "%BUILD_LOG%" >nul 2>&1 + +REM Step 2: the msvc toolchain needs link.exe from the Visual C++ Build Tools. +call :ensure_msvc +if errorlevel 1 goto :build_failed + +REM Step 3: always run cargo build. Cargo only recompiles when sources REM changed, so this is fast when up to date, and it guarantees the binary REM matches this checkout (an old binary may predate the plugin menu). REM REM Windows cannot delete a running executable (Access denied, os error 5). REM A previous DevKit window keeps target\release\devkit.exe locked. Rename REM that image aside — a running exe can be renamed — then link a new one. -set "BUILD_LOG=%TEMP%\devkit-build.log" del /f /q "%ROOT%target\release\devkit-*.old" >nul 2>&1 call :cargo_build if not errorlevel 1 goto :run @@ -106,7 +118,7 @@ del /f /q "%ROOT%target\release\devkit-*.old" >nul 2>&1 goto :run :build_failed -type "%BUILD_LOG%" +if exist "%BUILD_LOG%" type "%BUILD_LOG%" if not exist "%BIN%" ( echo Build failed. goto :fail @@ -114,7 +126,7 @@ if not exist "%BIN%" ( echo Warning: build failed, running the previously built binary. :run -REM Step 3: no arguments means the user just launched DevKit (e.g. by +REM Step 4: no arguments means the user just launched DevKit (e.g. by REM double-clicking), so open the interactive menu explicitly. if "%~1"=="" ( "%BIN%" menu @@ -123,6 +135,59 @@ if "%~1"=="" ( ) exit /b %ERRORLEVEL% +REM Succeeds when the Visual C++ toolset (and so link.exe) is installed. +REM vswhere ships with every Visual Studio / Build Tools installer and is how +REM rustc itself locates link.exe, so a VS install that lacks the C++ tools +REM component counts as missing. A link.exe already on PATH (e.g. inside a +REM Developer Command Prompt) is accepted too. +:has_msvc +set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set "VSPATH=" +if exist "%VSWHERE%" ( + for /f "usebackq delims=" %%I in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSPATH=%%I" +) +if defined VSPATH exit /b 0 +where link.exe >nul 2>&1 +exit /b %ERRORLEVEL% + +REM Installs Visual Studio Build Tools with the VC++ workload when missing. +REM The installer asks for administrator rights (UAC) and takes a few minutes. +:ensure_msvc +call :has_msvc +if not errorlevel 1 exit /b 0 + +echo The Microsoft C++ linker ^(link.exe^) was not found. +echo Rust's msvc toolchain needs Visual Studio Build Tools with the C++ workload. +echo Installing Visual Studio Build Tools ^(several minutes, asks for admin rights^)... +set "VS_ARGS=--quiet --wait --norestart --nocache --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" + +where winget >nul 2>&1 +if not errorlevel 1 ( + winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --accept-package-agreements --accept-source-agreements --override "!VS_ARGS!" +) else ( + REM No winget: fall back to Microsoft's Build Tools bootstrapper. + mkdir "%TEMP%\devkit" >nul 2>nul + set "VS_BOOT=%TEMP%\devkit\vs_BuildTools.exe" + powershell -NoProfile -NonInteractive -Command ^ + "Invoke-WebRequest -UseBasicParsing -Uri 'https://aka.ms/vs/17/release/vs_BuildTools.exe' -OutFile '!VS_BOOT!'" + if exist "!VS_BOOT!" ( + "!VS_BOOT!" !VS_ARGS! + del /f /q "!VS_BOOT!" >nul 2>nul + ) else ( + echo Failed to download the Visual Studio Build Tools installer. + ) +) + +call :has_msvc +if not errorlevel 1 ( + echo Visual Studio Build Tools installed. + exit /b 0 +) +echo Error: the C++ Build Tools are still missing. +echo Install "Build Tools for Visual Studio" from https://visualstudio.microsoft.com/visual-cpp-build-tools/ +echo with the "Desktop development with C++" workload, then run DevKit again. +exit /b 1 + :cargo_build "%CARGO_EXE%" build --release --quiet --manifest-path "%ROOT%Cargo.toml" > "%BUILD_LOG%" 2>&1 exit /b %ERRORLEVEL% diff --git a/docs/architecture.md b/docs/architecture.md index 30fd03b..e351afa 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Architecture -DevKit **0.15.1** is a CLI application with a plugin pipeline. +DevKit **0.15.2** is a CLI application with a plugin pipeline. ```text target/release/devkit (binary) / devkit.bat / devkit.sh @@ -66,7 +66,7 @@ Checking for available versions ... DevKit OS: Windows -Version: 0.15.1 +Version: 0.15.2 # ID NAME STATUS INSTALLED AVAILABLE -------------------------------------------------------------------------------------------------------- 1 anaconda Anaconda not_installed - 2026.07-1 diff --git a/docs/getting-started.md b/docs/getting-started.md index fb6896e..b5166a9 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -11,6 +11,10 @@ `devkit.sh` install rustup stable there when `cargo` is missing. Running `cargo run` yourself still needs a toolchain on PATH (the one in `dev/rust` works if you export `CARGO_HOME` / `RUSTUP_HOME` first). +- Windows only: Visual Studio Build Tools with the "Desktop development with + C++" workload, which provides the MSVC linker (`link.exe`) and C compiler + the msvc Rust toolchain needs. `devkit.bat` installs them (winget, or the + `vs_BuildTools.exe` bootstrapper; asks for admin rights) when missing. - On Linux / WSL / macOS, a system C linker (`cc`). `devkit.sh` and the Makefile install the distro toolchain (`build-essential`, `base-devel`, ...) when it is missing. @@ -65,7 +69,7 @@ Checking for available versions ... DevKit OS: Windows -Version: 0.15.1 +Version: 0.15.2 # ID NAME STATUS INSTALLED AVAILABLE -------------------------------------------------------------------------------------------------------- 1 anaconda Anaconda not_installed - 2026.07-1 diff --git a/docs/index.md b/docs/index.md index 877431d..a27dd7c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # Documentation -DevKit **0.15.1** documentation index. +DevKit **0.15.2** documentation index. | Page | Description | |------|-------------| diff --git a/docs/plugins.md b/docs/plugins.md index b0dd5b4..b7a1db2 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -1,6 +1,6 @@ # Plugins -DevKit **0.15.1** ships these built-in plugins. The OS column is where the menu lists the plugin and where `devkit install` accepts it. +DevKit **0.15.2** ships these built-in plugins. The OS column is where the menu lists the plugin and where `devkit install` accepts it. | ID | OS | Notes | |----|----|-------| @@ -107,7 +107,7 @@ Checking for available versions ... DevKit OS: Windows -Version: 0.15.1 +Version: 0.15.2 # ID NAME STATUS INSTALLED AVAILABLE -------------------------------------------------------------------------------------------------------- 1 anaconda Anaconda not_installed - 2026.07-1