diff --git a/.agents/skills/platform-builds.md b/.agents/skills/platform-builds.md index 8d638c3e..31e39dd3 100644 --- a/.agents/skills/platform-builds.md +++ b/.agents/skills/platform-builds.md @@ -30,6 +30,14 @@ Windows ARM64 support came from targeted external work. When touching platform l Windows build scripts have failed on paths from different drives and on argument escaping. Prefer explicit drive-aware shell behavior and quoted structured paths. +When upgrading Rust toolchain versions, Windows CI may fail due to CMake cache conflicts with Visual Studio generator versions. The fix requires comprehensive cleanup of CMake cache files and explicit generator specification: + +- Clean `CMakeCache.txt`, `CMakeFiles/`, `*.cmake`, and `cmake_install.cmake` in the build directory +- Set `CMAKE_GENERATOR="Visual Studio 17 2022"` environment variable before building +- Use `-ErrorAction SilentlyContinue` on PowerShell Remove-Item commands to handle missing files gracefully + +This pattern should be applied to all Windows build steps in CI workflows. + ## eLinux eLinux support exists as a platform surface. When editing package platform lists, generated plugin metadata, or Cargokit target handling, preserve eLinux entries unless intentionally removing support. diff --git a/.github/workflows/example_app.yaml b/.github/workflows/example_app.yaml index b92f1df2..fc2c7ff0 100644 --- a/.github/workflows/example_app.yaml +++ b/.github/workflows/example_app.yaml @@ -24,22 +24,22 @@ concurrency: jobs: build: - name: ${{ matrix.runner }} / ${{ matrix.target }} - runs-on: ${{ matrix.runner }}-latest + name: ${{ matrix.os }} / ${{ matrix.target }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false # Important matrix: - runner: [ubuntu, windows, macos] + os: [ubuntu-latest, windows-2022, macos-latest] target: [android, web] # On all platforms include: # Specify targets for each platform - - runner: ubuntu + - os: ubuntu-latest target: linux - - runner: windows + - os: windows-2022 target: windows - - runner: macos + - os: macos-latest target: macos - - runner: macos + - os: macos-latest target: ios steps: @@ -56,19 +56,19 @@ jobs: target ~/.pub-cache key: > - ${{ matrix.runner }}-${{ matrix.target }} + ${{ matrix.os }}-${{ matrix.target }} ${{ hashFiles('**/Cargo.toml', '**/pubspec.yaml') }} restore-keys: | - ${{ matrix.runner }}-${{ matrix.target }} - ${{ matrix.runner }} + ${{ matrix.os }}-${{ matrix.target }} + ${{ matrix.os }} - name: Setup Flutter SDK uses: subosito/flutter-action@v2 with: - flutter-version: "3.24.0" + flutter-version: "3.27.4" - name: Setup Rust toolchain - uses: dtolnay/rust-toolchain@1.88 + uses: dtolnay/rust-toolchain@1.91 with: components: rustfmt @@ -111,7 +111,15 @@ jobs: - name: Build the example app if: matrix.target == 'windows' working-directory: flutter_package/example/ - run: flutter build windows --verbose + run: | + $buildDir = "build/windows" + if (Test-Path $buildDir) { + Remove-Item "$buildDir/CMakeCache.txt" -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/*.cmake" -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/cmake_install.cmake" -Force -ErrorAction SilentlyContinue + } + flutter build windows --verbose - name: Build the example app if: matrix.target == 'macos' diff --git a/.github/workflows/test_app.yaml b/.github/workflows/test_app.yaml index a9d3982a..8a43e72c 100644 --- a/.github/workflows/test_app.yaml +++ b/.github/workflows/test_app.yaml @@ -25,22 +25,22 @@ concurrency: jobs: build: - name: ${{ matrix.runner }} / ${{ matrix.target }} - runs-on: ${{ matrix.runner }}-latest + name: ${{ matrix.os }} / ${{ matrix.target }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false # Important matrix: - runner: [ubuntu, windows, macos] + os: [ubuntu-latest, windows-2022, macos-latest] target: [android, web] # On all platforms include: # Specify targets for each platform - - runner: ubuntu + - os: ubuntu-latest target: linux - - runner: windows + - os: windows-2022 target: windows - - runner: macos + - os: macos-latest target: macos - - runner: macos + - os: macos-latest target: ios steps: @@ -57,19 +57,19 @@ jobs: target ~/.pub-cache key: > - ${{ matrix.runner }}-${{ matrix.target }} + ${{ matrix.os }}-${{ matrix.target }} ${{ hashFiles('**/Cargo.toml', '**/pubspec.yaml') }} restore-keys: | - ${{ matrix.runner }}-${{ matrix.target }} - ${{ matrix.runner }} + ${{ matrix.os }}-${{ matrix.target }} + ${{ matrix.os }} - name: Setup Flutter SDK uses: subosito/flutter-action@v2 with: - flutter-version: "3.24.0" + flutter-version: "3.27.4" - name: Setup Rust toolchain - uses: dtolnay/rust-toolchain@1.88 + uses: dtolnay/rust-toolchain@1.91 with: components: rustfmt @@ -112,7 +112,15 @@ jobs: - name: Build the example app if: matrix.target == 'windows' working-directory: test_app/ - run: flutter build windows --verbose + run: | + $buildDir = "build/windows" + if (Test-Path $buildDir) { + Remove-Item "$buildDir/CMakeCache.txt" -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/*.cmake" -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/cmake_install.cmake" -Force -ErrorAction SilentlyContinue + } + flutter build windows --verbose - name: Build the example app if: matrix.target == 'macos' diff --git a/.github/workflows/user_app.yaml b/.github/workflows/user_app.yaml index 74029183..493fea02 100644 --- a/.github/workflows/user_app.yaml +++ b/.github/workflows/user_app.yaml @@ -10,22 +10,22 @@ on: jobs: build: - name: ${{ matrix.runner }} / ${{ matrix.target }} - runs-on: ${{ matrix.runner }}-latest + name: ${{ matrix.os }} / ${{ matrix.target }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false # Important matrix: - runner: [ubuntu, windows, macos] + os: [ubuntu-latest, windows-2022, macos-latest] target: [android, web] # On all platforms include: # Specify targets for each platform - - runner: ubuntu + - os: ubuntu-latest target: linux - - runner: windows + - os: windows-2022 target: windows - - runner: macos + - os: macos-latest target: macos - - runner: macos + - os: macos-latest target: ios steps: @@ -42,11 +42,11 @@ jobs: target ~/.pub-cache key: > - ${{ matrix.runner }}-${{ matrix.target }} + ${{ matrix.os }}-${{ matrix.target }} ${{ hashFiles('**/Cargo.toml', '**/pubspec.yaml') }} restore-keys: | - ${{ matrix.runner }}-${{ matrix.target }} - ${{ matrix.runner }} + ${{ matrix.os }}-${{ matrix.target }} + ${{ matrix.os }} - name: Setup Flutter SDK uses: subosito/flutter-action@v2 @@ -97,7 +97,15 @@ jobs: - name: Build the example app if: matrix.target == 'windows' working-directory: user_app/ - run: flutter build windows --verbose + run: | + $buildDir = "build/windows" + if (Test-Path $buildDir) { + Remove-Item "$buildDir/CMakeCache.txt" -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/*.cmake" -Force -ErrorAction SilentlyContinue + Remove-Item "$buildDir/cmake_install.cmake" -Force -ErrorAction SilentlyContinue + } + flutter build windows --verbose - name: Build the example app if: matrix.target == 'macos' diff --git a/documentation/source/installing-toolchains.md b/documentation/source/installing-toolchains.md index b1dee6c6..1f63b2da 100644 --- a/documentation/source/installing-toolchains.md +++ b/documentation/source/installing-toolchains.md @@ -24,7 +24,7 @@ Each Rinf version is compatible with the toolchain versions listed below and new | Rinf Version | Flutter/Dart Version | Rust Version | | ------------ | -------------------- | ------------ | -| 8.9 | 3.24/3.5 | 1.88 | +| 8.9 | 3.27/3.6 | 1.91 | | 8.8 | N/A | N/A | | 8.7 | N/A | N/A | | 8.6 | N/A | N/A | diff --git a/rust_crate_cli/src/tool/webassembly.rs b/rust_crate_cli/src/tool/webassembly.rs index 37ea8355..449572cf 100644 --- a/rust_crate_cli/src/tool/webassembly.rs +++ b/rust_crate_cli/src/tool/webassembly.rs @@ -63,11 +63,11 @@ fn install_wasm_toolchain() -> Result<(), SetupError> { .output()? .capture_err()?; Command::new("cargo") - .args(["install", "--locked", "wasm-pack"]) + .args(["+nightly", "install", "--locked", "wasm-pack"]) .output()? .capture_err()?; Command::new("cargo") - .args(["install", "--locked", "wasm-bindgen-cli"]) + .args(["+nightly", "install", "--locked", "wasm-bindgen-cli"]) .output()? .capture_err()?; Ok(()) @@ -109,6 +109,7 @@ fn compile_wasm( "-C link-arg=--shared-memory ", "-C link-arg=--max-memory=1073741824 ", "-C link-arg=--import-memory ", + "-C link-arg=--export=__heap_base ", "-C link-arg=--export=__wasm_init_tls ", "-C link-arg=--export=__tls_size ", "-C link-arg=--export=__tls_align ",