1. 概览

  • rustup安装Rust,将rustc、cargo、rustup等安装到Cargo的bin目录;

  • Unix位置:$HOME/.cargo/bin

  • Win位置:%USERPROFILE%\.cargo\bin

  • CARGO_HOME:包含Cargo使用的缓存文件

  • RUSTUP_HOME:rustup的root文件夹,存储已安装的工具链和配置项

2. ABI Type

MSVC GNU

VS使用的native(MSVC) ABI,默认ABI

GCC toolchain使用的GNU ABI

SVC版Rust与VS生成的软件互操作

GNU版Rust与MinGW/MSYS2工具链构建的GNU软件互操作

MSVC ABI:Rust需安装VS

GNU ABI:基本使用无需依赖,建议安装带有MinGW的完整MSYS2

3. Obtain Artifact

  • Target Triple:

    • x86_64-pc-windows-gnu:64位MinGW

    • x86_64-pc-windows-msvc:64位MSVC

  • Rust Version

    • 1.81.0,1.80.0,1.79.0,1.78.0,1.77.0,1.76.0

  • Rustup Version

    • 1.27.1,1.27.0,1.26.0,1.25.0,1.24.0

4. Msvc Prerequisite

Type Component

Workload

  • Desktop Development with C++

Individual Component

  • MSVC v143 - VS 2022 C++ x64/x86(Latest)

  • Windows 11 SDK (10.0.22621.0)

Language Pack

  • English

VSBuildToolWinSdk01
VSBuildToolWinSdk02

5. Graal Optional

JAVA_HOME = D:\Install\Dev\Java\Graal

PATH = %JAVA_HOME%\bin
# 查看版本与构建使用
java --version && native-image --version

clean native:compile

gradle nativeCompile
MSVCVARS64=D:\Install\Dev\Mvs\BuildTool\VC\Auxiliary\Build\vcvars64.bat
win + r => %MSVCVARS64%

native-image HelloWorld