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 8 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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ jobs:
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:
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
8 changes: 5 additions & 3 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 Rojo "rojo-rbx/rojo" "7.3.0"
verify_github_tool remodel "rojo-rbx/remodel" "0.9.1"
verify_github_tool stylua "JohnnyMorganz/stylua" "0.11.3"
verify_github_tool stylua "JohnnyMorganz/stylua" "0.17.1"
verify_github_tool luau-lsp "JohnnyMorganz/luau-lsp" "1.20.2"
verify_github_tool lune "filiptibell/lune" "0.6.7"

verify_gitlab_tool darklua "seaofvoices/darklua" "0.7.0"

verify_install_all_before_fail selene "Kampfkarren/selene" "0.22.0"
verify_install_all_before_fail selene "Kampfkarren/selene" "0.25.0"
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