From 87c919003fa5414dd883b23e509a6609e337c491 Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Sun, 18 Jun 2023 05:16:11 -0700 Subject: [PATCH] Add support for Windows on AArch64 --- .github/workflows/ci.yml | 59 ++++++++++++++++++++++++++++------------ CHANGELOG.md | 9 ++++-- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 +-- toast.yml | 2 +- 6 files changed, 54 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68f6922..1512d75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: name: Build for Linux runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - if: ${{ github.event_name == 'push' }} uses: azure/docker-login@v1 with: @@ -25,7 +25,7 @@ jobs: # The artifact name will contain the target triple, so the file name doesn't need to. mv artifacts/gram-x86_64-unknown-linux-gnu artifacts/gram - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: x86_64-unknown-linux-gnu path: artifacts/gram @@ -36,7 +36,7 @@ jobs: # The artifact name will contain the target triple, so the file name doesn't need to. mv artifacts/gram-x86_64-unknown-linux-musl artifacts/gram - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: x86_64-unknown-linux-musl path: artifacts/gram @@ -47,7 +47,7 @@ jobs: # The artifact name will contain the target triple, so the file name doesn't need to. mv artifacts/gram-aarch64-unknown-linux-gnu artifacts/gram - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: aarch64-unknown-linux-gnu path: artifacts/gram @@ -58,7 +58,7 @@ jobs: # The artifact name will contain the target triple, so the file name doesn't need to. mv artifacts/gram-aarch64-unknown-linux-musl artifacts/gram - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: aarch64-unknown-linux-musl path: artifacts/gram @@ -67,7 +67,7 @@ jobs: name: Build for Windows runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | # Make Bash not silently ignore errors. set -euo pipefail @@ -76,22 +76,38 @@ jobs: rustup toolchain install 1.65.0 # [ref:rust_1.65.0] rustup default 1.65.0 # [ref:rust_1.65.0] - # Build and test. + # Add the targets. + rustup target add x86_64-pc-windows-msvc + rustup target add aarch64-pc-windows-msvc + + # Build and test for x86_64-pc-windows-msvc. RUSTFLAGS='--codegen target-feature=+crt-static' cargo build \ --locked \ --release \ --target x86_64-pc-windows-msvc NO_COLOR=true cargo test --locked # [ref:colorless_tests] - - uses: actions/upload-artifact@v2 + + # Build and test for aarch64-pc-windows-msvc. + RUSTFLAGS='--codegen target-feature=+crt-static' cargo build \ + --locked \ + --release \ + --target aarch64-pc-windows-msvc + NO_COLOR=true cargo test --locked # [ref:colorless_tests] + - uses: actions/upload-artifact@v3 with: name: x86_64-pc-windows-msvc path: target/x86_64-pc-windows-msvc/release/gram.exe if-no-files-found: error + - uses: actions/upload-artifact@v3 + with: + name: aarch64-pc-windows-msvc + path: target/aarch64-pc-windows-msvc/release/gram.exe + if-no-files-found: error ci-macos: name: Build for macOS runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | # Make Bash not silently ignore errors. set -euo pipefail @@ -100,22 +116,27 @@ jobs: rustup toolchain install 1.65.0 # [ref:rust_1.65.0] rustup default 1.65.0 # [ref:rust_1.65.0] + # Add the targets. + rustup target add x86_64-apple-darwin + rustup target add aarch64-apple-darwin + # Build and test for x86_64-apple-darwin. - cargo build --locked --release --target x86_64-apple-darwin + SDKROOT=$(xcrun --show-sdk-path) \ + MACOSX_DEPLOYMENT_TARGET=$(xcrun --show-sdk-version) \ + cargo build --locked --release --target x86_64-apple-darwin NO_COLOR=true cargo test --locked # [ref:colorless_tests] # Build and test for aarch64-apple-darwin. - rustup target add aarch64-apple-darwin SDKROOT=$(xcrun --show-sdk-path) \ MACOSX_DEPLOYMENT_TARGET=$(xcrun --show-sdk-version) \ cargo build --locked --release --target aarch64-apple-darwin NO_COLOR=true cargo test --locked # [ref:colorless_tests] - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: x86_64-apple-darwin path: target/x86_64-apple-darwin/release/gram if-no-files-found: error - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: aarch64-apple-darwin path: target/aarch64-apple-darwin/release/gram @@ -124,7 +145,7 @@ jobs: name: Install on macOS runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | # Make Bash not silently ignore errors. set -euo pipefail @@ -138,7 +159,7 @@ jobs: name: Install on Ubuntu runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | # Make Bash not silently ignore errors. set -euo pipefail @@ -154,8 +175,8 @@ jobs: runs-on: ubuntu-latest needs: [ci-linux, ci-macos, ci-windows, install-macos, install-ubuntu] steps: - - uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 with: path: artifacts/ - env: @@ -199,6 +220,9 @@ jobs: mv \ artifacts/x86_64-pc-windows-msvc/gram.exe \ artifacts/gram-x86_64-pc-windows-msvc.exe + mv \ + artifacts/aarch64-pc-windows-msvc/gram.exe \ + artifacts/gram-aarch64-pc-windows-msvc.exe # Create the release. hub release create \ @@ -211,6 +235,7 @@ jobs: --attach 'artifacts/gram-x86_64-apple-darwin' \ --attach 'artifacts/gram-aarch64-apple-darwin' \ --attach 'artifacts/gram-x86_64-pc-windows-msvc.exe' \ + --attach 'artifacts/gram-aarch64-pc-windows-msvc.exe' \ "v$VERSION" echo "Created release v$VERSION." - uses: stepchowfun/toast/.github/actions/toast@main diff --git a/CHANGELOG.md b/CHANGELOG.md index 998df9b..9989901 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,15 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.4] - 2023-06-18 + +### Added +- Gram supports a new platform: Windows on AArch64. + ## [0.0.3] - 2023-06-02 ### Added -- Gram supports a new platform: AArch64 musl Linux. +- Gram supports a new platform: musl Linux on AArch64. ## [0.0.2] - 2023-05-23 ### Added -- Gram supports a new platform: AArch64 GNU Linux. +- Gram supports a new platform: GNU Linux on AArch64. ## [0.0.1] - 2023-05-13 diff --git a/Cargo.lock b/Cargo.lock index faa5d13..f633bc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ dependencies = [ [[package]] name = "gram" -version = "0.0.3" +version = "0.0.4" dependencies = [ "clap", "colored", diff --git a/Cargo.toml b/Cargo.toml index 7e70aeb..d01f2d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gram" -version = "0.0.3" +version = "0.0.4" authors = ["Stephan Boyer "] edition = "2021" description = "A programming language for distributed systems." diff --git a/README.md b/README.md index a1aab24..e80b195 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ curl https://raw.githubusercontent.com/gramlang/gram/main/install.sh -LSfs | PRE If you prefer not to use this installation method, you can download the binary from the [releases page](https://github.com/gramlang/gram/releases), make it executable (e.g., with `chmod`), and place it in some directory in your [`PATH`](https://en.wikipedia.org/wiki/PATH_\(variable\)) (e.g., `/usr/local/bin`). -### Installation on Windows (x86-64) +### Installation on Windows (AArch64 or x86-64) -If you're running Windows on an x86-64 CPU, download the latest binary from the [releases page](https://github.com/gramlang/gram/releases) and rename it to `gram` (or `gram.exe` if you have file extensions visible). Create a directory called `Gram` in your `%PROGRAMFILES%` directory (e.g., `C:\Program Files\Gram`), and place the renamed binary in there. Then, in the "Advanced" tab of the "System Properties" section of Control Panel, click on "Environment Variables..." and add the full path to the new `Gram` directory to the `PATH` variable under "System variables". Note that the `Program Files` directory might have a different name if Windows is configured for a language other than English. +If you're running Windows (AArch64 or x86-64), download the latest binary from the [releases page](https://github.com/gramlang/gram/releases) and rename it to `gram` (or `gram.exe` if you have file extensions visible). Create a directory called `Gram` in your `%PROGRAMFILES%` directory (e.g., `C:\Program Files\Gram`), and place the renamed binary in there. Then, in the "Advanced" tab of the "System Properties" section of Control Panel, click on "Environment Variables..." and add the full path to the new `Gram` directory to the `PATH` variable under "System variables". Note that the `Program Files` directory might have a different name if Windows is configured for a language other than English. To update to an existing installation, simply replace the existing binary. diff --git a/toast.yml b/toast.yml index 5148a55..b41e1fa 100644 --- a/toast.yml +++ b/toast.yml @@ -236,7 +236,7 @@ tasks: output_paths: - artifacts command: | - # Add the targets. It's likely that this script is currently running in one of them. + # Add the targets. rustup target add x86_64-unknown-linux-gnu rustup target add x86_64-unknown-linux-musl rustup target add aarch64-unknown-linux-gnu