From bbd5ed50158a64dff61c1333c844d8e7f3cd90fd Mon Sep 17 00:00:00 2001 From: SpaiR Date: Tue, 19 Nov 2024 10:00:55 +0200 Subject: [PATCH] chore: more precise rust target handling --- .github/workflows/ci.yml | 9 +++++++++ Taskfile.yml | 17 +++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c45aff57..288720af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,13 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, windows-2019, macos-latest ] + include: + - os: ubuntu-latest + rust-target: 1.82-x86_64-unknown-linux-gnu + - os: windows-2019 + rust-target: 1.82-x86_64-pc-windows-gnu + - os: macos-latest + rust-target: 1.82-x86_64-apple-darwin runs-on: ${{ matrix.os }} name: Build - ${{ matrix.os }} steps: @@ -65,6 +72,8 @@ jobs: run: task task_win:gen_syso - name: Build + env: + RUST_TARGET: ${{ matrix.rust-target }} run: task build - name: Upload Artifacts diff --git a/Taskfile.yml b/Taskfile.yml index 49fbbfcc..ff3e6428 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -17,20 +17,6 @@ vars: sh: echo '{{if eq OS "windows"}}-H windowsgui -extldflags=-static{{end}}' LD_FLAGS: -s -w {{.BUILD_VARS}} {{.LD_FLAGS_WINDOWS}} BUILD_ARGS: -trimpath -ldflags="{{.LD_FLAGS}}" - RUSTUP_TOOLCHAIN: - sh: | - if [ "$OS" = "Windows_NT" ]; then - echo "stable-x86_64-pc-windows-gnu" - else - OS_NAME=$(uname -s) - if [ "$OS_NAME" = "Darwin" ]; then - echo "stable-x86_64-apple-darwin" - elif [ "$OS_NAME" = "Linux" ]; then - echo "stable-x86_64-unknown-linux-gnu" - else - echo "stable" - fi - fi tasks: default: @@ -54,6 +40,9 @@ tasks: build-parser: dir: third_party/sdmmparser/src + vars: + RUST_TARGET_DYN: "{{if eq .OS \"Windows_NT\"}}stable-x86_64-pc-windows-gnu{{else}}stable{{end}}" + RUSTUP_TOOLCHAIN: "{{.RUST_TARGET | default .RUST_TARGET_DYN}}" cmds: - RUSTUP_TOOLCHAIN={{.RUSTUP_TOOLCHAIN}} cargo build --release