Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't download windows-aarch64 binaries on win64 host #71

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,55 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup Rust toolchain
shell: bash
run: rustup default stable

- name: Rustfmt
shell: bash
run: cargo fmt -- --check

- name: Clippy
shell: bash
run: cargo clippy

build:
runs-on: ubuntu-latest

needs: checks
timeout-minutes: 10
strategy:
matrix:
rust_version: [stable, "1.60.0"]
os: [windows-latest, ubuntu-latest]
rust_version: [stable, "1.60.0"]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Setup Rust toolchain
shell: bash
run: rustup default ${{ matrix.rust_version }}

- name: Build
shell: bash
run: cargo build --locked --verbose

- name: Run tests
shell: bash
run: cargo test --locked --verbose

end-to-end-tests:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
matthargett marked this conversation as resolved.
Show resolved Hide resolved

runs-on: ${{ matrix.os }}
needs: build

steps:
- uses: actions/checkout@v2

- name: End-to-end tests
shell: bash
run: |
cargo install --path .
foreman --version
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Foreman Changelog

## 1.0.6 (2022-09-28)
## Unreleased

- Take into account architecture when downloading binaries for Windows to fix incorrect download of windows-aarch64 assets on win64 hosts ([#71](https://github.com/Roblox/foreman/pull/71))
- Support all Tier 1 Rust supported platforms {windows, linux, macos}-{x86_64, i686, aarch64} ([#71](https://github.com/Roblox/foreman/pull/71))

## 1.1.0 (2022-09-28)

- Support `macos-aarch64` as an artifact name for Apple Silicon (arm64) binaries ([#60](https://github.com/Roblox/foreman/pull/60))
- Take into account architecture when downloading binaries for linux ([#59](https://github.com/Roblox/foreman/pull/59))
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,16 @@ an error happened trying to run `github.com/some-org/some-tool@^1.2.3` at `/User

In this case, your foreman installation has mistakenly downloaded an incompatible version of the tool binary due to [an error in the binary file selection logic](https://github.com/Roblox/foreman/pull/53).

To fix this error, take the following steps:
### `is not compatible with the version of Windows you're running` Error
If you're using foreman version 1.1.0 or older, you may encounter an error that reads like this when an existing project adds a Windows binary for the `aarch64` platform (eg Windows Holographic OS for HoloLens)

In this case, your foreman installation has mistakenly downloaded an incompatible version of the tool binary due to [yet another error in the binary file selection logic](https://github.com/Roblox/foreman/pull/71).


To fix both of these error types, take the following steps:
1. Upgrade your version of `foreman` per [the instructions above](#upgrading).
2. Delete the `~/.foreman/tool-cache.json` file and the `~/.foreman/tools/` folder (and its contents), as well as the `~/.foreman/bin` folder (as described in the [Upgrading](#upgrading) section above). This should remove any invalid binaries that foreman has cached.
3. Run `foreman install` to redownload all relevant tools.
3. Run `foreman install` to re-download all relevant tools.

Your downloaded tools should now work correctly.

Expand Down
12 changes: 7 additions & 5 deletions scripts/end-to-end-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ verify_install_all_before_fail () {
}
}

verify_github_tool Rojo "rojo-rbx/rojo" "6.0.0"
verify_github_tool remodel "rojo-rbx/remodel" "0.9.1"
verify_github_tool stylua "JohnnyMorganz/stylua" "0.11.3"
verify_github_tool Rojo "rojo-rbx/rojo" "7.3.0"
verify_github_tool remodel "rojo-rbx/remodel" "0.11.0"
verify_github_tool stylua "JohnnyMorganz/stylua" "0.18.0"
verify_github_tool luau-lsp "JohnnyMorganz/luau-lsp" "1.22.0"
verify_github_tool lune "filiptibell/lune" "0.6.7"

verify_gitlab_tool darklua "seaofvoices/darklua" "0.7.0"
verify_gitlab_tool darklua "seaofvoices/darklua" "0.8.0"

verify_install_all_before_fail selene "Kampfkarren/selene" "0.22.0"
verify_install_all_before_fail selene "Kampfkarren/selene" "0.666.31337"
matthargett marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 16 additions & 4 deletions src/artifact_choosing.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#[cfg(target_os = "windows")]
static PLATFORM_KEYWORDS: &[&str] = &["win32", "win64", "windows"];
#[cfg(all(target_os = "windows", target_arch = "x86_64"))]
static PLATFORM_KEYWORDS: &[&str] = &["win64", "windows-x86_64", "windows"];

#[cfg(all(target_os = "windows", target_arch = "i686"))]
static PLATFORM_KEYWORDS: &[&str] = &["win32", "windows-i686"];

#[cfg(all(target_os = "windows", target_arch = "aarch64"))]
static PLATFORM_KEYWORDS: &[&str] = &["windows-aarch64"];

#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
static PLATFORM_KEYWORDS: &[&str] = &["macos-x86_64", "darwin-x86_64", "macos", "darwin"];

#[cfg(all(target_os = "macos", target_arch = "i686"))]
static PLATFORM_KEYWORDS: &[&str] = &["macos-i686", "darwin-i686"];

#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
static PLATFORM_KEYWORDS: &[&str] = &[
"macos-arm64",
Expand All @@ -17,12 +26,15 @@ static PLATFORM_KEYWORDS: &[&str] = &[
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
static PLATFORM_KEYWORDS: &[&str] = &["linux-x86_64", "linux"];

#[cfg(all(target_os = "linux", target_arch = "i686"))]
static PLATFORM_KEYWORDS: &[&str] = &["linux-i686"];

#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
static PLATFORM_KEYWORDS: &[&str] = &["linux-arm64", "linux-aarch64", "linux"];
static PLATFORM_KEYWORDS: &[&str] = &["linux-arm64", "linux-aarch64"];

#[cfg(all(
target_os = "linux",
not(any(target_arch = "x86_64", target_arch = "aarch64"))
not(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "i686"))
))]
static PLATFORM_KEYWORDS: &[&str] = &["linux"];

Expand Down