add thunk-rs to support win7 (#812)
Some checks failed
EasyTier Core / pre_job (push) Has been cancelled
EasyTier GUI / pre_job (push) Has been cancelled
EasyTier Mobile / pre_job (push) Has been cancelled
EasyTier Test / pre_job (push) Has been cancelled
EasyTier Core / build_web (push) Has been cancelled
EasyTier Core / build (freebsd-13.2-x86_64, 13.2, ubuntu-22.04, x86_64-unknown-freebsd) (push) Has been cancelled
EasyTier Core / build (linux-aarch64, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-arm, ubuntu-22.04, arm-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armhf, ubuntu-22.04, arm-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-armv7, ubuntu-22.04, armv7-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armv7hf, ubuntu-22.04, armv7-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-mips, ubuntu-22.04, mips-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-mipsel, ubuntu-22.04, mipsel-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-x86_64, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (macos-aarch64, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (macos-x86_64, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (windows-arm64, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-i686, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-x86_64, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / core-result (push) Has been cancelled
EasyTier Core / magisk_build (push) Has been cancelled
EasyTier GUI / build-gui (linux-aarch64, aarch64-unknown-linux-gnu, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (linux-x86_64, x86_64-unknown-linux-gnu, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (macos-aarch64, aarch64-apple-darwin, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (macos-x86_64, x86_64-apple-darwin, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (windows-arm64, aarch64-pc-windows-msvc, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-i686, i686-pc-windows-msvc, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-x86_64, x86_64-pc-windows-msvc, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / gui-result (push) Has been cancelled
EasyTier Mobile / build-mobile (android, ubuntu-22.04, android) (push) Has been cancelled
EasyTier Mobile / mobile-result (push) Has been cancelled
EasyTier Test / test (push) Has been cancelled

* add thunk-rs to support win7
---------

Co-authored-by: loecomm <loecom@qq.com>
This commit is contained in:
loecom
2025-04-25 22:27:36 +08:00
committed by GitHub
parent 7e3819be86
commit c5580feb64
13 changed files with 67 additions and 7 deletions

View File

@@ -112,10 +112,12 @@ jobs:
- TARGET: x86_64-pc-windows-msvc - TARGET: x86_64-pc-windows-msvc
OS: windows-latest OS: windows-latest
ARTIFACT_NAME: windows-x86_64 ARTIFACT_NAME: windows-x86_64
- TARGET: aarch64-pc-windows-msvc - TARGET: aarch64-pc-windows-msvc
OS: windows-latest OS: windows-latest
ARTIFACT_NAME: windows-arm64 ARTIFACT_NAME: windows-arm64
- TARGET: i686-pc-windows-msvc
OS: windows-latest
ARTIFACT_NAME: windows-i686
- TARGET: x86_64-unknown-freebsd - TARGET: x86_64-unknown-freebsd
OS: ubuntu-22.04 OS: ubuntu-22.04
@@ -229,12 +231,13 @@ jobs:
# windows is the only OS using a different convention for executable file name # windows is the only OS using a different convention for executable file name
if [[ $OS =~ ^windows.*$ && $TARGET =~ ^x86_64.*$ ]]; then if [[ $OS =~ ^windows.*$ && $TARGET =~ ^x86_64.*$ ]]; then
SUFFIX=.exe SUFFIX=.exe
cp easytier/third_party/Packet.dll ./artifacts/objects/ cp easytier/third_party/*.dll ./artifacts/objects/
cp easytier/third_party/wintun.dll ./artifacts/objects/ elif [[ $OS =~ ^windows.*$ && $TARGET =~ ^i686.*$ ]]; then
SUFFIX=.exe
cp easytier/third_party/i686/*.dll ./artifacts/objects/
elif [[ $OS =~ ^windows.*$ && $TARGET =~ ^aarch64.*$ ]]; then elif [[ $OS =~ ^windows.*$ && $TARGET =~ ^aarch64.*$ ]]; then
SUFFIX=.exe SUFFIX=.exe
cp easytier/third_party/arm64/Packet.dll ./artifacts/objects/ cp easytier/third_party/arm64/*.dll ./artifacts/objects/
cp easytier/third_party/arm64/wintun.dll ./artifacts/objects/
fi fi
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then
TAG=$GITHUB_REF_NAME TAG=$GITHUB_REF_NAME
@@ -276,7 +279,6 @@ jobs:
if: needs.build.result != 'success' if: needs.build.result != 'success'
run: exit 1 run: exit 1
magisk_build: magisk_build:
needs: needs:
- pre_job - pre_job

View File

@@ -63,6 +63,11 @@ jobs:
GUI_TARGET: aarch64-pc-windows-msvc GUI_TARGET: aarch64-pc-windows-msvc
ARTIFACT_NAME: windows-arm64 ARTIFACT_NAME: windows-arm64
- TARGET: i686-pc-windows-msvc
OS: windows-latest
GUI_TARGET: i686-pc-windows-msvc
ARTIFACT_NAME: windows-i686
runs-on: ${{ matrix.OS }} runs-on: ${{ matrix.OS }}
env: env:
NAME: easytier NAME: easytier
@@ -179,6 +184,8 @@ jobs:
run: | run: |
if [[ $GUI_TARGET =~ ^aarch64.*$ ]]; then if [[ $GUI_TARGET =~ ^aarch64.*$ ]]; then
cp ./easytier/third_party/arm64/*.dll ./easytier-gui/src-tauri/ cp ./easytier/third_party/arm64/*.dll ./easytier-gui/src-tauri/
elif [[ $GUI_TARGET =~ ^i686.*$ ]]; then
cp ./easytier/third_party/i686/*.dll ./easytier-gui/src-tauri/
else else
cp ./easytier/third_party/*.dll ./easytier-gui/src-tauri/ cp ./easytier/third_party/*.dll ./easytier-gui/src-tauri/
fi fi

7
Cargo.lock generated
View File

@@ -1969,6 +1969,7 @@ dependencies = [
"tabled", "tabled",
"tachyonix", "tachyonix",
"thiserror 1.0.63", "thiserror 1.0.63",
"thunk-rs",
"time", "time",
"timedmap", "timedmap",
"tokio", "tokio",
@@ -8151,6 +8152,12 @@ dependencies = [
"once_cell", "once_cell",
] ]
[[package]]
name = "thunk-rs"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cbc000e786a7ea2cfa3a85ef77cf86bfdadeaa2b215ec4751df66442fa4632a"
[[package]] [[package]]
name = "tiff" name = "tiff"
version = "0.9.1" version = "0.9.1"

View File

@@ -16,3 +16,5 @@ panic = "unwind"
panic = "abort" panic = "abort"
lto = true lto = true
codegen-units = 1 codegen-units = 1
opt-level = 'z'
strip = true

View File

@@ -14,6 +14,13 @@ crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies] [build-dependencies]
tauri-build = { version = "2.0.0-rc", features = [] } tauri-build = { version = "2.0.0-rc", features = [] }
# enable thunk-rs when compiling for x86_64 or i686 windows
[target.x86_64-pc-windows-msvc.build-dependencies]
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
[target.i686-pc-windows-msvc.build-dependencies]
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
[dependencies] [dependencies]
# wry 0.47 may crash on android, see https://github.com/EasyTier/EasyTier/issues/527 # wry 0.47 may crash on android, see https://github.com/EasyTier/EasyTier/issues/527
tauri = { version = "=2.0.6", features = [ tauri = { version = "=2.0.6", features = [

View File

@@ -1,3 +1,9 @@
fn main() { fn main() {
// enable thunk-rs when target os is windows and arch is x86_64 or i686
#[cfg(target_os = "windows")]
if !std::env::var("TARGET").unwrap_or_default().contains("aarch64"){
thunk::thunk();
}
tauri_build::build(); tauri_build::build();
} }

View File

@@ -64,3 +64,10 @@ chrono = { version = "0.4.37", features = ["serde"] }
[features] [features]
default = [] default = []
embed = ["dep:axum-embed"] embed = ["dep:axum-embed"]
# enable thunk-rs when compiling for x86_64 or i686 windows
[target.x86_64-pc-windows-msvc.build-dependencies]
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
[target.i686-pc-windows-msvc.build-dependencies]
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }

7
easytier-web/build.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
// enable thunk-rs when target os is windows and arch is x86_64 or i686
#[cfg(target_os = "windows")]
if !std::env::var("TARGET").unwrap_or_default().contains("aarch64"){
thunk::thunk();
}
}

View File

@@ -251,6 +251,13 @@ prost-reflect-build = { version = "0.14.0" }
reqwest = { version = "0.12.12", features = ["blocking"] } reqwest = { version = "0.12.12", features = ["blocking"] }
zip = "0.6.6" zip = "0.6.6"
# enable thunk-rs when compiling for x86_64 or i686 windows
[target.x86_64-pc-windows-msvc.build-dependencies]
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
[target.i686-pc-windows-msvc.build-dependencies]
thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = ["win7"] }
[dev-dependencies] [dev-dependencies]
serial_test = "3.0.0" serial_test = "3.0.0"

View File

@@ -71,6 +71,8 @@ impl WindowsBuild {
if target.contains("x86_64") { if target.contains("x86_64") {
println!("cargo:rustc-link-search=native=easytier/third_party/"); println!("cargo:rustc-link-search=native=easytier/third_party/");
} else if target.contains("i686") {
println!("cargo:rustc-link-search=native=easytier/third_party/i686/");
} else if target.contains("aarch64") { } else if target.contains("aarch64") {
println!("cargo:rustc-link-search=native=easytier/third_party/arm64/"); println!("cargo:rustc-link-search=native=easytier/third_party/arm64/");
} }
@@ -125,6 +127,12 @@ fn check_locale() {
} }
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
// enable thunk-rs when target os is windows and arch is x86_64 or i686
#[cfg(target_os = "windows")]
if !std::env::var("TARGET").unwrap_or_default().contains("aarch64"){
thunk::thunk();
}
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
WindowsBuild::check_for_win(); WindowsBuild::check_for_win();

BIN
easytier/third_party/i686/Packet.dll vendored Normal file

Binary file not shown.

BIN
easytier/third_party/i686/Packet.lib vendored Normal file

Binary file not shown.

BIN
easytier/third_party/i686/wintun.dll vendored Normal file

Binary file not shown.