Skip to content

Commit 0b5827a

Browse files
committed
windows: Use rustc version from msys2
This should fix CI. This version seems fine, and doesn't require any weird code to ensure the build script can find it correctly. Nor does it run into some issues that I've had locally trying to build with the toolchain from Windows rustup.
1 parent 682a424 commit 0b5827a

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ jobs:
4949
- uses: msys2/setup-msys2@v2
5050
with:
5151
msystem: MINGW32
52-
install: mingw-w64-i686-gtk3 mingw-w64-i686-toolchain mingw-w64-i686-ntldd mingw-w64-i686-imagemagick
53-
- uses: actions-rs/toolchain@v1
54-
with:
55-
toolchain: stable-i686-pc-windows-gnu
52+
install: mingw-w64-i686-gtk3 mingw-w64-i686-rust mingw-w64-i686-toolchain mingw-w64-i686-ntldd mingw-w64-i686-imagemagick
5653
- uses: actions/checkout@v2
5754
- name: Build and package
5855
shell: msys2 {0}
@@ -62,7 +59,7 @@ jobs:
6259
SSL_COM_CREDENTIAL_ID: ${{ github.event_name == 'release' && secrets.SSL_COM_CREDENTIAL_ID || '' }}
6360
SSL_COM_TOTP_SECRET: ${{ github.event_name == 'release' && secrets.SSL_COM_TOTP_SECRET || '' }}
6461
SIGN: ${{ github.event_name == 'release' && '--sign' || '' }}
65-
run: cd windows && python build.py --rustup="C:/Rust/.cargo/bin/rustup.exe" $RELEASE $SIGN
62+
run: cd windows && python build.py $RELEASE $SIGN
6663
- uses: actions/upload-artifact@v2
6764
with:
6865
if-no-files-found: error

windows/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
- `libraries.wxi` - Generated automatically by `build.py` with a list of needed dlls. Included by `keyboard-configurator.wxs`.
66

77
### Dependencies
8-
- [Rustup](https://rustup.rs/)
98
- [MSYS2](https://www.msys2.org/)
109
- [WiX Toolset](https://wixtoolset.org/)
1110

12-
In msys2, run `pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-toolchain mingw-w64-i686-ntldd mingw-w64-i686-imagemagick`.
13-
14-
Run `rustup toolchain add stable-i686-pc-windows-gnu`.
11+
In msys2, run `pacman -S ingw-w64-i686-gtk3 mingw-w64-i686-rust mingw-w64-i686-toolchain mingw-w64-i686-ntldd mingw-w64-i686-imagemagick`.
1512

1613
### Building
1714
`.\build.bat` will build and generate a `.msi` installer.

windows/build.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import argparse
44
import os
55
import re
6+
import shlex
67
import shutil
78
import subprocess
89
import sys
@@ -14,13 +15,11 @@
1415
parser = argparse.ArgumentParser()
1516
parser.add_argument('--release', action='store_true')
1617
parser.add_argument('--sign', action='store_true')
17-
parser.add_argument('--rustup', default=(os.environ['HOMEPATH'] + "/.cargo/bin/rustup.exe"))
18+
parser.add_argument('--cargo', default='cargo')
1819
parser.add_argument('--wix', default="C:/Program Files (x86)/WiX Toolset v3.11")
1920
args = parser.parse_args()
2021

21-
# Rust toolchain version to use
22-
RUST_TOOLCHAIN = 'stable-i686-pc-windows-gnu'
23-
CARGO = [args.rustup, "run", RUST_TOOLCHAIN, "cargo"]
22+
CARGO = shlex.split(args.cargo)
2423
# Executables to install
2524
TARGET_DIR = "../target/" + ('release' if args.release else 'debug')
2625
EXES = {

0 commit comments

Comments
 (0)