Skip to content

Commit f4089b0

Browse files
committed
feat: support old cpu on Windows
1 parent c708b47 commit f4089b0

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
os: [macos-13, ubuntu-22.04]
16+
os: [windows-2022, macos-13, ubuntu-22.04]
1717

1818
steps:
1919
- name: Checkout
@@ -61,21 +61,37 @@ jobs:
6161
cargo build --release --target x86_64-unknown-linux-gnu --features=bundle
6262
mv target/x86_64-unknown-linux-gnu/release/gupaxx gupaxx_b
6363
tar -cf linux.tar gupaxx gupaxx_b
64-
cargo build --release --target x86_64-pc-windows-gnu
65-
mv target/x86_64-pc-windows-gnu/release/gupaxx.exe .
66-
cargo build --release --target x86_64-pc-windows-gnu --features=bundle
67-
mv target/x86_64-pc-windows-gnu/release/gupaxx.exe gupaxx_b.exe
64+
fi
65+
elif [ "$RUNNER_OS" == "Windows" ]; then
66+
# For very old cpu
67+
cargo build --release
68+
mv target/release/gupaxx.exe .
69+
cargo build --release --features=bundle
70+
mv target/release/gupaxx.exe gupaxx_b.exe
71+
tar -cf windows_old_cpu.tar gupaxx.exe gupaxx_b.exe
72+
# For normal cpu
73+
cargo build --release --features=wgpu
74+
mv target/release/gupaxx.exe .
75+
cargo build --release --features=bundle
76+
mv target/release/gupaxx.exe gupaxx_b.exe
6877
tar -cf windows.tar gupaxx.exe gupaxx_b.exe
6978
fi
7079
shell: bash
7180

7281
- name: Archive (Windows)
73-
if: ${{ runner.os == 'Linux' }}
82+
if: ${{ runner.os == 'Windows' }}
7483
uses: actions/upload-artifact@v4
7584
with:
7685
name: windows
7786
path: windows.tar
7887

88+
- name: Archive (Windows) Old CPU
89+
if: ${{ runner.os == 'Windows' }}
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: windows_old_cpu
93+
path: windows_old_cpu.tar
94+
7995
- name: Archive
8096
if: ${{ runner.os == 'macOS' }}
8197
uses: actions/upload-artifact@v4

Cargo.toml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ default = []
2424
bundle = []
2525
distro = []
2626
log=[]
27+
wgpu=["dep:wgpu", "eframe/wgpu"]
2728

2829
[dependencies]
2930
clap = {version="4.5", features=["cargo", "derive"]}
@@ -33,19 +34,7 @@ bytes = "1.11.0"
3334
dirs = "6.0.0"
3435
#--------------------------------------------------------------------------------
3536
egui = "0.33"
36-
# egui = {git="https://github.com/emilk/egui"}
3737
egui_extras = {version="0.33", features = ["image"] }
38-
# egui_extras = {git="https://github.com/emilk/egui", features = ["image"] }
39-
40-
## 2023-12-28: https://github.com/hinto-janai/gupax/issues/68
41-
##
42-
## 2024-03-18: Both `glow` and `wgpu` seem to crash:
43-
## <https://github.com/hinto-janai/gupax/issues/84>
44-
## `wgpu` seems to crash on less computers though so...
45-
46-
## 2023-02-06: The below gets fixed by using the [wgpu] backend instead of [glow]
47-
## It also fixes crashes on CPU-based graphics. Only used for Windows.
48-
## Using [wgpu] actually crashes macOS (fixed in 0.20.x though).
4938

5039
#--------------------------------------------------------------------------------
5140
env_logger = "0.11.8"
@@ -63,7 +52,6 @@ rfd = "0.15.4"
6352
serde = { version = "1.0.228", features = ["rc", "derive"] }
6453
serde_json = "1.0.145"
6554
sysinfo = { version = "0.37", default-features = false, features=["system"] }
66-
# tls-api = "0.9.0"
6755
tokio = { version = "1.48.0", features = ["rt", "time", "macros", "process", "rt-multi-thread"] }
6856
toml = { version = "0.9.8", features = ["preserve_order"] }
6957
walkdir = "2.5.0"
@@ -78,8 +66,7 @@ enclose = "1.2.1"
7866
bounded-vec-deque = {version="0.1.1", default-features=false}
7967
cfg-if = "1.0"
8068
flexi_logger = "0.31"
81-
eframe = {version="0.33", features=["wgpu"]}
82-
# eframe = {git="https://github.com/emilk/egui", features=["wgpu"]}
69+
eframe = "0.33"
8370
strum = {version="0.27", features=["derive"]}
8471
## force version of ring to prevent https://rustsec.org/advisories/RUSTSEC-2025-0009
8572
ring = "0.17.14"
@@ -103,24 +90,18 @@ ctrlc = {version="3.5", features=["termination"]}
10390
tar = "0.4.44"
10491
flate2 = "1.1"
10592
sudo = "0.6.0"
106-
# https://github.com/emilk/egui/releases/tag/0.30.0 see breaking change
107-
eframe = {version="0.33", features=["x11", "wayland"]}
10893
portable-pty = "0.9.0"
10994
# macOS
11095
[target.'cfg(target_os = "macos")'.dependencies]
11196
[dev-dependencies]
11297
egui = {version="0.33", features=["callstack"]}
113-
# egui = {git="https://github.com/emilk/egui", features=["callstack"]}
114-
115-
# [target.'cfg(not(target_os = "macos"))'.dependencies]
116-
# tls-api-native-tls = "0.9.0"
11798

11899
# Windows dependencies
119100
[target.'cfg(windows)'.dependencies]
120101
# glow start on windows but not wgpu
121102
# need the same version that eframe is using with egui_wgpu
122103
# feature angle to enable support for old cpu on Windows
123-
wgpu = {version = "27.0.1", features=["angle"]}
104+
wgpu = {version = "27.0.1", features=["angle"], optional=true}
124105
zip = "6.0.0"
125106
is_elevated = "0.1.2"
126107
## portable-pty upgrade on 0.9 will break terminals on windows

0 commit comments

Comments
 (0)