From 23cc28860a625e11f40b7cde0141b3f1ca2eafab Mon Sep 17 00:00:00 2001 From: Delton Ding Date: Wed, 30 Sep 2026 22:41:16 +0800 Subject: [PATCH 1/4] feat!: remove native Windows ARM64 support Remove Windows ARM64 from CI, bundling, packaging, and the Godot extension manifest. Preserve Windows x64, Linux x64/ARM64, and macOS universal support. BREAKING CHANGE: Native Windows ARM64 builds and exports are no longer supported. This removal may require a major release. Related to #238. --- .github/workflows/build.yml | 3 -- .github/workflows/test.yml | 10 ----- CONTRIBUTING.md | 12 ++---- README.md | 8 ++++ addons/godot_cef/godot_cef.gdextension | 23 ------------ docs/api/compatibility-matrix.md | 11 ++++-- docs/api/vulkan-support.md | 2 - docs/zh_CN/api/compatibility-matrix.md | 9 ++++- docs/zh_CN/api/vulkan-support.md | 2 - xtask/src/bundle_windows.rs | 44 ++++++++++++++++------ xtask/src/pack.rs | 52 ++++++++++++++++++++++++++ xtask/src/platform.rs | 9 +---- 12 files changed, 112 insertions(+), 73 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b5f01b6..745de7ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,9 +120,6 @@ jobs: - target: x86_64-pc-windows-msvc cache_key: windows-x64 msvc_arch: x64 - - target: aarch64-pc-windows-msvc - cache_key: windows-arm64 - msvc_arch: amd64_arm64 steps: - name: Checkout repository diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d45aa4a..fbd7a55d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,11 +33,6 @@ jobs: cef_cache_key: windows-x64 can_run_tests: true msvc_arch: x64 - - target: aarch64-pc-windows-msvc - os: windows-latest - cef_cache_key: windows-arm64 - can_run_tests: false - msvc_arch: amd64_arm64 - target: x86_64-unknown-linux-gnu os: ubuntu-latest cef_cache_key: linux-x64 @@ -115,11 +110,6 @@ jobs: name: Windows x64 cef_cache_key: windows-x64 msvc_arch: x64 - - os: windows-latest - target: aarch64-pc-windows-msvc - name: Windows ARM64 - cef_cache_key: windows-arm64 - msvc_arch: amd64_arm64 - os: ubuntu-latest target: x86_64-unknown-linux-gnu name: Linux x64 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7e1b2d4..7c5fbc5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,15 +109,9 @@ export-cef-dir --version $env:CEF_VERSION --force $env:CEF_PATH $env:PATH="$env:PATH;$env:CEF_PATH" ``` -For Windows ARM64 cross builds from an x64 Windows machine, use the ARM64 CEF -runtime and Rust target: - -```powershell -$env:CEF_PATH="$env:USERPROFILE/.local/share/cef_arm64" -export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH -rustup target add aarch64-pc-windows-msvc -cargo xtask bundle --release --target aarch64-pc-windows-msvc -``` +Windows builds support only `x86_64-pc-windows-msvc`. Native Windows ARM64 +builds and packages are no longer supported. Use an x64 build host and the x64 +CEF runtime. ### Building diff --git a/README.md b/README.md index 53606d6d..7acbd1a4 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,14 @@ For comprehensive API documentation, examples, and guides, visit the [full docum ## Platform Support +Supported architectures: Windows x86_64, Linux x86_64/ARM64, and macOS universal +(x86_64/ARM64). **Breaking change:** native Windows ARM64 support has been removed +from builds, packages, and Godot exports. Projects using native ARM64 Windows +Godot must remain on a prior release that includes this target until they can +migrate. Running x86_64 Godot under Windows emulation is not a validated replacement. +This support removal may require a major release; release planning is tracked in +[#238](https://github.com/dsh0416/godot-cef/issues/238). + | Platform | DirectX 12 | Metal | Vulkan | Software Rendering | |----------|------------|-------|--------|-------------------| | **Windows** | ✅ (Note 1) | n.a. | ✅ (Note 2) | ✅ | diff --git a/addons/godot_cef/godot_cef.gdextension b/addons/godot_cef/godot_cef.gdextension index 92189b08..b44dabe5 100644 --- a/addons/godot_cef/godot_cef.gdextension +++ b/addons/godot_cef/godot_cef.gdextension @@ -8,7 +8,6 @@ linux.x86_64 = "bin/x86_64-unknown-linux-gnu/libgdcef.so" linux.arm64 = "bin/aarch64-unknown-linux-gnu/libgdcef.so" macos = "bin/universal-apple-darwin/Godot CEF.framework" windows.x86_64 = "bin/x86_64-pc-windows-msvc/gdcef.dll" -windows.arm64 = "bin/aarch64-pc-windows-msvc/gdcef.dll" [icons] CefTexture = "icons/webview.png" @@ -38,28 +37,6 @@ windows.x86_64 = { "bin/x86_64-pc-windows-msvc/vulkan-1.dll" : "" } -windows.arm64 = { - "bin/aarch64-pc-windows-msvc/gdcef.dll" : "", - "bin/aarch64-pc-windows-msvc/gdcef_helper.exe" : "", - - "bin/aarch64-pc-windows-msvc/locales" : "", - "bin/aarch64-pc-windows-msvc/bootstrap.exe" : "", - "bin/aarch64-pc-windows-msvc/bootstrapc.exe" : "", - "bin/aarch64-pc-windows-msvc/chrome_100_percent.pak" : "", - "bin/aarch64-pc-windows-msvc/chrome_200_percent.pak" : "", - "bin/aarch64-pc-windows-msvc/chrome_elf.dll" : "", - "bin/aarch64-pc-windows-msvc/d3dcompiler_47.dll" : "", - "bin/aarch64-pc-windows-msvc/dxcompiler.dll" : "", - "bin/aarch64-pc-windows-msvc/dxil.dll" : "", - "bin/aarch64-pc-windows-msvc/icudtl.dat" : "", - "bin/aarch64-pc-windows-msvc/libcef.dll" : "", - "bin/aarch64-pc-windows-msvc/resources.pak" : "", - "bin/aarch64-pc-windows-msvc/v8_context_snapshot.bin" : "", - "bin/aarch64-pc-windows-msvc/vk_swiftshader.dll" : "", - "bin/aarch64-pc-windows-msvc/vk_swiftshader_icd.json" : "", - "bin/aarch64-pc-windows-msvc/vulkan-1.dll" : "" -} - linux.x86_64 = { "bin/x86_64-unknown-linux-gnu/libgdcef.so" : "", "bin/x86_64-unknown-linux-gnu/gdcef_helper" : "", diff --git a/docs/api/compatibility-matrix.md b/docs/api/compatibility-matrix.md index a5f7d6bb..6d6582ad 100644 --- a/docs/api/compatibility-matrix.md +++ b/docs/api/compatibility-matrix.md @@ -2,6 +2,13 @@ This matrix summarizes the expected rendering mode behavior for each platform/backend combination. +Supported architectures: Windows x86_64, Linux x86_64/ARM64, and macOS universal +(x86_64/ARM64). **Breaking change:** native Windows ARM64 builds, packages, and +Godot exports are no longer supported. Projects depending on this target should +remain on a prior release that includes it until they can migrate. Running +x86_64 Godot under Windows emulation is unverified. This removal may require a +major release; see [#238](https://github.com/dsh0416/godot-cef/issues/238). + ## Version Baseline Current builds are based on the Rust `cef` / `cef-dll-sys` crates resolved as `152.3.0+152.0.6` in `Cargo.lock`. The matching CEF runtime version is pinned as `CEF_VERSION` in `mise.toml`; use it when installing CEF binaries manually: @@ -19,9 +26,7 @@ This keeps the downloaded runtime files aligned with the Rust bindings. |----------|--------------|---------------|-----------------|-----------------| | Windows | x86_64 | Direct3D12 | Yes | Accelerated | | Windows | x86_64 | Vulkan | Yes (hook-based) | Accelerated | -| Windows | ARM64 | Direct3D12 | Yes | Accelerated | -| Windows | any | OpenGL | No | Software fallback | -| Windows | ARM64 | Vulkan | No (hooks unsupported) | Software fallback | +| Windows | x86_64 | OpenGL | No | Software fallback | | macOS | any | Metal | Yes | Accelerated | | macOS | any | Vulkan | No | Software fallback | | macOS | any | OpenGL | No | Software fallback | diff --git a/docs/api/vulkan-support.md b/docs/api/vulkan-support.md index 096a0c62..1a5444c2 100644 --- a/docs/api/vulkan-support.md +++ b/docs/api/vulkan-support.md @@ -102,7 +102,6 @@ Vulkan hook-based acceleration is **only available on x86_64 (64-bit x86) archit The hooking mechanism relies on the [retour](https://github.com/darfink/retour-rs) library for runtime function detouring. This library currently does not support ARM64 architecture, which means: -- **Windows ARM64** — Vulkan hooks not available - **Linux ARM64** — Vulkan hooks not available - **macOS (Apple Silicon)** — Vulkan hooks not available @@ -144,7 +143,6 @@ If you experience issues with accelerated rendering, try: | Platform | Architecture | Vulkan Accelerated OSR | Notes | |----------|--------------|------------------------|-------| | Windows | x86_64 | ✅ Supported | Via `vkCreateDevice` extension injection hook | -| Windows | ARM64 | ❌ Not supported | retour doesn't support ARM64 | | Linux | x86_64 | ✅ Supported | Via `vkCreateDevice` extension injection hook | | Linux | ARM64 | ❌ Not supported | retour doesn't support ARM64 | | macOS | Any | ❌ Not applicable | Static linking of MoltenVK prevents hooking; use Metal backend | diff --git a/docs/zh_CN/api/compatibility-matrix.md b/docs/zh_CN/api/compatibility-matrix.md index cfd31ab3..d74e7897 100644 --- a/docs/zh_CN/api/compatibility-matrix.md +++ b/docs/zh_CN/api/compatibility-matrix.md @@ -2,6 +2,12 @@ 该矩阵用于总结不同平台与渲染后端下,Godot CEF 的预期渲染行为。 +支持的架构:Windows x86_64、Linux x86_64/ARM64、macOS universal(x86_64/ARM64)。 +**破坏性变更:**已移除 Windows ARM64 原生构建、打包和 Godot 导出支持。 +依赖该架构的项目应暂时保留在支持它的旧版本,直至完成迁移。 +Windows 上通过模拟运行 x86_64 Godot 尚未验证,不能保证兼容。 +此变更可能需要发布新的主版本;发布规划见 [#238](https://github.com/dsh0416/godot-cef/issues/238)。 + ## 版本基线 当前构建基于 `Cargo.lock` 中解析到的 Rust `cef` / `cef-dll-sys` crate 版本:`152.3.0+152.0.6`。匹配的 CEF 运行时版本已在 `mise.toml` 中固定为 `CEF_VERSION`;手动安装 CEF 二进制文件时请使用它: @@ -19,8 +25,7 @@ export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH" |------|------|------------|----------|----------| | Windows | x86_64 | Direct3D12 | 支持 | 使用加速渲染 | | Windows | x86_64 | Vulkan | 支持(基于 Hook) | 使用加速渲染 | -| Windows | 任意 | OpenGL | 不支持 | 回退到软件渲染 | -| Windows | ARM64 | Vulkan | 不支持 | 回退到软件渲染 | +| Windows | x86_64 | OpenGL | 不支持 | 回退到软件渲染 | | macOS | 任意 | Metal | 支持 | 使用加速渲染 | | macOS | 任意 | Vulkan | 不支持 | 回退到软件渲染 | | macOS | 任意 | OpenGL | 不支持 | 回退到软件渲染 | diff --git a/docs/zh_CN/api/vulkan-support.md b/docs/zh_CN/api/vulkan-support.md index 824a1fbc..c7543fc1 100644 --- a/docs/zh_CN/api/vulkan-support.md +++ b/docs/zh_CN/api/vulkan-support.md @@ -102,7 +102,6 @@ cat /sys/module/nvidia_drm/parameters/modeset 钩子机制依赖于 [retour](https://github.com/darfink/retour-rs) 库进行运行时函数重定向。该库目前不支持 ARM64 架构,这意味着: -- **Windows ARM64** — Vulkan 钩子不可用 - **Linux ARM64** — Vulkan 钩子不可用 - **macOS(Apple Silicon)** — Vulkan 钩子不可用 @@ -144,7 +143,6 @@ cat /sys/module/nvidia_drm/parameters/modeset | 平台 | 架构 | Vulkan 加速 OSR | 备注 | |------|------|-----------------|------| | Windows | x86_64 | ✅ 支持 | 通过 `vkCreateDevice` 扩展注入钩子 | -| Windows | ARM64 | ❌ 不支持 | retour 不支持 ARM64 | | Linux | x86_64 | ✅ 支持 | 通过 `vkCreateDevice` 扩展注入钩子 | | Linux | ARM64 | ❌ 不支持 | retour 不支持 ARM64 | | macOS | 任意 | ❌ 不适用 | MoltenVK 静态链接阻止钩子;使用 Metal 后端 | diff --git a/xtask/src/bundle_windows.rs b/xtask/src/bundle_windows.rs index d05615c3..e22326b6 100644 --- a/xtask/src/bundle_windows.rs +++ b/xtask/src/bundle_windows.rs @@ -4,26 +4,21 @@ use crate::bundle_common::{ copy_directory, deploy_to_addon, get_cef_dir, get_target_dir, get_target_dir_for_target, run_cargo, validate_required_paths, }; -use crate::platform::{WINDOWS_ARM64_TARGET, WINDOWS_RUNTIME_ASSETS, WINDOWS_X64_TARGET}; +use crate::platform::{WINDOWS_RUNTIME_ASSETS, WINDOWS_X64_TARGET}; use std::fs; use std::path::Path; -fn default_platform_target() -> &'static str { - if cfg!(target_arch = "aarch64") { - WINDOWS_ARM64_TARGET - } else { - WINDOWS_X64_TARGET - } -} - fn resolve_platform_target( target: Option<&str>, ) -> Result<&'static str, Box> { match target { Some(WINDOWS_X64_TARGET) => Ok(WINDOWS_X64_TARGET), - Some(WINDOWS_ARM64_TARGET) => Ok(WINDOWS_ARM64_TARGET), Some(other) => Err(format!("unsupported Windows target: {other}").into()), - None => Ok(default_platform_target()), + None if cfg!(target_arch = "x86_64") => Ok(WINDOWS_X64_TARGET), + None => Err( + "native Windows bundling requires x86_64; Windows ARM64 support has been removed" + .into(), + ), } } @@ -102,3 +97,30 @@ pub fn run( Ok(()) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn x64_target_is_supported() -> Result<(), Box> { + assert_eq!( + resolve_platform_target(Some(WINDOWS_X64_TARGET))?, + WINDOWS_X64_TARGET + ); + Ok(()) + } + + #[test] + fn windows_arm64_target_is_rejected() { + assert!(resolve_platform_target(Some("aarch64-pc-windows-msvc")).is_err()); + } + + #[test] + fn native_target_requires_x64_host() { + assert_eq!( + resolve_platform_target(None).is_ok(), + cfg!(target_arch = "x86_64") + ); + } +} diff --git a/xtask/src/pack.rs b/xtask/src/pack.rs index 7b1c334e..3101622e 100644 --- a/xtask/src/pack.rs +++ b/xtask/src/pack.rs @@ -101,3 +101,55 @@ pub fn run( Ok(()) } + +#[cfg(test)] +mod tests { + use super::*; + use std::time::{SystemTime, UNIX_EPOCH}; + + #[test] + fn pack_retains_supported_platforms_and_omits_windows_arm64() + -> Result<(), Box> { + let root = std::env::temp_dir().join(format!( + "gdcef-pack-platforms-{}-{}", + std::process::id(), + SystemTime::now().duration_since(UNIX_EPOCH)?.as_nanos() + )); + let artifacts = root.join("artifacts"); + let output = root.join("addon"); + let removed_target = "aarch64-pc-windows-msvc"; + // Both an old CI artifact and a previously staged bundle must be excluded. + fs::create_dir_all(artifacts.join(format!("gdcef-{removed_target}")))?; + fs::create_dir_all(output.join("bin").join(removed_target))?; + for platform in PLATFORM_SPECS { + let source = artifacts.join(platform.artifact_name); + fs::create_dir_all(&source)?; + for file in platform.required_files { + fs::write(source.join(file), b"fixture")?; + } + for dir in platform.required_dirs { + fs::create_dir_all(source.join(dir))?; + } + } + + let result = (|| -> Result<(), Box> { + run(&artifacts, &output, None)?; + crate::validate::run(&output)?; + for target in [ + "universal-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "aarch64-unknown-linux-gnu", + ] { + assert!(output.join("bin").join(target).is_dir()); + } + assert!(!output.join("bin").join(removed_target).exists()); + let manifest = fs::read_to_string(output.join("godot_cef.gdextension"))?; + assert!(!manifest.contains("windows.arm64")); + assert!(!manifest.contains(removed_target)); + Ok(()) + })(); + fs::remove_dir_all(&root)?; + result + } +} diff --git a/xtask/src/platform.rs b/xtask/src/platform.rs index 2a00aa43..52c4ecd0 100644 --- a/xtask/src/platform.rs +++ b/xtask/src/platform.rs @@ -15,7 +15,6 @@ pub struct RuntimeAssetSpec { pub const MACOS_UNIVERSAL_TARGET: &str = "universal-apple-darwin"; pub const WINDOWS_X64_TARGET: &str = "x86_64-pc-windows-msvc"; -pub const WINDOWS_ARM64_TARGET: &str = "aarch64-pc-windows-msvc"; pub const LINUX_X64_TARGET: &str = "x86_64-unknown-linux-gnu"; pub const LINUX_ARM64_TARGET: &str = "aarch64-unknown-linux-gnu"; @@ -38,12 +37,6 @@ pub const PLATFORM_SPECS: &[PlatformSpec] = &[ required_files: WINDOWS_REQUIRED_FILES, required_dirs: LOCALES_DIR, }, - PlatformSpec { - target: WINDOWS_ARM64_TARGET, - artifact_name: "gdcef-aarch64-pc-windows-msvc", - required_files: WINDOWS_REQUIRED_FILES, - required_dirs: LOCALES_DIR, - }, PlatformSpec { target: LINUX_X64_TARGET, artifact_name: "gdcef-x86_64-unknown-linux-gnu", @@ -165,7 +158,7 @@ mod tests { #[test] fn runtime_assets_include_pack_validation_requirements() { - for target in [WINDOWS_X64_TARGET, WINDOWS_ARM64_TARGET] { + for target in [WINDOWS_X64_TARGET] { let Some(spec) = platform_spec(target) else { assert!(platform_spec(target).is_some(), "windows spec should exist"); continue; From 4ea1a69334cfe7530f646114dd6823acd6071ea1 Mon Sep 17 00:00:00 2001 From: Delton Ding Date: Wed, 30 Sep 2026 23:26:09 +0800 Subject: [PATCH 2/4] feat!: drop official Linux ARM64 binaries and retain ARM64 self-builds Limit official CI and addon packages to Windows x64, Linux x64, and macOS universal. Preserve Windows and Linux ARM64 source bundling and document manual addon registration in both languages. BREAKING CHANGE: Official Windows ARM64 and Linux ARM64 builds, binary distributions, and Godot export registrations are removed. Unsupported self-build paths remain available. Related to #238. --- .github/actions/setup-rust-cef/action.yml | 5 +- .github/workflows/build.yml | 2 - .github/workflows/test.yml | 8 - CONTRIBUTING.md | 25 +-- README.md | 15 +- addons/godot_cef/godot_cef.gdextension | 18 -- docs/.vitepress/config.mts | 2 + docs/api/compatibility-matrix.md | 16 +- docs/api/unsupported-targets.md | 190 ++++++++++++++++++++++ docs/api/vulkan-support.md | 8 +- docs/zh_CN/api/compatibility-matrix.md | 13 +- docs/zh_CN/api/unsupported-targets.md | 165 +++++++++++++++++++ docs/zh_CN/api/vulkan-support.md | 8 +- xtask/src/bundle_linux.rs | 28 ++++ xtask/src/bundle_windows.rs | 34 ++-- xtask/src/pack.rs | 29 +++- xtask/src/platform.rs | 13 +- 17 files changed, 474 insertions(+), 105 deletions(-) create mode 100644 docs/api/unsupported-targets.md create mode 100644 docs/zh_CN/api/unsupported-targets.md diff --git a/.github/actions/setup-rust-cef/action.yml b/.github/actions/setup-rust-cef/action.yml index 30578541..ffb04504 100644 --- a/.github/actions/setup-rust-cef/action.yml +++ b/.github/actions/setup-rust-cef/action.yml @@ -47,10 +47,7 @@ runs: libxrandr-dev \ libgbm-dev \ libpango1.0-dev \ - libasound2-dev \ - gcc-aarch64-linux-gnu \ - g++-aarch64-linux-gnu \ - binutils-aarch64-linux-gnu + libasound2-dev - name: Setup mise toolchain uses: jdx/mise-action@v4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 745de7ca..94569a02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,8 +160,6 @@ jobs: include: - target: x86_64-unknown-linux-gnu cache_key: linux-x64 - - target: aarch64-unknown-linux-gnu - cache_key: linux-arm64 steps: - name: Checkout repository diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbd7a55d..724afe07 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,10 +37,6 @@ jobs: os: ubuntu-latest cef_cache_key: linux-x64 can_run_tests: true - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - cef_cache_key: linux-arm64 - can_run_tests: false runs-on: ${{ matrix.os }} name: Test (${{ matrix.target }}) @@ -114,10 +110,6 @@ jobs: target: x86_64-unknown-linux-gnu name: Linux x64 cef_cache_key: linux-x64 - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - name: Linux ARM64 - cef_cache_key: linux-arm64 runs-on: ${{ matrix.os }} name: Clippy (${{ matrix.name }}) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c5fbc5d..adfd951e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,19 +58,8 @@ export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH" export LD_LIBRARY_PATH="$CEF_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ``` -For Linux ARM64 cross builds, download the matching CEF runtime and build with -the ARM64 Rust target: - -```bash -export CEF_PATH="$HOME/.local/share/cef_aarch64" -export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" -rustup target add aarch64-unknown-linux-gnu -cargo xtask bundle --release --target aarch64-unknown-linux-gnu -``` - -The repository config allows unresolved symbols from `libcef.so` during Linux -ARM64 cross linking, because those CEF system dependencies are provided by the -target ARM64 Linux runtime rather than the x64 build host. +Official Linux builds support x86_64. For unsupported Linux ARM64 source builds, +see [Building unsupported targets](docs/api/unsupported-targets.md). You'll also need system dependencies: @@ -81,10 +70,6 @@ sudo apt-get install -y \ libdrm-dev libxkbcommon-dev libxcomposite-dev \ libxdamage-dev libxrandr-dev libgbm-dev \ libpango1.0-dev libasound2-dev - -# Additional tools for Linux ARM64 cross builds -sudo apt-get install -y \ - gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu ``` #### macOS @@ -109,9 +94,9 @@ export-cef-dir --version $env:CEF_VERSION --force $env:CEF_PATH $env:PATH="$env:PATH;$env:CEF_PATH" ``` -Windows builds support only `x86_64-pc-windows-msvc`. Native Windows ARM64 -builds and packages are no longer supported. Use an x64 build host and the x64 -CEF runtime. +Official Windows builds support x86_64. The bundler still accepts Windows ARM64 +for unsupported source builds; see [Building unsupported targets](docs/api/unsupported-targets.md). +These local outputs are excluded from `cargo xtask pack` and official distributions. ### Building diff --git a/README.md b/README.md index 7acbd1a4..9490983f 100644 --- a/README.md +++ b/README.md @@ -92,13 +92,14 @@ For comprehensive API documentation, examples, and guides, visit the [full docum ## Platform Support -Supported architectures: Windows x86_64, Linux x86_64/ARM64, and macOS universal -(x86_64/ARM64). **Breaking change:** native Windows ARM64 support has been removed -from builds, packages, and Godot exports. Projects using native ARM64 Windows -Godot must remain on a prior release that includes this target until they can -migrate. Running x86_64 Godot under Windows emulation is not a validated replacement. -This support removal may require a major release; release planning is tracked in -[#238](https://github.com/dsh0416/godot-cef/issues/238). +Official binary targets: Windows x86_64, Linux x86_64, and macOS universal +(x86_64/ARM64). **Breaking change:** official Windows ARM64 and Linux ARM64 builds, +packages, and Godot export registrations have been removed. Users needing these +targets can remain on an earlier release or follow the unsupported +[source-build guide](https://godotcef.org/api/unsupported-targets.html); local builds +require their own validation and manifest registration. Windows x86_64 emulation +is not a validated replacement. This distribution change may require a major +release; release planning is tracked in [#238](https://github.com/dsh0416/godot-cef/issues/238). | Platform | DirectX 12 | Metal | Vulkan | Software Rendering | |----------|------------|-------|--------|-------------------| diff --git a/addons/godot_cef/godot_cef.gdextension b/addons/godot_cef/godot_cef.gdextension index b44dabe5..948300bb 100644 --- a/addons/godot_cef/godot_cef.gdextension +++ b/addons/godot_cef/godot_cef.gdextension @@ -5,7 +5,6 @@ reloadable = true [libraries] linux.x86_64 = "bin/x86_64-unknown-linux-gnu/libgdcef.so" -linux.arm64 = "bin/aarch64-unknown-linux-gnu/libgdcef.so" macos = "bin/universal-apple-darwin/Godot CEF.framework" windows.x86_64 = "bin/x86_64-pc-windows-msvc/gdcef.dll" @@ -53,20 +52,3 @@ linux.x86_64 = { "bin/x86_64-unknown-linux-gnu/chrome_200_percent.pak" : "", "bin/x86_64-unknown-linux-gnu/locales" : "" } - -linux.arm64 = { - "bin/aarch64-unknown-linux-gnu/libgdcef.so" : "", - "bin/aarch64-unknown-linux-gnu/gdcef_helper" : "", - - "bin/aarch64-unknown-linux-gnu/chrome-sandbox" : "", - "bin/aarch64-unknown-linux-gnu/libcef.so" : "", - "bin/aarch64-unknown-linux-gnu/libvk_swiftshader.so" : "", - "bin/aarch64-unknown-linux-gnu/libvulkan.so.1" : "", - "bin/aarch64-unknown-linux-gnu/v8_context_snapshot.bin" : "", - "bin/aarch64-unknown-linux-gnu/vk_swiftshader_icd.json" : "", - "bin/aarch64-unknown-linux-gnu/icudtl.dat" : "", - "bin/aarch64-unknown-linux-gnu/resources.pak" : "", - "bin/aarch64-unknown-linux-gnu/chrome_100_percent.pak" : "", - "bin/aarch64-unknown-linux-gnu/chrome_200_percent.pak" : "", - "bin/aarch64-unknown-linux-gnu/locales" : "" -} diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index f7a839ac..dc1ddae7 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -51,6 +51,7 @@ export default withMermaid(defineConfig({ { text: '拖放', link: '/zh_CN/api/drag-and-drop' }, { text: '下载', link: '/zh_CN/api/downloads' }, { text: 'Vulkan 支持', link: '/zh_CN/api/vulkan-support' }, + { text: '不支持目标的自编译', link: '/zh_CN/api/unsupported-targets' }, { text: 'GPU 设备绑定', link: '/zh_CN/api/gpu-device-pinning' } ] } @@ -99,6 +100,7 @@ export default withMermaid(defineConfig({ { text: 'Drag and Drop', link: '/api/drag-and-drop' }, { text: 'Downloads', link: '/api/downloads' }, { text: 'Vulkan Support', link: '/api/vulkan-support' }, + { text: 'Building Unsupported Targets', link: '/api/unsupported-targets' }, { text: 'GPU Device Pinning', link: '/api/gpu-device-pinning' } ] } diff --git a/docs/api/compatibility-matrix.md b/docs/api/compatibility-matrix.md index 6d6582ad..02c15e06 100644 --- a/docs/api/compatibility-matrix.md +++ b/docs/api/compatibility-matrix.md @@ -2,12 +2,13 @@ This matrix summarizes the expected rendering mode behavior for each platform/backend combination. -Supported architectures: Windows x86_64, Linux x86_64/ARM64, and macOS universal -(x86_64/ARM64). **Breaking change:** native Windows ARM64 builds, packages, and -Godot exports are no longer supported. Projects depending on this target should -remain on a prior release that includes it until they can migrate. Running -x86_64 Godot under Windows emulation is unverified. This removal may require a -major release; see [#238](https://github.com/dsh0416/godot-cef/issues/238). +Official binary targets: Windows x86_64, Linux x86_64, and macOS universal +(x86_64/ARM64). **Breaking change:** official Windows ARM64 and Linux ARM64 builds, +packages, and Godot export registrations have been removed. Users can remain on +an earlier release or follow the [unsupported source-build guide](./unsupported-targets), +register their own manifest, and validate their results. Windows x86_64 emulation +is unverified. This distribution change may require a major release; see +[#238](https://github.com/dsh0416/godot-cef/issues/238). ## Version Baseline @@ -31,8 +32,7 @@ This keeps the downloaded runtime files aligned with the Rust bindings. | macOS | any | Vulkan | No | Software fallback | | macOS | any | OpenGL | No | Software fallback | | Linux | x86_64 | Vulkan | Yes (hook-based) | Accelerated | -| Linux | any | OpenGL | No | Software fallback | -| Linux | ARM64 | Vulkan | No (hooks unsupported) | Software fallback | +| Linux | x86_64 | OpenGL | No | Software fallback | ## Fallback Conditions diff --git a/docs/api/unsupported-targets.md b/docs/api/unsupported-targets.md new file mode 100644 index 00000000..fc949d1d --- /dev/null +++ b/docs/api/unsupported-targets.md @@ -0,0 +1,190 @@ +--- +title: Building Unsupported Targets +description: Build Windows ARM64 and Linux ARM64 from source for a privately maintained Godot CEF addon. +--- + +# Building unsupported targets + +Official binaries and CI cover Windows x86_64, Linux x86_64, and macOS universal +(x86_64/ARM64). Windows ARM64 and Linux ARM64 are no longer built or distributed +in official addons. Removing those binary targets is a **breaking distribution +change** and may require a major release; see [#238](https://github.com/dsh0416/godot-cef/issues/238). + +The source bundlers still accept both ARM64 targets for users maintaining their +own addon. This is a best-effort source-build path, not an officially tested +platform. The instructions follow the current bundler's target and runtime asset +layout; ARM64 builds, editor startup, rendering and exports have not been validated +for this change. Availability of a matching CEF runtime and a working target +compiler/sysroot remains a prerequisite. Keep an earlier release if you cannot +validate a replacement. Windows x86_64 emulation is also unvalidated. + +## Common prerequisites + +Use a clean checkout of the exact tag or commit you intend to maintain. Install +Git and mise, then run commands from the repository root. `mise install` provides +the Rust nightly and `export-cef-dir` pinned by `mise.toml`. Use that checkout's +`CEF_VERSION`, not an arbitrary newer CEF runtime. A C++ compiler, CMake, and +Godot 4.5+ for the target OS/architecture are also required. Builds can consume +substantial disk space and memory. + +`cargo xtask bundle` dispatches by the **host OS**: use Windows for Windows +builds and Linux for Linux builds. Passing a Windows/Linux target on macOS does +not provide a cross-OS build path. + +## Windows ARM64 from a Windows x64 host + +Install Visual Studio 2022 Build Tools with Desktop development with C++, the +MSVC ARM64 build tools and a Windows SDK. Use a Developer Command Prompt configured +for x64-host/ARM64-target (`amd64_arm64`). For example, in `cmd.exe`, replace the +installation path with your actual Visual Studio location, then launch PowerShell +from that configured prompt so it inherits the compiler environment: + +```bat +call "\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 +pwsh -NoProfile +``` + +Install CMake and PowerShell 7 (`pwsh`) and make them available on `PATH`. Run: + +```powershell +mise trust +mise install +mise exec -- pwsh -NoProfile +# The following commands run inside this mise environment. +$env:CEF_PATH = "$env:USERPROFILE/.local/share/cef_windows_arm64" +export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH +rustup target add aarch64-pc-windows-msvc +cargo xtask bundle --release --target aarch64-pc-windows-msvc +``` + +Do not point `CEF_PATH` at an x64 runtime. The bundled output includes the helper, +DLLs, locales and CEF resources, and is deployed to +`addons/godot_cef/bin/aarch64-pc-windows-msvc/`. Cargo's target build output is +`target/aarch64-pc-windows-msvc/release/` with the default target directory. +A native Windows ARM64 host requires an ARM64-host/ARM64-target developer +environment and matching native tools; that host setup is not validated here. + +## Linux ARM64 from a Linux x64 host + +For a Debian/Ubuntu-style host, install the ordinary build dependencies and the +ARM64 cross compiler/binutils: + +```bash +sudo apt-get update +sudo apt-get install -y build-essential cmake libgtk-3-dev libnss3-dev \ + libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev \ + libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ + libgbm-dev libpango1.0-dev libasound2-dev \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +mise trust +mise install +mise exec -- bash +# The following commands run inside this mise environment. +export CEF_PATH="$HOME/.local/share/cef_linux_arm64" +export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc +export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ +export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" +rustup target add aarch64-unknown-linux-gnu +cargo xtask bundle --release --target aarch64-unknown-linux-gnu +``` + +The repository's `.cargo/config.toml` selects `aarch64-linux-gnu-gcc` and permits +unresolved dependencies from `libcef.so` during cross linking. Those libraries +must still exist on the target system. Host development packages alone do not +supply an ARM64 runtime/sysroot; install target-architecture dependencies or +configure a compatible ARM64 sysroot if required by the compiler or CEF build. +Check the CEF runtime's glibc/system-library requirements against the destination. + +The Linux bundler uses `aarch64-linux-gnu-strip`, copies runtime assets and deploys +to `addons/godot_cef/bin/aarch64-unknown-linux-gnu/`. Cargo's default target output +is `target/aarch64-unknown-linux-gnu/release/`. A native Linux ARM64 build is also +accepted, but the current linker/strip configuration still requires the named +`aarch64-linux-gnu-*` tools; adjust your local toolchain if your distribution uses +other names. No native ARM64 host setup is validated here. + +## Install and register your local addon + +Copy the repository's whole `addons/godot_cef/` directory to your Godot project's +`addons/godot_cef/`, or copy the complete ARM64 `bin//` directory into an +existing addon from the same commit. Keep helper executables, locale directories +and every runtime resource beside the extension library. Preserve Linux executable +permissions when copying or archiving `gdcef_helper` and `chrome-sandbox`. + +The official `godot_cef.gdextension` intentionally has no ARM64 Windows/Linux +entries. In **your local copy**, add the relevant library entry to the existing +`[libraries]` section and its dependency block to the existing `[dependencies]` +section. The example shows both targets; include only the target(s) you built. +Do not duplicate section headers or remove supported entries that your project +still needs. + +```ini +[libraries] +windows.arm64 = "bin/aarch64-pc-windows-msvc/gdcef.dll" +linux.arm64 = "bin/aarch64-unknown-linux-gnu/libgdcef.so" + +[dependencies] +windows.arm64 = { + "bin/aarch64-pc-windows-msvc/gdcef.dll" : "", + "bin/aarch64-pc-windows-msvc/gdcef_helper.exe" : "", + + "bin/aarch64-pc-windows-msvc/locales" : "", + "bin/aarch64-pc-windows-msvc/bootstrap.exe" : "", + "bin/aarch64-pc-windows-msvc/bootstrapc.exe" : "", + "bin/aarch64-pc-windows-msvc/chrome_100_percent.pak" : "", + "bin/aarch64-pc-windows-msvc/chrome_200_percent.pak" : "", + "bin/aarch64-pc-windows-msvc/chrome_elf.dll" : "", + "bin/aarch64-pc-windows-msvc/d3dcompiler_47.dll" : "", + "bin/aarch64-pc-windows-msvc/dxcompiler.dll" : "", + "bin/aarch64-pc-windows-msvc/dxil.dll" : "", + "bin/aarch64-pc-windows-msvc/icudtl.dat" : "", + "bin/aarch64-pc-windows-msvc/libcef.dll" : "", + "bin/aarch64-pc-windows-msvc/resources.pak" : "", + "bin/aarch64-pc-windows-msvc/v8_context_snapshot.bin" : "", + "bin/aarch64-pc-windows-msvc/vk_swiftshader.dll" : "", + "bin/aarch64-pc-windows-msvc/vk_swiftshader_icd.json" : "", + "bin/aarch64-pc-windows-msvc/vulkan-1.dll" : "" +} + +linux.arm64 = { + "bin/aarch64-unknown-linux-gnu/libgdcef.so" : "", + "bin/aarch64-unknown-linux-gnu/gdcef_helper" : "", + + "bin/aarch64-unknown-linux-gnu/chrome-sandbox" : "", + "bin/aarch64-unknown-linux-gnu/libcef.so" : "", + "bin/aarch64-unknown-linux-gnu/libvk_swiftshader.so" : "", + "bin/aarch64-unknown-linux-gnu/libvulkan.so.1" : "", + "bin/aarch64-unknown-linux-gnu/v8_context_snapshot.bin" : "", + "bin/aarch64-unknown-linux-gnu/vk_swiftshader_icd.json" : "", + "bin/aarch64-unknown-linux-gnu/icudtl.dat" : "", + "bin/aarch64-unknown-linux-gnu/resources.pak" : "", + "bin/aarch64-unknown-linux-gnu/chrome_100_percent.pak" : "", + "bin/aarch64-unknown-linux-gnu/chrome_200_percent.pak" : "", + "bin/aarch64-unknown-linux-gnu/locales" : "" +} +``` + +These paths match the current Windows/Linux runtime asset lists in +`xtask/src/platform.rs`. Do not register a target until all referenced files and +directories exist. Build/debug profile changes do not change the addon paths. + +## Validate on the destination + +`cargo xtask pack` includes **only official targets** and intentionally ignores +ARM64 Windows/Linux artifacts. It cannot package your private ARM64 addon. +`cargo xtask validate` also checks only official target directories; a success +for a mixed addon does not validate its ARM64 contents, and an ARM64-only addon +will report no supported platform directories. Keep private distribution and +validation under your own control. + +Run the matching native ARM64 Godot editor and exported game on the destination, +verify extension loading, helper startup, page rendering/input and all exported +runtime dependencies. For Linux, use `ldd` on `libgdcef.so`, `gdcef_helper` and +`libcef.so` **on the ARM64 destination** to diagnose missing shared libraries. +Windows requires the matching MSVC runtime and CEF dependencies. Cross compilation +success alone proves neither runtime compatibility nor export completeness. + +Vulkan hook-based acceleration requires x86_64 on both Windows and Linux because +`retour` does not support ARM64. Start with software rendering +(`enable_accelerated_osr = false`); see [Vulkan support](./vulkan-support). No ARM64 +accelerated backend or emulation compatibility is promised by this guide. Test +any backend you rely on and maintain your own rebuilt binaries across upgrades. diff --git a/docs/api/vulkan-support.md b/docs/api/vulkan-support.md index 1a5444c2..f47ac4df 100644 --- a/docs/api/vulkan-support.md +++ b/docs/api/vulkan-support.md @@ -2,6 +2,8 @@ This page documents how Godot CEF enables GPU-accelerated rendering on Vulkan backends through runtime function hooking, and the limitations of this approach. +Windows/Linux ARM64 are not official binary targets; see [Building unsupported targets](./unsupported-targets) for private source builds. + ## Background GPU-accelerated offscreen rendering (OSR) in CEF requires sharing textures between the CEF renderer process and the host application (Godot). This is achieved through platform-specific external memory APIs: @@ -102,7 +104,8 @@ Vulkan hook-based acceleration is **only available on x86_64 (64-bit x86) archit The hooking mechanism relies on the [retour](https://github.com/darfink/retour-rs) library for runtime function detouring. This library currently does not support ARM64 architecture, which means: -- **Linux ARM64** — Vulkan hooks not available +- **Windows ARM64 (unsupported self-build only)** — Vulkan hooks not available +- **Linux ARM64 (unsupported self-build only)** — Vulkan hooks not available - **macOS (Apple Silicon)** — Vulkan hooks not available On unsupported architectures, the extension automatically falls back to software rendering. @@ -144,7 +147,8 @@ If you experience issues with accelerated rendering, try: |----------|--------------|------------------------|-------| | Windows | x86_64 | ✅ Supported | Via `vkCreateDevice` extension injection hook | | Linux | x86_64 | ✅ Supported | Via `vkCreateDevice` extension injection hook | -| Linux | ARM64 | ❌ Not supported | retour doesn't support ARM64 | +| Windows | ARM64 | ❌ Not supported | Unsupported self-build only; retour does not support ARM64 | +| Linux | ARM64 | ❌ Not supported | Unsupported self-build only; retour does not support ARM64 | | macOS | Any | ❌ Not applicable | Static linking of MoltenVK prevents hooking; use Metal backend | ## Future: Proper Godot API diff --git a/docs/zh_CN/api/compatibility-matrix.md b/docs/zh_CN/api/compatibility-matrix.md index d74e7897..dffa7e8f 100644 --- a/docs/zh_CN/api/compatibility-matrix.md +++ b/docs/zh_CN/api/compatibility-matrix.md @@ -2,11 +2,11 @@ 该矩阵用于总结不同平台与渲染后端下,Godot CEF 的预期渲染行为。 -支持的架构:Windows x86_64、Linux x86_64/ARM64、macOS universal(x86_64/ARM64)。 -**破坏性变更:**已移除 Windows ARM64 原生构建、打包和 Godot 导出支持。 -依赖该架构的项目应暂时保留在支持它的旧版本,直至完成迁移。 -Windows 上通过模拟运行 x86_64 Godot 尚未验证,不能保证兼容。 -此变更可能需要发布新的主版本;发布规划见 [#238](https://github.com/dsh0416/godot-cef/issues/238)。 +官方二进制目标:Windows x86_64、Linux x86_64、macOS universal(x86_64/ARM64)。 +**破坏性变更:**已停止 Windows ARM64 和 Linux ARM64 的官方构建、打包与 Godot 导出注册。 +需要这些目标的用户可以保留旧版本,或参考[不支持目标的自编译指南](./unsupported-targets), +自行构建、注册清单并验证运行情况。Windows x86_64 模拟运行不是已验证的替代方案。 +此分发变更可能需要新的主版本;见 [#238](https://github.com/dsh0416/godot-cef/issues/238)。 ## 版本基线 @@ -30,8 +30,7 @@ export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH" | macOS | 任意 | Vulkan | 不支持 | 回退到软件渲染 | | macOS | 任意 | OpenGL | 不支持 | 回退到软件渲染 | | Linux | x86_64 | Vulkan | 支持(基于 Hook) | 使用加速渲染 | -| Linux | 任意 | OpenGL | 不支持 | 回退到软件渲染 | -| Linux | ARM64 | Vulkan | 不支持 | 回退到软件渲染 | +| Linux | x86_64 | OpenGL | 不支持 | 回退到软件渲染 | ## 回退条件 diff --git a/docs/zh_CN/api/unsupported-targets.md b/docs/zh_CN/api/unsupported-targets.md new file mode 100644 index 00000000..1db0930f --- /dev/null +++ b/docs/zh_CN/api/unsupported-targets.md @@ -0,0 +1,165 @@ +--- +title: 不支持目标的自编译 +description: 为自行维护的 Godot CEF 插件构建 Windows ARM64 和 Linux ARM64 二进制。 +--- + +# 不支持目标的自编译 + +官方二进制和 CI 仅覆盖 Windows x86_64、Linux x86_64、macOS universal(x86_64/ARM64)。 +官方插件不再构建或分发 Windows ARM64 和 Linux ARM64。 +移除这些二进制目标是**破坏性的分发变更**,可能需要发布新的主版本;见 [#238](https://github.com/dsh0416/godot-cef/issues/238)。 + +源码打包器仍接受这两种 ARM64 目标,供用户自行维护插件。这是尽力保留的源码构建入口, +不代表官方测试或支持。本页命令依据当前打包器的目标和资源布局整理;本次变更并未验证 +ARM64 构建、编辑器启动、渲染或导出。匹配版本的 CEF 运行时和可用的目标编译器/sysroot +仍是前提。无法验证替代构建时,请保留此前提供该目标的版本。Windows x86_64 模拟运行同样未经验证。 + +## 通用前提 + +使用需要自行维护的确切 tag 或提交的干净 checkout。安装 Git 和 mise,并在仓库根目录运行命令。 +`mise install` 安装 `mise.toml` 固定的 Rust nightly 和 `export-cef-dir`。 +使用该 checkout 的 `CEF_VERSION`,不要随意换用较新的 CEF 运行时。 +还需要 C++ 编译器、CMake,以及目标系统/架构的 Godot 4.5+。构建可能占用较多磁盘和内存。 + +`cargo xtask bundle` 按**宿主操作系统**选择打包器:Windows 构建应在 Windows 上运行, +Linux 构建应在 Linux 上运行。在 macOS 上传入 Windows/Linux 目标并不能跨系统构建。 + +## 在 Windows x64 宿主上构建 Windows ARM64 + +安装 Visual Studio 2022 Build Tools 的“使用 C++ 的桌面开发”、MSVC ARM64 工具和 Windows SDK。 +使用配置为 x64 宿主、ARM64 目标(`amd64_arm64`)的开发者命令提示符。 +例如,在 `cmd.exe` 中将路径替换为实际 Visual Studio 安装位置,然后从该环境启动 PowerShell,继承编译器环境: + +```bat +call "\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 +pwsh -NoProfile +``` + +安装 CMake 和 PowerShell 7(`pwsh`),确保位于 `PATH`,然后运行: + +```powershell +mise trust +mise install +mise exec -- pwsh -NoProfile +# The following commands run inside this mise environment. +$env:CEF_PATH = "$env:USERPROFILE/.local/share/cef_windows_arm64" +export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH +rustup target add aarch64-pc-windows-msvc +cargo xtask bundle --release --target aarch64-pc-windows-msvc +``` + +不要让 `CEF_PATH` 指向 x64 运行时。打包器将扩展、helper、DLL、locales 和 CEF 资源复制到 +`addons/godot_cef/bin/aarch64-pc-windows-msvc/`。 +默认 Cargo 产物位于 `target/aarch64-pc-windows-msvc/release/`。 +在 Windows ARM64 原生宿主上构建需要 ARM64 宿主/ARM64 目标的开发环境及对应工具;本页未验证该宿主配置。 + +## 在 Linux x64 宿主上构建 Linux ARM64 + +以 Debian/Ubuntu 类宿主为例,安装常规依赖以及 ARM64 交叉编译器和 binutils: + +```bash +sudo apt-get update +sudo apt-get install -y build-essential cmake libgtk-3-dev libnss3-dev \ + libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev \ + libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ + libgbm-dev libpango1.0-dev libasound2-dev \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +mise trust +mise install +mise exec -- bash +# The following commands run inside this mise environment. +export CEF_PATH="$HOME/.local/share/cef_linux_arm64" +export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc +export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ +export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" +rustup target add aarch64-unknown-linux-gnu +cargo xtask bundle --release --target aarch64-unknown-linux-gnu +``` + +仓库 `.cargo/config.toml` 选择 `aarch64-linux-gnu-gcc`,并允许交叉链接时 `libcef.so` +存在未解析的依赖。这些共享库仍必须在目标系统上可用。 +宿主开发包不等于 ARM64 运行时/sysroot;编译器或 CEF 构建需要时,请安装目标架构依赖, +或配置兼容的 ARM64 sysroot。核对目标系统是否满足 CEF 的 glibc 和系统库要求。 + +Linux 打包器使用 `aarch64-linux-gnu-strip`,将运行时资源部署到 +`addons/godot_cef/bin/aarch64-unknown-linux-gnu/`。 +默认 Cargo 产物位于 `target/aarch64-unknown-linux-gnu/release/`。 +打包器也接受 Linux ARM64 原生构建,但当前 linker/strip 配置仍要求上述 +`aarch64-linux-gnu-*` 工具名;发行版命名不同时需自行调整本地工具链。本页未验证原生 ARM64 宿主配置。 + +## 安装并注册本地插件 + +把仓库整个 `addons/godot_cef/` 复制到 Godot 项目的 `addons/godot_cef/`, +或把完整 ARM64 `bin//` 目录复制到来自同一提交的已有插件。 +扩展旁应保留 helper、locales 目录和每个运行时资源。复制/归档 Linux +`gdcef_helper` 和 `chrome-sandbox` 时保留可执行权限。 + +官方 `godot_cef.gdextension` 不包含 Windows/Linux ARM64 注册。 +在**你的本地副本**已有 `[libraries]` 节添加对应库条目,并在已有 `[dependencies]` 节添加对应依赖块。 +下面示例包含两个目标,只添加实际构建的目标。不要重复节标题,也不要移除项目仍需使用的官方目标条目。 + +```ini +[libraries] +windows.arm64 = "bin/aarch64-pc-windows-msvc/gdcef.dll" +linux.arm64 = "bin/aarch64-unknown-linux-gnu/libgdcef.so" + +[dependencies] +windows.arm64 = { + "bin/aarch64-pc-windows-msvc/gdcef.dll" : "", + "bin/aarch64-pc-windows-msvc/gdcef_helper.exe" : "", + + "bin/aarch64-pc-windows-msvc/locales" : "", + "bin/aarch64-pc-windows-msvc/bootstrap.exe" : "", + "bin/aarch64-pc-windows-msvc/bootstrapc.exe" : "", + "bin/aarch64-pc-windows-msvc/chrome_100_percent.pak" : "", + "bin/aarch64-pc-windows-msvc/chrome_200_percent.pak" : "", + "bin/aarch64-pc-windows-msvc/chrome_elf.dll" : "", + "bin/aarch64-pc-windows-msvc/d3dcompiler_47.dll" : "", + "bin/aarch64-pc-windows-msvc/dxcompiler.dll" : "", + "bin/aarch64-pc-windows-msvc/dxil.dll" : "", + "bin/aarch64-pc-windows-msvc/icudtl.dat" : "", + "bin/aarch64-pc-windows-msvc/libcef.dll" : "", + "bin/aarch64-pc-windows-msvc/resources.pak" : "", + "bin/aarch64-pc-windows-msvc/v8_context_snapshot.bin" : "", + "bin/aarch64-pc-windows-msvc/vk_swiftshader.dll" : "", + "bin/aarch64-pc-windows-msvc/vk_swiftshader_icd.json" : "", + "bin/aarch64-pc-windows-msvc/vulkan-1.dll" : "" +} + +linux.arm64 = { + "bin/aarch64-unknown-linux-gnu/libgdcef.so" : "", + "bin/aarch64-unknown-linux-gnu/gdcef_helper" : "", + + "bin/aarch64-unknown-linux-gnu/chrome-sandbox" : "", + "bin/aarch64-unknown-linux-gnu/libcef.so" : "", + "bin/aarch64-unknown-linux-gnu/libvk_swiftshader.so" : "", + "bin/aarch64-unknown-linux-gnu/libvulkan.so.1" : "", + "bin/aarch64-unknown-linux-gnu/v8_context_snapshot.bin" : "", + "bin/aarch64-unknown-linux-gnu/vk_swiftshader_icd.json" : "", + "bin/aarch64-unknown-linux-gnu/icudtl.dat" : "", + "bin/aarch64-unknown-linux-gnu/resources.pak" : "", + "bin/aarch64-unknown-linux-gnu/chrome_100_percent.pak" : "", + "bin/aarch64-unknown-linux-gnu/chrome_200_percent.pak" : "", + "bin/aarch64-unknown-linux-gnu/locales" : "" +} +``` + +这些路径对应 `xtask/src/platform.rs` 中当前的 Windows/Linux 运行时资源列表。 +确认所有引用的文件和目录存在后再注册目标。debug/release 配置不会改变插件中的目标路径。 + +## 在目标系统验证 + +`cargo xtask pack` **只包含官方目标**,会忽略 Windows/Linux ARM64 构件, +不能用于打包你的 ARM64 私有插件。 +`cargo xtask validate` 同样只检查官方目标目录:混合插件验证成功不代表 ARM64 内容正确, +纯 ARM64 插件会报告找不到受支持平台目录。私有分发和验证需要自行维护。 + +在目标系统上使用匹配架构的原生 ARM64 Godot 编辑器和导出的游戏,检查扩展加载、helper 启动、 +网页渲染/输入,以及导出后的全部运行时依赖。 +Linux 可**在 ARM64 目标系统上**对 `libgdcef.so`、`gdcef_helper`、`libcef.so` 运行 `ldd`, +排查缺少的共享库。Windows 需要匹配的 MSVC 运行时和 CEF 依赖。 +交叉编译成功并不保证运行时兼容或导出资源完整。 + +Windows 和 Linux 的 Vulkan Hook 加速都要求 x86_64,因为 `retour` 不支持 ARM64。 +建议先使用软件渲染(`enable_accelerated_osr = false`);见 [Vulkan 支持](./vulkan-support)。 +本页不保证任何 ARM64 加速后端或模拟运行兼容性。自行验证所依赖的后端,并在升级时重新构建和维护二进制。 diff --git a/docs/zh_CN/api/vulkan-support.md b/docs/zh_CN/api/vulkan-support.md index c7543fc1..f2f8df4d 100644 --- a/docs/zh_CN/api/vulkan-support.md +++ b/docs/zh_CN/api/vulkan-support.md @@ -2,6 +2,8 @@ 本页面介绍 Godot CEF 如何通过运行时函数钩子在 Vulkan 后端启用 GPU 加速渲染,以及该方案的限制与注意事项。 +Windows/Linux ARM64 不是官方二进制目标;如需自行构建,见[不支持目标的自编译指南](./unsupported-targets)。 + ## 背景 CEF 中的 GPU 加速离屏渲染(OSR)需要在 CEF 渲染器进程和宿主应用程序(Godot)之间共享纹理。这通过平台特定的外部内存 API 实现: @@ -102,7 +104,8 @@ cat /sys/module/nvidia_drm/parameters/modeset 钩子机制依赖于 [retour](https://github.com/darfink/retour-rs) 库进行运行时函数重定向。该库目前不支持 ARM64 架构,这意味着: -- **Linux ARM64** — Vulkan 钩子不可用 +- **Windows ARM64(仅不支持的自编译目标)** — Vulkan 钩子不可用 +- **Linux ARM64(仅不支持的自编译目标)** — Vulkan 钩子不可用 - **macOS(Apple Silicon)** — Vulkan 钩子不可用 在不支持的架构上,扩展会自动回退到软件渲染。 @@ -144,7 +147,8 @@ cat /sys/module/nvidia_drm/parameters/modeset |------|------|-----------------|------| | Windows | x86_64 | ✅ 支持 | 通过 `vkCreateDevice` 扩展注入钩子 | | Linux | x86_64 | ✅ 支持 | 通过 `vkCreateDevice` 扩展注入钩子 | -| Linux | ARM64 | ❌ 不支持 | retour 不支持 ARM64 | +| Windows | ARM64 | ❌ 不支持 | 仅不支持的自编译目标;retour 不支持 ARM64 | +| Linux | ARM64 | ❌ 不支持 | 仅不支持的自编译目标;retour 不支持 ARM64 | | macOS | 任意 | ❌ 不适用 | MoltenVK 静态链接阻止钩子;使用 Metal 后端 | ## 未来:正式 Godot API diff --git a/xtask/src/bundle_linux.rs b/xtask/src/bundle_linux.rs index c42bb61f..beafada2 100644 --- a/xtask/src/bundle_linux.rs +++ b/xtask/src/bundle_linux.rs @@ -145,3 +145,31 @@ pub fn run( Ok(()) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn linux_arm64_target_remains_available_for_self_builds() + -> Result<(), Box> { + assert_eq!( + resolve_platform_target(Some(LINUX_ARM64_TARGET))?, + LINUX_ARM64_TARGET + ); + assert_eq!( + strip_tool_for_target(LINUX_ARM64_TARGET), + "aarch64-linux-gnu-strip" + ); + Ok(()) + } + + #[test] + fn linux_x64_target_remains_supported() -> Result<(), Box> { + assert_eq!( + resolve_platform_target(Some(LINUX_X64_TARGET))?, + LINUX_X64_TARGET + ); + Ok(()) + } +} diff --git a/xtask/src/bundle_windows.rs b/xtask/src/bundle_windows.rs index e22326b6..2a50fd93 100644 --- a/xtask/src/bundle_windows.rs +++ b/xtask/src/bundle_windows.rs @@ -4,21 +4,26 @@ use crate::bundle_common::{ copy_directory, deploy_to_addon, get_cef_dir, get_target_dir, get_target_dir_for_target, run_cargo, validate_required_paths, }; -use crate::platform::{WINDOWS_RUNTIME_ASSETS, WINDOWS_X64_TARGET}; +use crate::platform::{WINDOWS_ARM64_TARGET, WINDOWS_RUNTIME_ASSETS, WINDOWS_X64_TARGET}; use std::fs; use std::path::Path; +fn default_platform_target() -> &'static str { + if cfg!(target_arch = "aarch64") { + WINDOWS_ARM64_TARGET + } else { + WINDOWS_X64_TARGET + } +} + fn resolve_platform_target( target: Option<&str>, ) -> Result<&'static str, Box> { match target { Some(WINDOWS_X64_TARGET) => Ok(WINDOWS_X64_TARGET), + Some(WINDOWS_ARM64_TARGET) => Ok(WINDOWS_ARM64_TARGET), Some(other) => Err(format!("unsupported Windows target: {other}").into()), - None if cfg!(target_arch = "x86_64") => Ok(WINDOWS_X64_TARGET), - None => Err( - "native Windows bundling requires x86_64; Windows ARM64 support has been removed" - .into(), - ), + None => Ok(default_platform_target()), } } @@ -112,15 +117,18 @@ mod tests { } #[test] - fn windows_arm64_target_is_rejected() { - assert!(resolve_platform_target(Some("aarch64-pc-windows-msvc")).is_err()); + fn windows_arm64_target_remains_available_for_self_builds() + -> Result<(), Box> { + assert_eq!( + resolve_platform_target(Some(WINDOWS_ARM64_TARGET))?, + WINDOWS_ARM64_TARGET + ); + Ok(()) } #[test] - fn native_target_requires_x64_host() { - assert_eq!( - resolve_platform_target(None).is_ok(), - cfg!(target_arch = "x86_64") - ); + fn native_target_matches_host() -> Result<(), Box> { + assert_eq!(resolve_platform_target(None)?, default_platform_target()); + Ok(()) } } diff --git a/xtask/src/pack.rs b/xtask/src/pack.rs index 3101622e..d061b875 100644 --- a/xtask/src/pack.rs +++ b/xtask/src/pack.rs @@ -108,7 +108,7 @@ mod tests { use std::time::{SystemTime, UNIX_EPOCH}; #[test] - fn pack_retains_supported_platforms_and_omits_windows_arm64() + fn pack_retains_supported_platforms_and_omits_unsupported_arm64() -> Result<(), Box> { let root = std::env::temp_dir().join(format!( "gdcef-pack-platforms-{}-{}", @@ -117,10 +117,22 @@ mod tests { )); let artifacts = root.join("artifacts"); let output = root.join("addon"); - let removed_target = "aarch64-pc-windows-msvc"; + let removed_targets = ["aarch64-pc-windows-msvc", "aarch64-unknown-linux-gnu"]; // Both an old CI artifact and a previously staged bundle must be excluded. - fs::create_dir_all(artifacts.join(format!("gdcef-{removed_target}")))?; - fs::create_dir_all(output.join("bin").join(removed_target))?; + for target in removed_targets { + fs::create_dir_all(artifacts.join(format!("gdcef-{target}")))?; + fs::create_dir_all(output.join("bin").join(target))?; + fs::write( + artifacts + .join(format!("gdcef-{target}")) + .join("unsupported-binary"), + b"must not ship", + )?; + fs::write( + output.join("bin").join(target).join("unsupported-binary"), + b"must not ship", + )?; + } for platform in PLATFORM_SPECS { let source = artifacts.join(platform.artifact_name); fs::create_dir_all(&source)?; @@ -139,14 +151,17 @@ mod tests { "universal-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", - "aarch64-unknown-linux-gnu", ] { assert!(output.join("bin").join(target).is_dir()); } - assert!(!output.join("bin").join(removed_target).exists()); let manifest = fs::read_to_string(output.join("godot_cef.gdextension"))?; assert!(!manifest.contains("windows.arm64")); - assert!(!manifest.contains(removed_target)); + assert!(!manifest.contains("linux.arm64")); + assert_eq!(fs::read_dir(output.join("bin"))?.count(), 3); + for target in removed_targets { + assert!(!output.join("bin").join(target).exists()); + assert!(!manifest.contains(target)); + } Ok(()) })(); fs::remove_dir_all(&root)?; diff --git a/xtask/src/platform.rs b/xtask/src/platform.rs index 52c4ecd0..76a8c018 100644 --- a/xtask/src/platform.rs +++ b/xtask/src/platform.rs @@ -14,8 +14,12 @@ pub struct RuntimeAssetSpec { } pub const MACOS_UNIVERSAL_TARGET: &str = "universal-apple-darwin"; +// Retained for unsupported source bundling. +#[cfg(target_os = "windows")] +pub const WINDOWS_ARM64_TARGET: &str = "aarch64-pc-windows-msvc"; pub const WINDOWS_X64_TARGET: &str = "x86_64-pc-windows-msvc"; pub const LINUX_X64_TARGET: &str = "x86_64-unknown-linux-gnu"; +#[cfg(target_os = "linux")] pub const LINUX_ARM64_TARGET: &str = "aarch64-unknown-linux-gnu"; const MACOS_REQUIRED_FILES: &[&str] = &["Godot CEF.framework"]; @@ -24,6 +28,7 @@ const LINUX_REQUIRED_FILES: &[&str] = &["libgdcef.so", "gdcef_helper", "libcef.s const LOCALES_DIR: &[&str] = &["locales"]; const NO_REQUIRED_DIRS: &[&str] = &[]; +// Only these targets are included in official packaging and layout validation. pub const PLATFORM_SPECS: &[PlatformSpec] = &[ PlatformSpec { target: MACOS_UNIVERSAL_TARGET, @@ -43,12 +48,6 @@ pub const PLATFORM_SPECS: &[PlatformSpec] = &[ required_files: LINUX_REQUIRED_FILES, required_dirs: LOCALES_DIR, }, - PlatformSpec { - target: LINUX_ARM64_TARGET, - artifact_name: "gdcef-aarch64-unknown-linux-gnu", - required_files: LINUX_REQUIRED_FILES, - required_dirs: LOCALES_DIR, - }, ]; #[cfg(any(target_os = "windows", test))] @@ -171,7 +170,7 @@ mod tests { } } - for target in [LINUX_X64_TARGET, LINUX_ARM64_TARGET] { + for target in [LINUX_X64_TARGET] { let Some(spec) = platform_spec(target) else { assert!(platform_spec(target).is_some(), "linux spec should exist"); continue; From ec1d2fcd61d1727099e76a02971859613fece5e6 Mon Sep 17 00:00:00 2001 From: Delton Ding Date: Wed, 30 Sep 2026 23:31:17 +0800 Subject: [PATCH 3/4] test: remove supplementary ARM64 packaging regression --- xtask/src/pack.rs | 67 ----------------------------------------------- 1 file changed, 67 deletions(-) diff --git a/xtask/src/pack.rs b/xtask/src/pack.rs index d061b875..7b1c334e 100644 --- a/xtask/src/pack.rs +++ b/xtask/src/pack.rs @@ -101,70 +101,3 @@ pub fn run( Ok(()) } - -#[cfg(test)] -mod tests { - use super::*; - use std::time::{SystemTime, UNIX_EPOCH}; - - #[test] - fn pack_retains_supported_platforms_and_omits_unsupported_arm64() - -> Result<(), Box> { - let root = std::env::temp_dir().join(format!( - "gdcef-pack-platforms-{}-{}", - std::process::id(), - SystemTime::now().duration_since(UNIX_EPOCH)?.as_nanos() - )); - let artifacts = root.join("artifacts"); - let output = root.join("addon"); - let removed_targets = ["aarch64-pc-windows-msvc", "aarch64-unknown-linux-gnu"]; - // Both an old CI artifact and a previously staged bundle must be excluded. - for target in removed_targets { - fs::create_dir_all(artifacts.join(format!("gdcef-{target}")))?; - fs::create_dir_all(output.join("bin").join(target))?; - fs::write( - artifacts - .join(format!("gdcef-{target}")) - .join("unsupported-binary"), - b"must not ship", - )?; - fs::write( - output.join("bin").join(target).join("unsupported-binary"), - b"must not ship", - )?; - } - for platform in PLATFORM_SPECS { - let source = artifacts.join(platform.artifact_name); - fs::create_dir_all(&source)?; - for file in platform.required_files { - fs::write(source.join(file), b"fixture")?; - } - for dir in platform.required_dirs { - fs::create_dir_all(source.join(dir))?; - } - } - - let result = (|| -> Result<(), Box> { - run(&artifacts, &output, None)?; - crate::validate::run(&output)?; - for target in [ - "universal-apple-darwin", - "x86_64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", - ] { - assert!(output.join("bin").join(target).is_dir()); - } - let manifest = fs::read_to_string(output.join("godot_cef.gdextension"))?; - assert!(!manifest.contains("windows.arm64")); - assert!(!manifest.contains("linux.arm64")); - assert_eq!(fs::read_dir(output.join("bin"))?.count(), 3); - for target in removed_targets { - assert!(!output.join("bin").join(target).exists()); - assert!(!manifest.contains(target)); - } - Ok(()) - })(); - fs::remove_dir_all(&root)?; - result - } -} From bbc330a2ad648122f15ed2e12f955c11e42d0f1e Mon Sep 17 00:00:00 2001 From: Delton Ding Date: Wed, 30 Sep 2026 23:59:34 +0800 Subject: [PATCH 4/4] feat: ship full and Asset Store addon variants Preserve Windows and Linux ARM64 in full releases. Add an explicit Store variant with matching filtered GDExtension manifest, strict variant validation, separate staged archives, and both release assets. Follow PR #239 discussion with lublak and dsh0416. Keep the full package as the default and document package choice and source builds in English and Chinese. --- .github/actions/setup-rust-cef/action.yml | 5 +- .github/workflows/build.yml | 54 ++++-- .github/workflows/test.yml | 18 ++ CONTRIBUTING.md | 51 +++++- README.md | 15 +- addons/godot_cef/godot_cef.gdextension | 41 +++++ docs/.vitepress/config.mts | 4 +- docs/api/compatibility-matrix.md | 17 +- docs/api/distribution-variants.md | 178 ++++++++++++++++++++ docs/api/unsupported-targets.md | 190 ---------------------- docs/api/vulkan-support.md | 12 +- docs/zh_CN/api/compatibility-matrix.md | 13 +- docs/zh_CN/api/distribution-variants.md | 149 +++++++++++++++++ docs/zh_CN/api/unsupported-targets.md | 165 ------------------- docs/zh_CN/api/vulkan-support.md | 11 +- xtask/src/bundle_linux.rs | 28 ---- xtask/src/bundle_windows.rs | 30 ---- xtask/src/main.rs | 18 +- xtask/src/pack.rs | 53 +++++- xtask/src/platform.rs | 38 ++++- xtask/src/validate.rs | 39 ++++- 21 files changed, 642 insertions(+), 487 deletions(-) create mode 100644 docs/api/distribution-variants.md delete mode 100644 docs/api/unsupported-targets.md create mode 100644 docs/zh_CN/api/distribution-variants.md delete mode 100644 docs/zh_CN/api/unsupported-targets.md diff --git a/.github/actions/setup-rust-cef/action.yml b/.github/actions/setup-rust-cef/action.yml index ffb04504..30578541 100644 --- a/.github/actions/setup-rust-cef/action.yml +++ b/.github/actions/setup-rust-cef/action.yml @@ -47,7 +47,10 @@ runs: libxrandr-dev \ libgbm-dev \ libpango1.0-dev \ - libasound2-dev + libasound2-dev \ + gcc-aarch64-linux-gnu \ + g++-aarch64-linux-gnu \ + binutils-aarch64-linux-gnu - name: Setup mise toolchain uses: jdx/mise-action@v4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94569a02..50f46beb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,6 +120,9 @@ jobs: - target: x86_64-pc-windows-msvc cache_key: windows-x64 msvc_arch: x64 + - target: aarch64-pc-windows-msvc + cache_key: windows-arm64 + msvc_arch: amd64_arm64 steps: - name: Checkout repository @@ -160,6 +163,8 @@ jobs: include: - target: x86_64-unknown-linux-gnu cache_key: linux-x64 + - target: aarch64-unknown-linux-gnu + cache_key: linux-arm64 steps: - name: Checkout repository @@ -212,26 +217,37 @@ jobs: with: path: artifacts - - name: Pack Godot addon + - name: Pack full and Asset Store addons env: RUSTC_WRAPPER: sccache run: | - # Use staging directory to avoid deleting source addon files - mise exec -- cargo xtask pack \ - --artifacts artifacts \ - --output dist/addons/godot_cef \ - --addon-src addons/godot_cef - mise exec -- cargo xtask validate --addon dist/addons/godot_cef - # Use dist as ZIP root so Asset Library installs into res://addons/godot_cef. - zip -r godot_cef.zip dist - - - name: Upload packed addon + # Stage each variant independently; both ZIPs retain the existing dist/addons layout. + for variant in full store; do + mise exec -- cargo xtask pack \ + --artifacts artifacts \ + --output staging/$variant/dist/addons/godot_cef \ + --addon-src addons/godot_cef \ + --variant "$variant" + mise exec -- cargo xtask validate \ + --addon staging/$variant/dist/addons/godot_cef --variant "$variant" + done + (cd staging/full && zip -r ../../godot_cef.zip dist) + (cd staging/store && zip -r ../../godot_cef-store.zip dist) + + - name: Upload full addon uses: actions/upload-artifact@v7 with: name: godot_cef-addon path: godot_cef.zip retention-days: 30 + - name: Upload Asset Store addon + uses: actions/upload-artifact@v7 + with: + name: godot_cef-store-addon + path: godot_cef-store.zip + retention-days: 30 + release: needs: [pack] runs-on: ubuntu-latest @@ -248,8 +264,16 @@ jobs: name: godot_cef-addon path: . - - name: Rename addon with version - run: mv godot_cef.zip godot_cef-${{ github.ref_name }}.zip + - name: Download Asset Store addon + uses: actions/download-artifact@v8 + with: + name: godot_cef-store-addon + path: . + + - name: Rename addons with version + run: | + mv godot_cef.zip godot_cef-${{ github.ref_name }}.zip + mv godot_cef-store.zip godot_cef-store-${{ github.ref_name }}.zip - name: Create GitHub Release uses: softprops/action-gh-release@v3 @@ -258,4 +282,6 @@ jobs: draft: true # release is draft until it is manually published prerelease: ${{ contains(github.ref_name, '-') }} generate_release_notes: true - files: godot_cef-${{ github.ref_name }}.zip + files: | + godot_cef-${{ github.ref_name }}.zip + godot_cef-store-${{ github.ref_name }}.zip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 724afe07..1d45aa4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,10 +33,19 @@ jobs: cef_cache_key: windows-x64 can_run_tests: true msvc_arch: x64 + - target: aarch64-pc-windows-msvc + os: windows-latest + cef_cache_key: windows-arm64 + can_run_tests: false + msvc_arch: amd64_arm64 - target: x86_64-unknown-linux-gnu os: ubuntu-latest cef_cache_key: linux-x64 can_run_tests: true + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + cef_cache_key: linux-arm64 + can_run_tests: false runs-on: ${{ matrix.os }} name: Test (${{ matrix.target }}) @@ -106,10 +115,19 @@ jobs: name: Windows x64 cef_cache_key: windows-x64 msvc_arch: x64 + - os: windows-latest + target: aarch64-pc-windows-msvc + name: Windows ARM64 + cef_cache_key: windows-arm64 + msvc_arch: amd64_arm64 - os: ubuntu-latest target: x86_64-unknown-linux-gnu name: Linux x64 cef_cache_key: linux-x64 + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + name: Linux ARM64 + cef_cache_key: linux-arm64 runs-on: ${{ matrix.os }} name: Clippy (${{ matrix.name }}) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index adfd951e..999642f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,8 +58,19 @@ export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH" export LD_LIBRARY_PATH="$CEF_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ``` -Official Linux builds support x86_64. For unsupported Linux ARM64 source builds, -see [Building unsupported targets](docs/api/unsupported-targets.md). +For Linux ARM64 cross builds, download the matching CEF runtime and build with +the ARM64 Rust target: + +```bash +export CEF_PATH="$HOME/.local/share/cef_aarch64" +export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" +rustup target add aarch64-unknown-linux-gnu +cargo xtask bundle --release --target aarch64-unknown-linux-gnu +``` + +The repository config allows unresolved symbols from `libcef.so` during Linux +ARM64 cross linking, because those CEF system dependencies are provided by the +target ARM64 Linux runtime rather than the x64 build host. You'll also need system dependencies: @@ -70,6 +81,10 @@ sudo apt-get install -y \ libdrm-dev libxkbcommon-dev libxcomposite-dev \ libxdamage-dev libxrandr-dev libgbm-dev \ libpango1.0-dev libasound2-dev + +# Additional tools for Linux ARM64 cross builds +sudo apt-get install -y \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu ``` #### macOS @@ -94,9 +109,15 @@ export-cef-dir --version $env:CEF_VERSION --force $env:CEF_PATH $env:PATH="$env:PATH;$env:CEF_PATH" ``` -Official Windows builds support x86_64. The bundler still accepts Windows ARM64 -for unsupported source builds; see [Building unsupported targets](docs/api/unsupported-targets.md). -These local outputs are excluded from `cargo xtask pack` and official distributions. +For Windows ARM64 cross builds from an x64 Windows machine, use the ARM64 CEF +runtime and Rust target: + +```powershell +$env:CEF_PATH="$env:USERPROFILE/.local/share/cef_arm64" +export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH +rustup target add aarch64-pc-windows-msvc +cargo xtask bundle --release --target aarch64-pc-windows-msvc +``` ### Building @@ -274,6 +295,26 @@ For release or packaging changes, also run `cargo xtask pack` with the platform artifacts you changed and then `cargo xtask validate --addon` against the staged addon directory. +### Distribution variants + +`cargo xtask pack` defaults to the full addon, preserving all five platform +artifacts. For release packaging, stage and validate each variant independently: + +```bash +cargo xtask pack --artifacts artifacts --output staging/full/dist/addons/godot_cef --variant full +cargo xtask validate --addon staging/full/dist/addons/godot_cef --variant full +cargo xtask pack --artifacts artifacts --output staging/store/dist/addons/godot_cef --variant store +cargo xtask validate --addon staging/store/dist/addons/godot_cef --variant store +``` + +Variant validation requires every selected target and rejects excluded target +directories. Omit `--variant` for the existing partial-addon validation behavior. +The Store packer derives its descriptor from the full source manifest by removing +Windows/Linux ARM64 entries; do not install both descriptors in one Godot project. +See [Distribution variants](docs/api/distribution-variants.md) for archive layout, +architecture coverage, and manual ARM64 builds. CI builds all architectures and +publishes both package artifacts; this PR does not itself publish a release. + ### Lifecycle Cleanup Checklist When changing browser lifecycle code, preserve these cleanup invariants for `CefTexture`: diff --git a/README.md b/README.md index 9490983f..410e5361 100644 --- a/README.md +++ b/README.md @@ -92,14 +92,13 @@ For comprehensive API documentation, examples, and guides, visit the [full docum ## Platform Support -Official binary targets: Windows x86_64, Linux x86_64, and macOS universal -(x86_64/ARM64). **Breaking change:** official Windows ARM64 and Linux ARM64 builds, -packages, and Godot export registrations have been removed. Users needing these -targets can remain on an earlier release or follow the unsupported -[source-build guide](https://godotcef.org/api/unsupported-targets.html); local builds -require their own validation and manifest registration. Windows x86_64 emulation -is not a validated replacement. This distribution change may require a major -release; release planning is tracked in [#238](https://github.com/dsh0416/godot-cef/issues/238). +The default/full GitHub Release addon includes Windows x86_64/ARM64, Linux +x86_64/ARM64, and macOS universal (x86_64/ARM64). A separate **Asset Store** addon +includes Windows x86_64, Linux x86_64, and the same macOS universal framework to +reduce download size. Both packages install as `addons/godot_cef`; choose one. +ARM64 Windows/Linux users should use the full package. See +[Distribution variants](https://godotcef.org/api/distribution-variants.html) for +package names, local packaging commands and source-build instructions. | Platform | DirectX 12 | Metal | Vulkan | Software Rendering | |----------|------------|-------|--------|-------------------| diff --git a/addons/godot_cef/godot_cef.gdextension b/addons/godot_cef/godot_cef.gdextension index 948300bb..92189b08 100644 --- a/addons/godot_cef/godot_cef.gdextension +++ b/addons/godot_cef/godot_cef.gdextension @@ -5,8 +5,10 @@ reloadable = true [libraries] linux.x86_64 = "bin/x86_64-unknown-linux-gnu/libgdcef.so" +linux.arm64 = "bin/aarch64-unknown-linux-gnu/libgdcef.so" macos = "bin/universal-apple-darwin/Godot CEF.framework" windows.x86_64 = "bin/x86_64-pc-windows-msvc/gdcef.dll" +windows.arm64 = "bin/aarch64-pc-windows-msvc/gdcef.dll" [icons] CefTexture = "icons/webview.png" @@ -36,6 +38,28 @@ windows.x86_64 = { "bin/x86_64-pc-windows-msvc/vulkan-1.dll" : "" } +windows.arm64 = { + "bin/aarch64-pc-windows-msvc/gdcef.dll" : "", + "bin/aarch64-pc-windows-msvc/gdcef_helper.exe" : "", + + "bin/aarch64-pc-windows-msvc/locales" : "", + "bin/aarch64-pc-windows-msvc/bootstrap.exe" : "", + "bin/aarch64-pc-windows-msvc/bootstrapc.exe" : "", + "bin/aarch64-pc-windows-msvc/chrome_100_percent.pak" : "", + "bin/aarch64-pc-windows-msvc/chrome_200_percent.pak" : "", + "bin/aarch64-pc-windows-msvc/chrome_elf.dll" : "", + "bin/aarch64-pc-windows-msvc/d3dcompiler_47.dll" : "", + "bin/aarch64-pc-windows-msvc/dxcompiler.dll" : "", + "bin/aarch64-pc-windows-msvc/dxil.dll" : "", + "bin/aarch64-pc-windows-msvc/icudtl.dat" : "", + "bin/aarch64-pc-windows-msvc/libcef.dll" : "", + "bin/aarch64-pc-windows-msvc/resources.pak" : "", + "bin/aarch64-pc-windows-msvc/v8_context_snapshot.bin" : "", + "bin/aarch64-pc-windows-msvc/vk_swiftshader.dll" : "", + "bin/aarch64-pc-windows-msvc/vk_swiftshader_icd.json" : "", + "bin/aarch64-pc-windows-msvc/vulkan-1.dll" : "" +} + linux.x86_64 = { "bin/x86_64-unknown-linux-gnu/libgdcef.so" : "", "bin/x86_64-unknown-linux-gnu/gdcef_helper" : "", @@ -52,3 +76,20 @@ linux.x86_64 = { "bin/x86_64-unknown-linux-gnu/chrome_200_percent.pak" : "", "bin/x86_64-unknown-linux-gnu/locales" : "" } + +linux.arm64 = { + "bin/aarch64-unknown-linux-gnu/libgdcef.so" : "", + "bin/aarch64-unknown-linux-gnu/gdcef_helper" : "", + + "bin/aarch64-unknown-linux-gnu/chrome-sandbox" : "", + "bin/aarch64-unknown-linux-gnu/libcef.so" : "", + "bin/aarch64-unknown-linux-gnu/libvk_swiftshader.so" : "", + "bin/aarch64-unknown-linux-gnu/libvulkan.so.1" : "", + "bin/aarch64-unknown-linux-gnu/v8_context_snapshot.bin" : "", + "bin/aarch64-unknown-linux-gnu/vk_swiftshader_icd.json" : "", + "bin/aarch64-unknown-linux-gnu/icudtl.dat" : "", + "bin/aarch64-unknown-linux-gnu/resources.pak" : "", + "bin/aarch64-unknown-linux-gnu/chrome_100_percent.pak" : "", + "bin/aarch64-unknown-linux-gnu/chrome_200_percent.pak" : "", + "bin/aarch64-unknown-linux-gnu/locales" : "" +} diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index dc1ddae7..d15bc06f 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -51,7 +51,7 @@ export default withMermaid(defineConfig({ { text: '拖放', link: '/zh_CN/api/drag-and-drop' }, { text: '下载', link: '/zh_CN/api/downloads' }, { text: 'Vulkan 支持', link: '/zh_CN/api/vulkan-support' }, - { text: '不支持目标的自编译', link: '/zh_CN/api/unsupported-targets' }, + { text: '分发版本与源码构建', link: '/zh_CN/api/distribution-variants' }, { text: 'GPU 设备绑定', link: '/zh_CN/api/gpu-device-pinning' } ] } @@ -100,7 +100,7 @@ export default withMermaid(defineConfig({ { text: 'Drag and Drop', link: '/api/drag-and-drop' }, { text: 'Downloads', link: '/api/downloads' }, { text: 'Vulkan Support', link: '/api/vulkan-support' }, - { text: 'Building Unsupported Targets', link: '/api/unsupported-targets' }, + { text: 'Distribution Variants', link: '/api/distribution-variants' }, { text: 'GPU Device Pinning', link: '/api/gpu-device-pinning' } ] } diff --git a/docs/api/compatibility-matrix.md b/docs/api/compatibility-matrix.md index 02c15e06..829fd437 100644 --- a/docs/api/compatibility-matrix.md +++ b/docs/api/compatibility-matrix.md @@ -2,13 +2,9 @@ This matrix summarizes the expected rendering mode behavior for each platform/backend combination. -Official binary targets: Windows x86_64, Linux x86_64, and macOS universal -(x86_64/ARM64). **Breaking change:** official Windows ARM64 and Linux ARM64 builds, -packages, and Godot export registrations have been removed. Users can remain on -an earlier release or follow the [unsupported source-build guide](./unsupported-targets), -register their own manifest, and validate their results. Windows x86_64 emulation -is unverified. This distribution change may require a major release; see -[#238](https://github.com/dsh0416/godot-cef/issues/238). +This page covers architectures in the full GitHub Release addon. The smaller +Asset Store addon omits Windows/Linux ARM64; use the full package for those +targets. See [Distribution variants](./distribution-variants). ## Version Baseline @@ -27,12 +23,15 @@ This keeps the downloaded runtime files aligned with the Rust bindings. |----------|--------------|---------------|-----------------|-----------------| | Windows | x86_64 | Direct3D12 | Yes | Accelerated | | Windows | x86_64 | Vulkan | Yes (hook-based) | Accelerated | -| Windows | x86_64 | OpenGL | No | Software fallback | +| Windows | ARM64 | Direct3D12 | Yes | Accelerated | +| Windows | any | OpenGL | No | Software fallback | +| Windows | ARM64 | Vulkan | No (hooks unsupported) | Software fallback | | macOS | any | Metal | Yes | Accelerated | | macOS | any | Vulkan | No | Software fallback | | macOS | any | OpenGL | No | Software fallback | | Linux | x86_64 | Vulkan | Yes (hook-based) | Accelerated | -| Linux | x86_64 | OpenGL | No | Software fallback | +| Linux | any | OpenGL | No | Software fallback | +| Linux | ARM64 | Vulkan | No (hooks unsupported) | Software fallback | ## Fallback Conditions diff --git a/docs/api/distribution-variants.md b/docs/api/distribution-variants.md new file mode 100644 index 00000000..4b6f79c4 --- /dev/null +++ b/docs/api/distribution-variants.md @@ -0,0 +1,178 @@ +--- +title: Distribution Variants +description: Choose the full GitHub Release or smaller Asset Store addon and build custom ARM64 binaries. +--- + +# Distribution variants + +Godot CEF builds every supported architecture and produces two distribution +packages to address the Asset Store size limit. The full package continues to +provide Windows/Linux ARM64 binaries. This approach preserves platform support +and the default full-package behavior. See [#238](https://github.com/dsh0416/godot-cef/issues/238) +and [#239](https://github.com/dsh0416/godot-cef/pull/239) for the discussion. + +| Package | Release filename | Platform directories | +|---|---|---| +| Full (default) | `godot_cef-v.zip` | Windows x86_64/ARM64, Linux x86_64/ARM64, macOS universal | +| Asset Store | `godot_cef-store-v.zip` | Windows x86_64, Linux x86_64, macOS universal | + +macOS universal always includes x86_64 and ARM64. CI uploads separate ZIP +artifacts named `godot_cef-addon` and `godot_cef-store-addon`. The tag release +workflow attaches both to a draft release; PR builds do not publish releases. + +## Choose or switch packages + +Use the **full package** for native Windows/Linux ARM64 Godot editors or exports. +The Store package has no registrations for those architectures, so native ARM64 +processes cannot load the extension from it. Windows x86_64 emulation is not a +replacement validated by this change. + +Both ZIPs preserve the existing `dist/addons/godot_cef/` archive layout and install +as `addons/godot_cef/` in the project. Each package contains one +`godot_cef.gdextension` descriptor whose registrations match its binaries. +Back up local changes and **replace the whole addon directory** when switching +packages instead of extracting over an older installation. Do not install both +addon copies or descriptors together, as they register the same extension classes. + +The full descriptor comes from `addons/godot_cef/godot_cef.gdextension` in the +repository. The Store packer automatically removes Windows/Linux ARM64 library +entries and dependency dictionaries and does not copy those architecture +artifacts. Both packages share a version and API; architecture coverage differs. +Measure the final ZIP size from the actual build: a smaller target set does not +by itself confirm compliance with the Asset Store's exact byte limit. + +## Generate both packages locally + +Inputs use `artifacts/gdcef-/`, containing the extension, helper and CEF +runtime assets for that target. `cargo xtask pack` defaults to `full`, preserving +existing behavior; the Store variant is explicit. From the repository root with +the mise environment active: + +```bash +cargo xtask pack --artifacts artifacts --output staging/full/dist/addons/godot_cef --variant full +cargo xtask validate --addon staging/full/dist/addons/godot_cef --variant full +cargo xtask pack --artifacts artifacts --output staging/store/dist/addons/godot_cef --variant store +cargo xtask validate --addon staging/store/dist/addons/godot_cef --variant store +(cd staging/full && zip -r ../../godot_cef.zip dist) +(cd staging/store && zip -r ../../godot_cef-store.zip dist) +``` + +The input targets are `universal-apple-darwin`, `x86_64-pc-windows-msvc`, +`aarch64-pc-windows-msvc`, `x86_64-unknown-linux-gnu`, and +`aarch64-unknown-linux-gnu`. `validate --variant` requires every selected target +and rejects excluded target directories. Omitting `--variant` preserves the +existing partial-addon validation behavior. Packing recreates the output +folder; stage separately and do not use the source addon directory as output. + +## Custom ARM64 source builds + +Most users can choose the full prebuilt package. If you need to maintain your own +build, the existing source entry points are shown below. These commands were +reviewed against current build inputs and runtime layout; local verification did +not compile ARM64 binaries or run an ARM64 editor/rendering/export. Full platform +builds are checked by PR CI. You must still verify compiler/runtime availability +and compatibility with the destination system. + +## Common prerequisites + +Use a clean checkout of the exact tag or commit you intend to maintain. Install +Git and mise, then run commands from the repository root. `mise install` provides +the Rust nightly and `export-cef-dir` pinned by `mise.toml`. Use that checkout's +`CEF_VERSION`, not an arbitrary newer CEF runtime. A C++ compiler, CMake, and +Godot 4.5+ for the target OS/architecture are also required. Builds can consume +substantial disk space and memory. + +`cargo xtask bundle` dispatches by the **host OS**: use Windows for Windows +builds and Linux for Linux builds. Passing a Windows/Linux target on macOS does +not provide a cross-OS build path. + +## Windows ARM64 from a Windows x64 host + +Install Visual Studio 2022 Build Tools with Desktop development with C++, the +MSVC ARM64 build tools and a Windows SDK. Use a Developer Command Prompt configured +for x64-host/ARM64-target (`amd64_arm64`). For example, in `cmd.exe`, replace the +installation path with your actual Visual Studio location, then launch PowerShell +from that configured prompt so it inherits the compiler environment: + +```bat +call "\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 +pwsh -NoProfile +``` + +Install CMake and PowerShell 7 (`pwsh`) and make them available on `PATH`. Run: + +```powershell +mise trust +mise install +mise exec -- pwsh -NoProfile +# The following commands run inside this mise environment. +$env:CEF_PATH = "$env:USERPROFILE/.local/share/cef_windows_arm64" +export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH +rustup target add aarch64-pc-windows-msvc +cargo xtask bundle --release --target aarch64-pc-windows-msvc +``` + +Do not point `CEF_PATH` at an x64 runtime. The bundled output includes the helper, +DLLs, locales and CEF resources, and is deployed to +`addons/godot_cef/bin/aarch64-pc-windows-msvc/`. Cargo's target build output is +`target/aarch64-pc-windows-msvc/release/` with the default target directory. +A native Windows ARM64 host requires an ARM64-host/ARM64-target developer +environment and matching native tools; that host setup is not validated here. + +## Linux ARM64 from a Linux x64 host + +For a Debian/Ubuntu-style host, install the ordinary build dependencies and the +ARM64 cross compiler/binutils: + +```bash +sudo apt-get update +sudo apt-get install -y build-essential cmake libgtk-3-dev libnss3-dev \ + libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev \ + libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ + libgbm-dev libpango1.0-dev libasound2-dev \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +mise trust +mise install +mise exec -- bash +# The following commands run inside this mise environment. +export CEF_PATH="$HOME/.local/share/cef_linux_arm64" +export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc +export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ +export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" +rustup target add aarch64-unknown-linux-gnu +cargo xtask bundle --release --target aarch64-unknown-linux-gnu +``` + +The repository's `.cargo/config.toml` selects `aarch64-linux-gnu-gcc` and permits +unresolved dependencies from `libcef.so` during cross linking. Those libraries +must still exist on the target system. Host development packages alone do not +supply an ARM64 runtime/sysroot; install target-architecture dependencies or +configure a compatible ARM64 sysroot if required by the compiler or CEF build. +Check the CEF runtime's glibc/system-library requirements against the destination. + +The Linux bundler uses `aarch64-linux-gnu-strip`, copies runtime assets and deploys +to `addons/godot_cef/bin/aarch64-unknown-linux-gnu/`. Cargo's default target output +is `target/aarch64-unknown-linux-gnu/release/`. A native Linux ARM64 build is also +accepted, but the current linker/strip configuration still requires the named +`aarch64-linux-gnu-*` tools; adjust your local toolchain if your distribution uses +other names. No native ARM64 host setup is validated here. + +## Install and validate a custom build + +`cargo xtask bundle` deploys the complete runtime to the repository's +`addons/godot_cef/bin//`. Copy the whole `addons/godot_cef/` into the project, +or copy the target directory into a full addon from the same commit. The full +repository descriptor already registers Windows/Linux ARM64; no manual manifest +entries are needed. If you previously used a Store package, switch to the full +descriptor and ensure its referenced target files match your deployed contents. +Do not copy only the extension DLL/SO without dependencies, or enable two +`.gdextension` descriptors together. Preserve Linux helper and `chrome-sandbox` +executable permissions. + +On the ARM64 destination, verify native Godot editor and exported-game extension +loading, helper startup, page rendering/input and exported runtime dependencies. +On Linux, run `ldd` on `libgdcef.so`, `gdcef_helper` and `libcef.so` on that +ARM64 system. Windows needs the matching MSVC runtime and CEF dependencies. +Cross-compilation success does not guarantee editor/export runtime compatibility. +Windows/Linux Vulkan hook acceleration still requires x86_64; start ARM64 runtime +validation with software rendering; see [Vulkan support](./vulkan-support). diff --git a/docs/api/unsupported-targets.md b/docs/api/unsupported-targets.md deleted file mode 100644 index fc949d1d..00000000 --- a/docs/api/unsupported-targets.md +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: Building Unsupported Targets -description: Build Windows ARM64 and Linux ARM64 from source for a privately maintained Godot CEF addon. ---- - -# Building unsupported targets - -Official binaries and CI cover Windows x86_64, Linux x86_64, and macOS universal -(x86_64/ARM64). Windows ARM64 and Linux ARM64 are no longer built or distributed -in official addons. Removing those binary targets is a **breaking distribution -change** and may require a major release; see [#238](https://github.com/dsh0416/godot-cef/issues/238). - -The source bundlers still accept both ARM64 targets for users maintaining their -own addon. This is a best-effort source-build path, not an officially tested -platform. The instructions follow the current bundler's target and runtime asset -layout; ARM64 builds, editor startup, rendering and exports have not been validated -for this change. Availability of a matching CEF runtime and a working target -compiler/sysroot remains a prerequisite. Keep an earlier release if you cannot -validate a replacement. Windows x86_64 emulation is also unvalidated. - -## Common prerequisites - -Use a clean checkout of the exact tag or commit you intend to maintain. Install -Git and mise, then run commands from the repository root. `mise install` provides -the Rust nightly and `export-cef-dir` pinned by `mise.toml`. Use that checkout's -`CEF_VERSION`, not an arbitrary newer CEF runtime. A C++ compiler, CMake, and -Godot 4.5+ for the target OS/architecture are also required. Builds can consume -substantial disk space and memory. - -`cargo xtask bundle` dispatches by the **host OS**: use Windows for Windows -builds and Linux for Linux builds. Passing a Windows/Linux target on macOS does -not provide a cross-OS build path. - -## Windows ARM64 from a Windows x64 host - -Install Visual Studio 2022 Build Tools with Desktop development with C++, the -MSVC ARM64 build tools and a Windows SDK. Use a Developer Command Prompt configured -for x64-host/ARM64-target (`amd64_arm64`). For example, in `cmd.exe`, replace the -installation path with your actual Visual Studio location, then launch PowerShell -from that configured prompt so it inherits the compiler environment: - -```bat -call "\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 -pwsh -NoProfile -``` - -Install CMake and PowerShell 7 (`pwsh`) and make them available on `PATH`. Run: - -```powershell -mise trust -mise install -mise exec -- pwsh -NoProfile -# The following commands run inside this mise environment. -$env:CEF_PATH = "$env:USERPROFILE/.local/share/cef_windows_arm64" -export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH -rustup target add aarch64-pc-windows-msvc -cargo xtask bundle --release --target aarch64-pc-windows-msvc -``` - -Do not point `CEF_PATH` at an x64 runtime. The bundled output includes the helper, -DLLs, locales and CEF resources, and is deployed to -`addons/godot_cef/bin/aarch64-pc-windows-msvc/`. Cargo's target build output is -`target/aarch64-pc-windows-msvc/release/` with the default target directory. -A native Windows ARM64 host requires an ARM64-host/ARM64-target developer -environment and matching native tools; that host setup is not validated here. - -## Linux ARM64 from a Linux x64 host - -For a Debian/Ubuntu-style host, install the ordinary build dependencies and the -ARM64 cross compiler/binutils: - -```bash -sudo apt-get update -sudo apt-get install -y build-essential cmake libgtk-3-dev libnss3-dev \ - libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev \ - libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ - libgbm-dev libpango1.0-dev libasound2-dev \ - gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu -mise trust -mise install -mise exec -- bash -# The following commands run inside this mise environment. -export CEF_PATH="$HOME/.local/share/cef_linux_arm64" -export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc -export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ -export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" -rustup target add aarch64-unknown-linux-gnu -cargo xtask bundle --release --target aarch64-unknown-linux-gnu -``` - -The repository's `.cargo/config.toml` selects `aarch64-linux-gnu-gcc` and permits -unresolved dependencies from `libcef.so` during cross linking. Those libraries -must still exist on the target system. Host development packages alone do not -supply an ARM64 runtime/sysroot; install target-architecture dependencies or -configure a compatible ARM64 sysroot if required by the compiler or CEF build. -Check the CEF runtime's glibc/system-library requirements against the destination. - -The Linux bundler uses `aarch64-linux-gnu-strip`, copies runtime assets and deploys -to `addons/godot_cef/bin/aarch64-unknown-linux-gnu/`. Cargo's default target output -is `target/aarch64-unknown-linux-gnu/release/`. A native Linux ARM64 build is also -accepted, but the current linker/strip configuration still requires the named -`aarch64-linux-gnu-*` tools; adjust your local toolchain if your distribution uses -other names. No native ARM64 host setup is validated here. - -## Install and register your local addon - -Copy the repository's whole `addons/godot_cef/` directory to your Godot project's -`addons/godot_cef/`, or copy the complete ARM64 `bin//` directory into an -existing addon from the same commit. Keep helper executables, locale directories -and every runtime resource beside the extension library. Preserve Linux executable -permissions when copying or archiving `gdcef_helper` and `chrome-sandbox`. - -The official `godot_cef.gdextension` intentionally has no ARM64 Windows/Linux -entries. In **your local copy**, add the relevant library entry to the existing -`[libraries]` section and its dependency block to the existing `[dependencies]` -section. The example shows both targets; include only the target(s) you built. -Do not duplicate section headers or remove supported entries that your project -still needs. - -```ini -[libraries] -windows.arm64 = "bin/aarch64-pc-windows-msvc/gdcef.dll" -linux.arm64 = "bin/aarch64-unknown-linux-gnu/libgdcef.so" - -[dependencies] -windows.arm64 = { - "bin/aarch64-pc-windows-msvc/gdcef.dll" : "", - "bin/aarch64-pc-windows-msvc/gdcef_helper.exe" : "", - - "bin/aarch64-pc-windows-msvc/locales" : "", - "bin/aarch64-pc-windows-msvc/bootstrap.exe" : "", - "bin/aarch64-pc-windows-msvc/bootstrapc.exe" : "", - "bin/aarch64-pc-windows-msvc/chrome_100_percent.pak" : "", - "bin/aarch64-pc-windows-msvc/chrome_200_percent.pak" : "", - "bin/aarch64-pc-windows-msvc/chrome_elf.dll" : "", - "bin/aarch64-pc-windows-msvc/d3dcompiler_47.dll" : "", - "bin/aarch64-pc-windows-msvc/dxcompiler.dll" : "", - "bin/aarch64-pc-windows-msvc/dxil.dll" : "", - "bin/aarch64-pc-windows-msvc/icudtl.dat" : "", - "bin/aarch64-pc-windows-msvc/libcef.dll" : "", - "bin/aarch64-pc-windows-msvc/resources.pak" : "", - "bin/aarch64-pc-windows-msvc/v8_context_snapshot.bin" : "", - "bin/aarch64-pc-windows-msvc/vk_swiftshader.dll" : "", - "bin/aarch64-pc-windows-msvc/vk_swiftshader_icd.json" : "", - "bin/aarch64-pc-windows-msvc/vulkan-1.dll" : "" -} - -linux.arm64 = { - "bin/aarch64-unknown-linux-gnu/libgdcef.so" : "", - "bin/aarch64-unknown-linux-gnu/gdcef_helper" : "", - - "bin/aarch64-unknown-linux-gnu/chrome-sandbox" : "", - "bin/aarch64-unknown-linux-gnu/libcef.so" : "", - "bin/aarch64-unknown-linux-gnu/libvk_swiftshader.so" : "", - "bin/aarch64-unknown-linux-gnu/libvulkan.so.1" : "", - "bin/aarch64-unknown-linux-gnu/v8_context_snapshot.bin" : "", - "bin/aarch64-unknown-linux-gnu/vk_swiftshader_icd.json" : "", - "bin/aarch64-unknown-linux-gnu/icudtl.dat" : "", - "bin/aarch64-unknown-linux-gnu/resources.pak" : "", - "bin/aarch64-unknown-linux-gnu/chrome_100_percent.pak" : "", - "bin/aarch64-unknown-linux-gnu/chrome_200_percent.pak" : "", - "bin/aarch64-unknown-linux-gnu/locales" : "" -} -``` - -These paths match the current Windows/Linux runtime asset lists in -`xtask/src/platform.rs`. Do not register a target until all referenced files and -directories exist. Build/debug profile changes do not change the addon paths. - -## Validate on the destination - -`cargo xtask pack` includes **only official targets** and intentionally ignores -ARM64 Windows/Linux artifacts. It cannot package your private ARM64 addon. -`cargo xtask validate` also checks only official target directories; a success -for a mixed addon does not validate its ARM64 contents, and an ARM64-only addon -will report no supported platform directories. Keep private distribution and -validation under your own control. - -Run the matching native ARM64 Godot editor and exported game on the destination, -verify extension loading, helper startup, page rendering/input and all exported -runtime dependencies. For Linux, use `ldd` on `libgdcef.so`, `gdcef_helper` and -`libcef.so` **on the ARM64 destination** to diagnose missing shared libraries. -Windows requires the matching MSVC runtime and CEF dependencies. Cross compilation -success alone proves neither runtime compatibility nor export completeness. - -Vulkan hook-based acceleration requires x86_64 on both Windows and Linux because -`retour` does not support ARM64. Start with software rendering -(`enable_accelerated_osr = false`); see [Vulkan support](./vulkan-support). No ARM64 -accelerated backend or emulation compatibility is promised by this guide. Test -any backend you rely on and maintain your own rebuilt binaries across upgrades. diff --git a/docs/api/vulkan-support.md b/docs/api/vulkan-support.md index f47ac4df..6df3565a 100644 --- a/docs/api/vulkan-support.md +++ b/docs/api/vulkan-support.md @@ -2,7 +2,9 @@ This page documents how Godot CEF enables GPU-accelerated rendering on Vulkan backends through runtime function hooking, and the limitations of this approach. -Windows/Linux ARM64 are not official binary targets; see [Building unsupported targets](./unsupported-targets) for private source builds. +This page covers architectures in the full GitHub Release addon. The smaller +Asset Store addon omits Windows/Linux ARM64; use the full package for those +targets. See [Distribution variants](./distribution-variants). ## Background @@ -104,8 +106,8 @@ Vulkan hook-based acceleration is **only available on x86_64 (64-bit x86) archit The hooking mechanism relies on the [retour](https://github.com/darfink/retour-rs) library for runtime function detouring. This library currently does not support ARM64 architecture, which means: -- **Windows ARM64 (unsupported self-build only)** — Vulkan hooks not available -- **Linux ARM64 (unsupported self-build only)** — Vulkan hooks not available +- **Windows ARM64** — Vulkan hooks not available +- **Linux ARM64** — Vulkan hooks not available - **macOS (Apple Silicon)** — Vulkan hooks not available On unsupported architectures, the extension automatically falls back to software rendering. @@ -146,9 +148,9 @@ If you experience issues with accelerated rendering, try: | Platform | Architecture | Vulkan Accelerated OSR | Notes | |----------|--------------|------------------------|-------| | Windows | x86_64 | ✅ Supported | Via `vkCreateDevice` extension injection hook | +| Windows | ARM64 | ❌ Not supported | retour doesn't support ARM64 | | Linux | x86_64 | ✅ Supported | Via `vkCreateDevice` extension injection hook | -| Windows | ARM64 | ❌ Not supported | Unsupported self-build only; retour does not support ARM64 | -| Linux | ARM64 | ❌ Not supported | Unsupported self-build only; retour does not support ARM64 | +| Linux | ARM64 | ❌ Not supported | retour doesn't support ARM64 | | macOS | Any | ❌ Not applicable | Static linking of MoltenVK prevents hooking; use Metal backend | ## Future: Proper Godot API diff --git a/docs/zh_CN/api/compatibility-matrix.md b/docs/zh_CN/api/compatibility-matrix.md index dffa7e8f..228b8f79 100644 --- a/docs/zh_CN/api/compatibility-matrix.md +++ b/docs/zh_CN/api/compatibility-matrix.md @@ -2,11 +2,8 @@ 该矩阵用于总结不同平台与渲染后端下,Godot CEF 的预期渲染行为。 -官方二进制目标:Windows x86_64、Linux x86_64、macOS universal(x86_64/ARM64)。 -**破坏性变更:**已停止 Windows ARM64 和 Linux ARM64 的官方构建、打包与 Godot 导出注册。 -需要这些目标的用户可以保留旧版本,或参考[不支持目标的自编译指南](./unsupported-targets), -自行构建、注册清单并验证运行情况。Windows x86_64 模拟运行不是已验证的替代方案。 -此分发变更可能需要新的主版本;见 [#238](https://github.com/dsh0416/godot-cef/issues/238)。 +本页包含完整 GitHub Release 包支持的架构。精简的 Asset Store 包不含 Windows/Linux ARM64; +需要这些架构时请选择完整包。详见[分发版本](./distribution-variants)。 ## 版本基线 @@ -25,12 +22,14 @@ export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH" |------|------|------------|----------|----------| | Windows | x86_64 | Direct3D12 | 支持 | 使用加速渲染 | | Windows | x86_64 | Vulkan | 支持(基于 Hook) | 使用加速渲染 | -| Windows | x86_64 | OpenGL | 不支持 | 回退到软件渲染 | +| Windows | 任意 | OpenGL | 不支持 | 回退到软件渲染 | +| Windows | ARM64 | Vulkan | 不支持 | 回退到软件渲染 | | macOS | 任意 | Metal | 支持 | 使用加速渲染 | | macOS | 任意 | Vulkan | 不支持 | 回退到软件渲染 | | macOS | 任意 | OpenGL | 不支持 | 回退到软件渲染 | | Linux | x86_64 | Vulkan | 支持(基于 Hook) | 使用加速渲染 | -| Linux | x86_64 | OpenGL | 不支持 | 回退到软件渲染 | +| Linux | 任意 | OpenGL | 不支持 | 回退到软件渲染 | +| Linux | ARM64 | Vulkan | 不支持 | 回退到软件渲染 | ## 回退条件 diff --git a/docs/zh_CN/api/distribution-variants.md b/docs/zh_CN/api/distribution-variants.md new file mode 100644 index 00000000..8cfa9ce9 --- /dev/null +++ b/docs/zh_CN/api/distribution-variants.md @@ -0,0 +1,149 @@ +--- +title: 分发版本与源码构建 +description: 选择完整 GitHub Release 或精简 Asset Store 插件,并构建自定义 ARM64 二进制。 +--- + +# 分发版本与源码构建 + +Godot CEF 构建全部受支持的架构,同时生成两个分发包,以应对 Asset Store 的版本大小限制。 +完整包继续提供 Windows/Linux ARM64 二进制。此方案不移除这些平台的支持,也不会改变完整包的默认行为。 +背景讨论见 [#238](https://github.com/dsh0416/godot-cef/issues/238) 和 [#239](https://github.com/dsh0416/godot-cef/pull/239)。 + +| 分发包 | Release 文件名 | 平台目录 | +|---|---|---| +| 完整包(默认) | `godot_cef-v.zip` | Windows x86_64/ARM64、Linux x86_64/ARM64、macOS universal | +| Asset Store 精简包 | `godot_cef-store-v.zip` | Windows x86_64、Linux x86_64、macOS universal | + +macOS universal 始终同时包含 x86_64 和 ARM64。CI 将两个 ZIP 作为独立构件上传,分别命名为 +`godot_cef-addon` 和 `godot_cef-store-addon`。标签的 release 流程会把两者附加到草稿 release; +构建 PR 不会发布 release。 + +## 选择与切换 + +需要 Windows/Linux ARM64 原生 Godot 编辑器或导出时,请下载**完整包**。 +Store 包不注册这两种架构,原生 ARM64 进程不能从中加载扩展。 +Windows x86_64 模拟运行不是经本次改动验证的替代方案。 + +两个 ZIP 都保持原有 `dist/addons/godot_cef/` 布局,并安装为项目中的 `addons/godot_cef/`。 +每个包只有一个名为 `godot_cef.gdextension` 的清单,其注册与包内二进制相符。 +切换版本时先备份本地修改,然后**替换整个插件目录**,不要叠加解压到旧目录。 +不要同时安装两个插件副本或清单,以免重复注册扩展类。 + +完整清单来自仓库 `addons/godot_cef/godot_cef.gdextension`。 +Store 打包器自动移除其中 Windows/Linux ARM64 库条目和依赖块,也不复制这两种架构的构件。 +两个分发包共享版本和 API;区别在于包含的架构。最终 ZIP 大小以实际构建测量为准, +更小的目标集合不代表已经确认满足 Asset Store 的精确字节限制。 + +## 在本地生成两种分发包 + +构件输入布局为 `artifacts/gdcef-/`,其中包含该目标的扩展、helper 和 CEF 运行时资源。 +`cargo xtask pack` 默认选择 `full`,保持此前行为;Store 版本需显式指定。 +在仓库根目录运行以下命令(已启用 mise 环境): + +```bash +cargo xtask pack --artifacts artifacts --output staging/full/dist/addons/godot_cef --variant full +cargo xtask validate --addon staging/full/dist/addons/godot_cef --variant full +cargo xtask pack --artifacts artifacts --output staging/store/dist/addons/godot_cef --variant store +cargo xtask validate --addon staging/store/dist/addons/godot_cef --variant store +(cd staging/full && zip -r ../../godot_cef.zip dist) +(cd staging/store && zip -r ../../godot_cef-store.zip dist) +``` + +输入目标为 `universal-apple-darwin`、`x86_64-pc-windows-msvc`、`aarch64-pc-windows-msvc`、 +`x86_64-unknown-linux-gnu` 和 `aarch64-unknown-linux-gnu`。 +使用 `validate --variant` 时,必须存在所选版本的全部目标,且不得包含被排除的目标目录。 +不传 `--variant` 则保留原有的部分插件验证行为。 +打包输出目录会被重建;请使用独立暂存目录,不要将源码插件目录作为输出。 + +## 自定义 ARM64 源码构建 + +通常直接使用完整的预编译包即可。需要自行维护构建时,可使用以下现有源码入口。 +命令按当前构建输入和资源布局整理;本地验证未执行 ARM64 编译、编辑器启动、渲染或导出, +完整平台构建由 PR CI 验证。编译器、CEF 可用性和目标系统运行时兼容性仍需自行确认。 + +## 通用前提 + +使用需要自行维护的确切 tag 或提交的干净 checkout。安装 Git 和 mise,并在仓库根目录运行命令。 +`mise install` 安装 `mise.toml` 固定的 Rust nightly 和 `export-cef-dir`。 +使用该 checkout 的 `CEF_VERSION`,不要随意换用较新的 CEF 运行时。 +还需要 C++ 编译器、CMake,以及目标系统/架构的 Godot 4.5+。构建可能占用较多磁盘和内存。 + +`cargo xtask bundle` 按**宿主操作系统**选择打包器:Windows 构建应在 Windows 上运行, +Linux 构建应在 Linux 上运行。在 macOS 上传入 Windows/Linux 目标并不能跨系统构建。 + +## 在 Windows x64 宿主上构建 Windows ARM64 + +安装 Visual Studio 2022 Build Tools 的“使用 C++ 的桌面开发”、MSVC ARM64 工具和 Windows SDK。 +使用配置为 x64 宿主、ARM64 目标(`amd64_arm64`)的开发者命令提示符。 +例如,在 `cmd.exe` 中将路径替换为实际 Visual Studio 安装位置,然后从该环境启动 PowerShell,继承编译器环境: + +```bat +call "\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 +pwsh -NoProfile +``` + +安装 CMake 和 PowerShell 7(`pwsh`),确保位于 `PATH`,然后运行: + +```powershell +mise trust +mise install +mise exec -- pwsh -NoProfile +# The following commands run inside this mise environment. +$env:CEF_PATH = "$env:USERPROFILE/.local/share/cef_windows_arm64" +export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH +rustup target add aarch64-pc-windows-msvc +cargo xtask bundle --release --target aarch64-pc-windows-msvc +``` + +不要让 `CEF_PATH` 指向 x64 运行时。打包器将扩展、helper、DLL、locales 和 CEF 资源复制到 +`addons/godot_cef/bin/aarch64-pc-windows-msvc/`。 +默认 Cargo 产物位于 `target/aarch64-pc-windows-msvc/release/`。 +在 Windows ARM64 原生宿主上构建需要 ARM64 宿主/ARM64 目标的开发环境及对应工具;本页未验证该宿主配置。 + +## 在 Linux x64 宿主上构建 Linux ARM64 + +以 Debian/Ubuntu 类宿主为例,安装常规依赖以及 ARM64 交叉编译器和 binutils: + +```bash +sudo apt-get update +sudo apt-get install -y build-essential cmake libgtk-3-dev libnss3-dev \ + libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev \ + libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ + libgbm-dev libpango1.0-dev libasound2-dev \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu +mise trust +mise install +mise exec -- bash +# The following commands run inside this mise environment. +export CEF_PATH="$HOME/.local/share/cef_linux_arm64" +export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc +export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ +export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" +rustup target add aarch64-unknown-linux-gnu +cargo xtask bundle --release --target aarch64-unknown-linux-gnu +``` + +仓库 `.cargo/config.toml` 选择 `aarch64-linux-gnu-gcc`,并允许交叉链接时 `libcef.so` +存在未解析的依赖。这些共享库仍必须在目标系统上可用。 +宿主开发包不等于 ARM64 运行时/sysroot;编译器或 CEF 构建需要时,请安装目标架构依赖, +或配置兼容的 ARM64 sysroot。核对目标系统是否满足 CEF 的 glibc 和系统库要求。 + +Linux 打包器使用 `aarch64-linux-gnu-strip`,将运行时资源部署到 +`addons/godot_cef/bin/aarch64-unknown-linux-gnu/`。 +默认 Cargo 产物位于 `target/aarch64-unknown-linux-gnu/release/`。 +打包器也接受 Linux ARM64 原生构建,但当前 linker/strip 配置仍要求上述 +`aarch64-linux-gnu-*` 工具名;发行版命名不同时需自行调整本地工具链。本页未验证原生 ARM64 宿主配置。 + +## 安装与验证自编译插件 + +`cargo xtask bundle` 将完整资源部署到仓库 `addons/godot_cef/bin//`。 +复制整个 `addons/godot_cef/` 到项目,或将目标目录复制到同一提交的完整插件。 +仓库的完整 `.gdextension` 已注册 Windows/Linux ARM64,无需手工添加清单条目。 +如果项目此前使用 Store 包,应切换为完整包的清单,并确保其引用的目标文件与实际部署相符。 +不要复制缺少依赖的扩展 DLL/SO,也不要同时启用两个 `.gdextension`。 +保留 Linux helper 和 `chrome-sandbox` 的可执行权限。 + +在目标系统上验证原生 ARM64 Godot 编辑器及导出游戏的扩展加载、helper 启动、网页渲染/输入、 +以及导出资源。Linux 可在 ARM64 目标系统上对 `libgdcef.so`、`gdcef_helper`、`libcef.so` 运行 `ldd`。 +Windows 需要匹配的 MSVC 运行时与 CEF 依赖。交叉编译成功不保证编辑器/导出运行时兼容。 +Windows/Linux 的 Vulkan Hook 加速仍要求 x86_64;ARM64 先用软件渲染验证,见 [Vulkan 支持](./vulkan-support)。 diff --git a/docs/zh_CN/api/unsupported-targets.md b/docs/zh_CN/api/unsupported-targets.md deleted file mode 100644 index 1db0930f..00000000 --- a/docs/zh_CN/api/unsupported-targets.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -title: 不支持目标的自编译 -description: 为自行维护的 Godot CEF 插件构建 Windows ARM64 和 Linux ARM64 二进制。 ---- - -# 不支持目标的自编译 - -官方二进制和 CI 仅覆盖 Windows x86_64、Linux x86_64、macOS universal(x86_64/ARM64)。 -官方插件不再构建或分发 Windows ARM64 和 Linux ARM64。 -移除这些二进制目标是**破坏性的分发变更**,可能需要发布新的主版本;见 [#238](https://github.com/dsh0416/godot-cef/issues/238)。 - -源码打包器仍接受这两种 ARM64 目标,供用户自行维护插件。这是尽力保留的源码构建入口, -不代表官方测试或支持。本页命令依据当前打包器的目标和资源布局整理;本次变更并未验证 -ARM64 构建、编辑器启动、渲染或导出。匹配版本的 CEF 运行时和可用的目标编译器/sysroot -仍是前提。无法验证替代构建时,请保留此前提供该目标的版本。Windows x86_64 模拟运行同样未经验证。 - -## 通用前提 - -使用需要自行维护的确切 tag 或提交的干净 checkout。安装 Git 和 mise,并在仓库根目录运行命令。 -`mise install` 安装 `mise.toml` 固定的 Rust nightly 和 `export-cef-dir`。 -使用该 checkout 的 `CEF_VERSION`,不要随意换用较新的 CEF 运行时。 -还需要 C++ 编译器、CMake,以及目标系统/架构的 Godot 4.5+。构建可能占用较多磁盘和内存。 - -`cargo xtask bundle` 按**宿主操作系统**选择打包器:Windows 构建应在 Windows 上运行, -Linux 构建应在 Linux 上运行。在 macOS 上传入 Windows/Linux 目标并不能跨系统构建。 - -## 在 Windows x64 宿主上构建 Windows ARM64 - -安装 Visual Studio 2022 Build Tools 的“使用 C++ 的桌面开发”、MSVC ARM64 工具和 Windows SDK。 -使用配置为 x64 宿主、ARM64 目标(`amd64_arm64`)的开发者命令提示符。 -例如,在 `cmd.exe` 中将路径替换为实际 Visual Studio 安装位置,然后从该环境启动 PowerShell,继承编译器环境: - -```bat -call "\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 -pwsh -NoProfile -``` - -安装 CMake 和 PowerShell 7(`pwsh`),确保位于 `PATH`,然后运行: - -```powershell -mise trust -mise install -mise exec -- pwsh -NoProfile -# The following commands run inside this mise environment. -$env:CEF_PATH = "$env:USERPROFILE/.local/share/cef_windows_arm64" -export-cef-dir --version $env:CEF_VERSION --target aarch64-pc-windows-msvc --force $env:CEF_PATH -rustup target add aarch64-pc-windows-msvc -cargo xtask bundle --release --target aarch64-pc-windows-msvc -``` - -不要让 `CEF_PATH` 指向 x64 运行时。打包器将扩展、helper、DLL、locales 和 CEF 资源复制到 -`addons/godot_cef/bin/aarch64-pc-windows-msvc/`。 -默认 Cargo 产物位于 `target/aarch64-pc-windows-msvc/release/`。 -在 Windows ARM64 原生宿主上构建需要 ARM64 宿主/ARM64 目标的开发环境及对应工具;本页未验证该宿主配置。 - -## 在 Linux x64 宿主上构建 Linux ARM64 - -以 Debian/Ubuntu 类宿主为例,安装常规依赖以及 ARM64 交叉编译器和 binutils: - -```bash -sudo apt-get update -sudo apt-get install -y build-essential cmake libgtk-3-dev libnss3-dev \ - libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev \ - libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ - libgbm-dev libpango1.0-dev libasound2-dev \ - gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu -mise trust -mise install -mise exec -- bash -# The following commands run inside this mise environment. -export CEF_PATH="$HOME/.local/share/cef_linux_arm64" -export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc -export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ -export-cef-dir --version "$CEF_VERSION" --target aarch64-unknown-linux-gnu --force "$CEF_PATH" -rustup target add aarch64-unknown-linux-gnu -cargo xtask bundle --release --target aarch64-unknown-linux-gnu -``` - -仓库 `.cargo/config.toml` 选择 `aarch64-linux-gnu-gcc`,并允许交叉链接时 `libcef.so` -存在未解析的依赖。这些共享库仍必须在目标系统上可用。 -宿主开发包不等于 ARM64 运行时/sysroot;编译器或 CEF 构建需要时,请安装目标架构依赖, -或配置兼容的 ARM64 sysroot。核对目标系统是否满足 CEF 的 glibc 和系统库要求。 - -Linux 打包器使用 `aarch64-linux-gnu-strip`,将运行时资源部署到 -`addons/godot_cef/bin/aarch64-unknown-linux-gnu/`。 -默认 Cargo 产物位于 `target/aarch64-unknown-linux-gnu/release/`。 -打包器也接受 Linux ARM64 原生构建,但当前 linker/strip 配置仍要求上述 -`aarch64-linux-gnu-*` 工具名;发行版命名不同时需自行调整本地工具链。本页未验证原生 ARM64 宿主配置。 - -## 安装并注册本地插件 - -把仓库整个 `addons/godot_cef/` 复制到 Godot 项目的 `addons/godot_cef/`, -或把完整 ARM64 `bin//` 目录复制到来自同一提交的已有插件。 -扩展旁应保留 helper、locales 目录和每个运行时资源。复制/归档 Linux -`gdcef_helper` 和 `chrome-sandbox` 时保留可执行权限。 - -官方 `godot_cef.gdextension` 不包含 Windows/Linux ARM64 注册。 -在**你的本地副本**已有 `[libraries]` 节添加对应库条目,并在已有 `[dependencies]` 节添加对应依赖块。 -下面示例包含两个目标,只添加实际构建的目标。不要重复节标题,也不要移除项目仍需使用的官方目标条目。 - -```ini -[libraries] -windows.arm64 = "bin/aarch64-pc-windows-msvc/gdcef.dll" -linux.arm64 = "bin/aarch64-unknown-linux-gnu/libgdcef.so" - -[dependencies] -windows.arm64 = { - "bin/aarch64-pc-windows-msvc/gdcef.dll" : "", - "bin/aarch64-pc-windows-msvc/gdcef_helper.exe" : "", - - "bin/aarch64-pc-windows-msvc/locales" : "", - "bin/aarch64-pc-windows-msvc/bootstrap.exe" : "", - "bin/aarch64-pc-windows-msvc/bootstrapc.exe" : "", - "bin/aarch64-pc-windows-msvc/chrome_100_percent.pak" : "", - "bin/aarch64-pc-windows-msvc/chrome_200_percent.pak" : "", - "bin/aarch64-pc-windows-msvc/chrome_elf.dll" : "", - "bin/aarch64-pc-windows-msvc/d3dcompiler_47.dll" : "", - "bin/aarch64-pc-windows-msvc/dxcompiler.dll" : "", - "bin/aarch64-pc-windows-msvc/dxil.dll" : "", - "bin/aarch64-pc-windows-msvc/icudtl.dat" : "", - "bin/aarch64-pc-windows-msvc/libcef.dll" : "", - "bin/aarch64-pc-windows-msvc/resources.pak" : "", - "bin/aarch64-pc-windows-msvc/v8_context_snapshot.bin" : "", - "bin/aarch64-pc-windows-msvc/vk_swiftshader.dll" : "", - "bin/aarch64-pc-windows-msvc/vk_swiftshader_icd.json" : "", - "bin/aarch64-pc-windows-msvc/vulkan-1.dll" : "" -} - -linux.arm64 = { - "bin/aarch64-unknown-linux-gnu/libgdcef.so" : "", - "bin/aarch64-unknown-linux-gnu/gdcef_helper" : "", - - "bin/aarch64-unknown-linux-gnu/chrome-sandbox" : "", - "bin/aarch64-unknown-linux-gnu/libcef.so" : "", - "bin/aarch64-unknown-linux-gnu/libvk_swiftshader.so" : "", - "bin/aarch64-unknown-linux-gnu/libvulkan.so.1" : "", - "bin/aarch64-unknown-linux-gnu/v8_context_snapshot.bin" : "", - "bin/aarch64-unknown-linux-gnu/vk_swiftshader_icd.json" : "", - "bin/aarch64-unknown-linux-gnu/icudtl.dat" : "", - "bin/aarch64-unknown-linux-gnu/resources.pak" : "", - "bin/aarch64-unknown-linux-gnu/chrome_100_percent.pak" : "", - "bin/aarch64-unknown-linux-gnu/chrome_200_percent.pak" : "", - "bin/aarch64-unknown-linux-gnu/locales" : "" -} -``` - -这些路径对应 `xtask/src/platform.rs` 中当前的 Windows/Linux 运行时资源列表。 -确认所有引用的文件和目录存在后再注册目标。debug/release 配置不会改变插件中的目标路径。 - -## 在目标系统验证 - -`cargo xtask pack` **只包含官方目标**,会忽略 Windows/Linux ARM64 构件, -不能用于打包你的 ARM64 私有插件。 -`cargo xtask validate` 同样只检查官方目标目录:混合插件验证成功不代表 ARM64 内容正确, -纯 ARM64 插件会报告找不到受支持平台目录。私有分发和验证需要自行维护。 - -在目标系统上使用匹配架构的原生 ARM64 Godot 编辑器和导出的游戏,检查扩展加载、helper 启动、 -网页渲染/输入,以及导出后的全部运行时依赖。 -Linux 可**在 ARM64 目标系统上**对 `libgdcef.so`、`gdcef_helper`、`libcef.so` 运行 `ldd`, -排查缺少的共享库。Windows 需要匹配的 MSVC 运行时和 CEF 依赖。 -交叉编译成功并不保证运行时兼容或导出资源完整。 - -Windows 和 Linux 的 Vulkan Hook 加速都要求 x86_64,因为 `retour` 不支持 ARM64。 -建议先使用软件渲染(`enable_accelerated_osr = false`);见 [Vulkan 支持](./vulkan-support)。 -本页不保证任何 ARM64 加速后端或模拟运行兼容性。自行验证所依赖的后端,并在升级时重新构建和维护二进制。 diff --git a/docs/zh_CN/api/vulkan-support.md b/docs/zh_CN/api/vulkan-support.md index f2f8df4d..df24b579 100644 --- a/docs/zh_CN/api/vulkan-support.md +++ b/docs/zh_CN/api/vulkan-support.md @@ -2,7 +2,8 @@ 本页面介绍 Godot CEF 如何通过运行时函数钩子在 Vulkan 后端启用 GPU 加速渲染,以及该方案的限制与注意事项。 -Windows/Linux ARM64 不是官方二进制目标;如需自行构建,见[不支持目标的自编译指南](./unsupported-targets)。 +本页包含完整 GitHub Release 包支持的架构。精简的 Asset Store 包不含 Windows/Linux ARM64; +需要这些架构时请选择完整包。详见[分发版本](./distribution-variants)。 ## 背景 @@ -104,8 +105,8 @@ cat /sys/module/nvidia_drm/parameters/modeset 钩子机制依赖于 [retour](https://github.com/darfink/retour-rs) 库进行运行时函数重定向。该库目前不支持 ARM64 架构,这意味着: -- **Windows ARM64(仅不支持的自编译目标)** — Vulkan 钩子不可用 -- **Linux ARM64(仅不支持的自编译目标)** — Vulkan 钩子不可用 +- **Windows ARM64** — Vulkan 钩子不可用 +- **Linux ARM64** — Vulkan 钩子不可用 - **macOS(Apple Silicon)** — Vulkan 钩子不可用 在不支持的架构上,扩展会自动回退到软件渲染。 @@ -146,9 +147,9 @@ cat /sys/module/nvidia_drm/parameters/modeset | 平台 | 架构 | Vulkan 加速 OSR | 备注 | |------|------|-----------------|------| | Windows | x86_64 | ✅ 支持 | 通过 `vkCreateDevice` 扩展注入钩子 | +| Windows | ARM64 | ❌ 不支持 | retour 不支持 ARM64 | | Linux | x86_64 | ✅ 支持 | 通过 `vkCreateDevice` 扩展注入钩子 | -| Windows | ARM64 | ❌ 不支持 | 仅不支持的自编译目标;retour 不支持 ARM64 | -| Linux | ARM64 | ❌ 不支持 | 仅不支持的自编译目标;retour 不支持 ARM64 | +| Linux | ARM64 | ❌ 不支持 | retour 不支持 ARM64 | | macOS | 任意 | ❌ 不适用 | MoltenVK 静态链接阻止钩子;使用 Metal 后端 | ## 未来:正式 Godot API diff --git a/xtask/src/bundle_linux.rs b/xtask/src/bundle_linux.rs index beafada2..c42bb61f 100644 --- a/xtask/src/bundle_linux.rs +++ b/xtask/src/bundle_linux.rs @@ -145,31 +145,3 @@ pub fn run( Ok(()) } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn linux_arm64_target_remains_available_for_self_builds() - -> Result<(), Box> { - assert_eq!( - resolve_platform_target(Some(LINUX_ARM64_TARGET))?, - LINUX_ARM64_TARGET - ); - assert_eq!( - strip_tool_for_target(LINUX_ARM64_TARGET), - "aarch64-linux-gnu-strip" - ); - Ok(()) - } - - #[test] - fn linux_x64_target_remains_supported() -> Result<(), Box> { - assert_eq!( - resolve_platform_target(Some(LINUX_X64_TARGET))?, - LINUX_X64_TARGET - ); - Ok(()) - } -} diff --git a/xtask/src/bundle_windows.rs b/xtask/src/bundle_windows.rs index 2a50fd93..d05615c3 100644 --- a/xtask/src/bundle_windows.rs +++ b/xtask/src/bundle_windows.rs @@ -102,33 +102,3 @@ pub fn run( Ok(()) } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn x64_target_is_supported() -> Result<(), Box> { - assert_eq!( - resolve_platform_target(Some(WINDOWS_X64_TARGET))?, - WINDOWS_X64_TARGET - ); - Ok(()) - } - - #[test] - fn windows_arm64_target_remains_available_for_self_builds() - -> Result<(), Box> { - assert_eq!( - resolve_platform_target(Some(WINDOWS_ARM64_TARGET))?, - WINDOWS_ARM64_TARGET - ); - Ok(()) - } - - #[test] - fn native_target_matches_host() -> Result<(), Box> { - assert_eq!(resolve_platform_target(None)?, default_platform_target()); - Ok(()) - } -} diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 0be1496f..629f025a 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -3,7 +3,7 @@ //! Usage: //! cargo xtask bundle [--release] [--target ] # Bundle for current platform and deploy to addons/ //! cargo xtask bundle-framework [--release] # Bundle framework (macOS only) -//! cargo xtask pack # Pack CI artifacts into distributable addon +//! cargo xtask pack --artifacts --output [--variant full|store] # Pack CI artifacts into distributable addon //! cargo xtask validate --addon # Validate addon artifact completeness //! cargo xtask validate-versions # Validate workspace/toolchain version pins @@ -22,6 +22,7 @@ mod validate; mod validate_versions; use clap::{Parser, Subcommand}; +use platform::PackageVariant; use std::path::PathBuf; #[derive(Parser)] @@ -73,6 +74,10 @@ enum Commands { /// Path to addon source files (gdextension, icons) #[arg(long)] addon_src: Option, + + /// Distribution variant (full includes every supported architecture) + #[arg(long, value_enum, default_value_t = PackageVariant::Full)] + variant: PackageVariant, }, /// Validate addon artifact completeness @@ -80,6 +85,10 @@ enum Commands { /// Path to addon directory containing bin/ outputs #[arg(long)] addon: PathBuf, + + /// Require all targets for this variant and reject excluded targets + #[arg(long, value_enum)] + variant: Option, }, /// Validate version and toolchain pins across workspace files @@ -132,11 +141,12 @@ fn main() -> Result<(), Box> { artifacts, output, addon_src, + variant, } => { - pack::run(&artifacts, &output, addon_src.as_deref())?; + pack::run(&artifacts, &output, addon_src.as_deref(), variant)?; } - Commands::Validate { addon } => { - validate::run(&addon)?; + Commands::Validate { addon, variant } => { + validate::run(&addon, variant)?; } Commands::ValidateVersions => { validate_versions::run()?; diff --git a/xtask/src/pack.rs b/xtask/src/pack.rs index 7b1c334e..0487da89 100644 --- a/xtask/src/pack.rs +++ b/xtask/src/pack.rs @@ -1,7 +1,7 @@ //! Pack command - assembles all platform artifacts into a single Godot addon use crate::bundle_common::{copy_directory, validate_required_paths}; -use crate::platform::{PLATFORM_SPECS, PlatformSpec}; +use crate::platform::{PLATFORM_SPECS, PackageVariant, PlatformSpec}; use std::fs; use std::path::Path; @@ -32,10 +32,48 @@ fn copy_platform_artifacts( Ok(true) } -fn copy_addon_files(addon_src: &Path, output_dir: &Path) -> Result<(), Box> { +fn manifest_for_variant( + manifest: &str, + variant: PackageVariant, +) -> Result> { + if variant == PackageVariant::Full { + return Ok(manifest.to_owned()); + } + + let mut result = String::new(); + let mut skipping_dictionary = false; + for line in manifest.split_inclusive('\n') { + let trimmed = line.trim(); + if skipping_dictionary { + if trimmed == "}" { + skipping_dictionary = false; + } + continue; + } + if let Some((key, value)) = trimmed.split_once('=') + && ["windows.arm64", "linux.arm64"].contains(&key.trim()) + { + // The source descriptor uses one-line library paths and multiline dependency dictionaries. + skipping_dictionary = value.trim() == "{"; + continue; + } + result.push_str(line); + } + if skipping_dictionary { + return Err("unterminated ARM64 dependency dictionary in GDExtension manifest".into()); + } + Ok(result) +} + +fn copy_addon_files( + addon_src: &Path, + output_dir: &Path, + variant: PackageVariant, +) -> Result<(), Box> { let gdext_src = addon_src.join("godot_cef.gdextension"); if gdext_src.exists() { - fs::copy(&gdext_src, output_dir.join("godot_cef.gdextension"))?; + let manifest = manifest_for_variant(&fs::read_to_string(&gdext_src)?, variant)?; + fs::write(output_dir.join("godot_cef.gdextension"), manifest)?; println!(" Copied: godot_cef.gdextension"); } @@ -56,8 +94,10 @@ pub fn run( artifacts_dir: &Path, output_dir: &Path, addon_src: Option<&Path>, + variant: PackageVariant, ) -> Result<(), Box> { println!("Packing Godot addon from artifacts..."); + println!(" Variant: {variant:?}"); println!(" Artifacts: {}", artifacts_dir.display()); println!(" Output: {}", output_dir.display()); @@ -68,7 +108,7 @@ pub fn run( fs::create_dir_all(&bin_dir)?; if let Some(addon_path) = addon_src { - copy_addon_files(addon_path, output_dir)?; + copy_addon_files(addon_path, output_dir, variant)?; } else { let workspace_addon = Path::new(env!("CARGO_MANIFEST_DIR")) .parent() @@ -78,12 +118,15 @@ pub fn run( ) .join("addons/godot_cef"); if workspace_addon.exists() { - copy_addon_files(&workspace_addon, output_dir)?; + copy_addon_files(&workspace_addon, output_dir, variant)?; } } let mut platforms_found = 0; for platform in PLATFORM_SPECS { + if !variant.includes(platform.target) { + continue; + } if copy_platform_artifacts(artifacts_dir, &bin_dir, platform)? { platforms_found += 1; } diff --git a/xtask/src/platform.rs b/xtask/src/platform.rs index 76a8c018..9633f4e2 100644 --- a/xtask/src/platform.rs +++ b/xtask/src/platform.rs @@ -1,3 +1,5 @@ +use clap::ValueEnum; + pub struct PlatformSpec { pub target: &'static str, pub artifact_name: &'static str, @@ -13,13 +15,24 @@ pub struct RuntimeAssetSpec { pub deploy_dirs: &'static [&'static str], } +/// Full releases preserve every supported target; the Store bundle omits Windows/Linux ARM64. +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, ValueEnum)] +pub enum PackageVariant { + #[default] + Full, + Store, +} + +impl PackageVariant { + pub fn includes(self, target: &str) -> bool { + self == Self::Full || ![WINDOWS_ARM64_TARGET, LINUX_ARM64_TARGET].contains(&target) + } +} + pub const MACOS_UNIVERSAL_TARGET: &str = "universal-apple-darwin"; -// Retained for unsupported source bundling. -#[cfg(target_os = "windows")] -pub const WINDOWS_ARM64_TARGET: &str = "aarch64-pc-windows-msvc"; pub const WINDOWS_X64_TARGET: &str = "x86_64-pc-windows-msvc"; +pub const WINDOWS_ARM64_TARGET: &str = "aarch64-pc-windows-msvc"; pub const LINUX_X64_TARGET: &str = "x86_64-unknown-linux-gnu"; -#[cfg(target_os = "linux")] pub const LINUX_ARM64_TARGET: &str = "aarch64-unknown-linux-gnu"; const MACOS_REQUIRED_FILES: &[&str] = &["Godot CEF.framework"]; @@ -28,7 +41,6 @@ const LINUX_REQUIRED_FILES: &[&str] = &["libgdcef.so", "gdcef_helper", "libcef.s const LOCALES_DIR: &[&str] = &["locales"]; const NO_REQUIRED_DIRS: &[&str] = &[]; -// Only these targets are included in official packaging and layout validation. pub const PLATFORM_SPECS: &[PlatformSpec] = &[ PlatformSpec { target: MACOS_UNIVERSAL_TARGET, @@ -42,12 +54,24 @@ pub const PLATFORM_SPECS: &[PlatformSpec] = &[ required_files: WINDOWS_REQUIRED_FILES, required_dirs: LOCALES_DIR, }, + PlatformSpec { + target: WINDOWS_ARM64_TARGET, + artifact_name: "gdcef-aarch64-pc-windows-msvc", + required_files: WINDOWS_REQUIRED_FILES, + required_dirs: LOCALES_DIR, + }, PlatformSpec { target: LINUX_X64_TARGET, artifact_name: "gdcef-x86_64-unknown-linux-gnu", required_files: LINUX_REQUIRED_FILES, required_dirs: LOCALES_DIR, }, + PlatformSpec { + target: LINUX_ARM64_TARGET, + artifact_name: "gdcef-aarch64-unknown-linux-gnu", + required_files: LINUX_REQUIRED_FILES, + required_dirs: LOCALES_DIR, + }, ]; #[cfg(any(target_os = "windows", test))] @@ -157,7 +181,7 @@ mod tests { #[test] fn runtime_assets_include_pack_validation_requirements() { - for target in [WINDOWS_X64_TARGET] { + for target in [WINDOWS_X64_TARGET, WINDOWS_ARM64_TARGET] { let Some(spec) = platform_spec(target) else { assert!(platform_spec(target).is_some(), "windows spec should exist"); continue; @@ -170,7 +194,7 @@ mod tests { } } - for target in [LINUX_X64_TARGET] { + for target in [LINUX_X64_TARGET, LINUX_ARM64_TARGET] { let Some(spec) = platform_spec(target) else { assert!(platform_spec(target).is_some(), "linux spec should exist"); continue; diff --git a/xtask/src/validate.rs b/xtask/src/validate.rs index 5c3ae145..ed80063e 100644 --- a/xtask/src/validate.rs +++ b/xtask/src/validate.rs @@ -1,10 +1,13 @@ //! Validation command - checks packaged addon layout and required artifacts use crate::bundle_common::validate_required_paths; -use crate::platform::PLATFORM_SPECS; +use crate::platform::{PLATFORM_SPECS, PackageVariant}; use std::path::Path; -pub fn run(addon_dir: &Path) -> Result<(), Box> { +pub fn run( + addon_dir: &Path, + variant: Option, +) -> Result<(), Box> { let bin_dir = addon_dir.join("bin"); if !bin_dir.exists() { return Err(format!( @@ -14,9 +17,41 @@ pub fn run(addon_dir: &Path) -> Result<(), Box> { .into()); } + if let Some(variant) = variant { + let manifest = std::fs::read_to_string(addon_dir.join("godot_cef.gdextension"))?; + for platform in PLATFORM_SPECS { + if manifest.contains(platform.target) != variant.includes(platform.target) { + return Err(format!( + "GDExtension manifest does not match {variant:?} target selection: {}", + platform.target + ) + .into()); + } + } + } + let mut validated = 0usize; for platform in PLATFORM_SPECS { let platform_dir = bin_dir.join(platform.target); + if let Some(variant) = variant { + if !variant.includes(platform.target) { + if platform_dir.exists() { + return Err(format!( + "excluded target present in {variant:?} addon: {}", + platform.target + ) + .into()); + } + continue; + } + if !platform_dir.exists() { + return Err(format!( + "missing required {variant:?} addon target: {}", + platform.target + ) + .into()); + } + } if !platform_dir.exists() { println!("Skipping {} (not present)", platform.target); continue;