Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 5 additions & 2 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-11-arm
target: aarch64-pc-windows-msvc
binary-postfix: ".exe"
steps:
- name: Checkout repository
uses: actions/checkout@v7
Expand All @@ -47,10 +50,10 @@ jobs:
if: matrix.job.target != 'aarch64-unknown-linux-gnu'
run: cargo build --release --target ${{ matrix.job.target }}
- name: Compress (Unix)
if: ${{ matrix.job.os != 'windows-latest' }}
if: runner.os != 'Windows'
run: zip -j espup-${{ matrix.job.target }}.zip target/${{ matrix.job.target }}/release/espup${{ matrix.job.binary-postfix }}
- name: Compress (Windows)
if: ${{ matrix.job.os == 'windows-latest' }}
if: runner.os == 'Windows'
run: Compress-Archive target/${{ matrix.job.target }}/release/espup${{ matrix.job.binary-postfix }} espup-${{ matrix.job.target }}.zip
- name: Upload compressed artifact
uses: svenstaro/upload-release-action@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
os-name: linux
- os: windows-latest
os-name: windows
- os: windows-11-arm
os-name: windows-arm
action:
- command: check
- command: test
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Add support for `aarch64-pc-windows-msvc` hosts (#601)

### Fixed
- Fix `File exists (os error 17)` when `~/.espup/esp-clang` is a dangling symlink (#581)
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ It's also possible to use [cargo-binstall](https://github.com/cargo-bins/cargo-b
```powershell
Invoke-WebRequest 'https://github.com/esp-rs/espup/releases/latest/download/espup-x86_64-pc-windows-msvc.exe' -OutFile .\espup.exe
```
- Windows MSVC aarch64
```powershell
Invoke-WebRequest 'https://github.com/esp-rs/espup/releases/latest/download/espup-aarch64-pc-windows-msvc.exe' -OutFile .\espup.exe
```

</details>

Expand Down Expand Up @@ -145,7 +149,7 @@ Options:
-d, --default-host <DEFAULT_HOST>
Target triple of the host

[possible values: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-pc-windows-msvc, x86_64-pc-windows-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
[possible values: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-pc-windows-msvc, aarch64-pc-windows-msvc, x86_64-pc-windows-gnu, x86_64-apple-darwin, aarch64-apple-darwin]

-r, --esp-riscv-gcc
Install Espressif RISC-V toolchain built with croostool-ng
Expand Down Expand Up @@ -225,7 +229,7 @@ Options:
-d, --default-host <DEFAULT_HOST>
Target triple of the host

[possible values: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-pc-windows-msvc, x86_64-pc-windows-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
[possible values: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, x86_64-pc-windows-msvc, aarch64-pc-windows-msvc, x86_64-pc-windows-gnu, x86_64-apple-darwin, aarch64-apple-darwin]

-f, --export-file <EXPORT_FILE>
Relative or full path for the export file that will be generated. If no path is provided, the file will be generated under home directory (https://docs.rs/dirs/latest/dirs/fn.home_dir.html)
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct CompletionsOpts {
#[derive(Debug, Parser)]
pub struct InstallOpts {
/// Target triple of the host.
#[arg(short = 'd', long, value_parser = ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "x86_64-pc-windows-msvc", "x86_64-pc-windows-gnu" , "x86_64-apple-darwin" , "aarch64-apple-darwin"])]
#[arg(short = 'd', long, value_parser = ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc", "x86_64-pc-windows-gnu" , "x86_64-apple-darwin" , "aarch64-apple-darwin"])]
pub default_host: Option<String>,
/// Install Espressif RISC-V toolchain built with croostool-ng
///
Expand Down
12 changes: 12 additions & 0 deletions src/host_triple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ pub enum HostTriple {
/// 64-bit MSVC
#[strum(serialize = "x86_64-pc-windows-msvc")]
X86_64PcWindowsMsvc,
/// ARM64 MSVC
#[strum(serialize = "aarch64-pc-windows-msvc")]
Aarch64PcWindowsMsvc,
/// 64-bit MinGW
#[strum(serialize = "x86_64-pc-windows-gnu")]
X86_64PcWindowsGnu,
Expand Down Expand Up @@ -58,6 +61,10 @@ mod tests {
get_host_triple(Some("x86_64-pc-windows-msvc".to_string())),
Ok(HostTriple::X86_64PcWindowsMsvc)
));
assert!(matches!(
get_host_triple(Some("aarch64-pc-windows-msvc".to_string())),
Ok(HostTriple::Aarch64PcWindowsMsvc)
));
assert!(matches!(
get_host_triple(Some("x86_64-pc-windows-gnu".to_string())),
Ok(HostTriple::X86_64PcWindowsGnu)
Expand Down Expand Up @@ -89,6 +96,11 @@ mod tests {
get_host_triple(None),
Ok(HostTriple::X86_64PcWindowsMsvc)
));
#[cfg(all(target_os = "windows", target_arch = "aarch64"))]
assert!(matches!(
get_host_triple(None),
Ok(HostTriple::Aarch64PcWindowsMsvc)
));
#[cfg(all(target_os = "windows", target_arch = "x86_64", target_env = "gnu"))]
assert!(matches!(
get_host_triple(None),
Expand Down
5 changes: 4 additions & 1 deletion src/toolchain/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,16 @@ fn get_arch(host_triple: &HostTriple) -> Result<&str> {
HostTriple::X86_64PcWindowsMsvc | HostTriple::X86_64PcWindowsGnu => {
Ok("x86_64-w64-mingw32")
}
HostTriple::Aarch64PcWindowsMsvc => Ok("aarch64-w64-mingw32"),
}
}

/// Gets the artifact extension based on the host triple.
fn get_artifact_extension(host_triple: &HostTriple) -> &str {
match host_triple {
HostTriple::X86_64PcWindowsMsvc | HostTriple::X86_64PcWindowsGnu => "zip",
HostTriple::X86_64PcWindowsMsvc
| HostTriple::X86_64PcWindowsGnu
| HostTriple::Aarch64PcWindowsMsvc => "zip",
_ => "tar.xz",
}
}
Expand Down
11 changes: 7 additions & 4 deletions src/toolchain/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ impl Llvm {
HostTriple::X86_64AppleDarwin => "x86_64-apple-darwin",
HostTriple::X86_64UnknownLinuxGnu => "x86_64-linux-gnu",
HostTriple::Aarch64UnknownLinuxGnu => "aarch64-linux-gnu",
HostTriple::X86_64PcWindowsMsvc | HostTriple::X86_64PcWindowsGnu => {
"x86_64-w64-mingw32"
}
// There is no ARM64 Windows build; ARM64 Windows runs the x86_64 one emulated.
HostTriple::X86_64PcWindowsMsvc
| HostTriple::X86_64PcWindowsGnu
| HostTriple::Aarch64PcWindowsMsvc => "x86_64-w64-mingw32",
};
arch.to_string()
} else {
Expand All @@ -110,7 +111,9 @@ impl Llvm {
HostTriple::X86_64AppleDarwin => "macos",
HostTriple::X86_64UnknownLinuxGnu => "linux-amd64",
HostTriple::Aarch64UnknownLinuxGnu => "linux-arm64",
HostTriple::X86_64PcWindowsMsvc | HostTriple::X86_64PcWindowsGnu => "win64",
HostTriple::X86_64PcWindowsMsvc
| HostTriple::X86_64PcWindowsGnu
| HostTriple::Aarch64PcWindowsMsvc => "win64",
};
arch.to_string()
}
Expand Down
4 changes: 3 additions & 1 deletion src/toolchain/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,9 @@ impl Installable for RiscVTarget {
/// Gets the artifact extension based on the host architecture.
fn get_artifact_extension(host_triple: &HostTriple) -> &str {
match host_triple {
HostTriple::X86_64PcWindowsMsvc | HostTriple::X86_64PcWindowsGnu => "zip",
HostTriple::X86_64PcWindowsMsvc
| HostTriple::X86_64PcWindowsGnu
| HostTriple::Aarch64PcWindowsMsvc => "zip",
_ => "tar.xz",
}
}
Expand Down
Loading