Skip to content

Commit

Permalink
Merge pull request #405 from gramlang/v0.0.4
Browse files Browse the repository at this point in the history
Add support for Windows on AArch64
  • Loading branch information
stepchowfun authored Jun 18, 2023
2 parents 928feff + 87c9190 commit fecdc8d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 24 deletions.
59 changes: 42 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gram"
version = "0.0.3"
version = "0.0.4"
authors = ["Stephan Boyer <[email protected]>"]
edition = "2021"
description = "A programming language for distributed systems."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fecdc8d

Please sign in to comment.