From cf5fec63c07b38ab7b318ef3f8e3e6c3d866265f Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Sun, 22 Sep 2024 17:20:15 +0800 Subject: [PATCH] Add loongarch64-unknown-linux-gnu-gcc build target (#13895) # Description Add `loongarch64-unknown-linux-gnu-gcc` build target A test release could be found here: https://github.com/nushell/nightly/releases/tag/v0.98.1 Loongarch64 workflow build result: https://github.com/nushell/nightly/actions/runs/10973523602/job/30471006104 --- .github/workflows/nightly-build.yml | 3 +++ .github/workflows/release-pkg.nu | 7 +++++++ .github/workflows/release.yml | 3 +++ 3 files changed, 13 insertions(+) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index abef444ec3..ef5a7c7f57 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -82,6 +82,7 @@ jobs: - armv7-unknown-linux-gnueabihf - armv7-unknown-linux-musleabihf - riscv64gc-unknown-linux-gnu + - loongarch64-unknown-linux-gnu extra: ['bin'] include: - target: aarch64-apple-darwin @@ -114,6 +115,8 @@ jobs: os: ubuntu-22.04 - target: riscv64gc-unknown-linux-gnu os: ubuntu-latest + - target: loongarch64-unknown-linux-gnu + os: ubuntu-22.04 runs-on: ${{matrix.os}} diff --git a/.github/workflows/release-pkg.nu b/.github/workflows/release-pkg.nu index 85ce6a1caf..0c65dcb44d 100755 --- a/.github/workflows/release-pkg.nu +++ b/.github/workflows/release-pkg.nu @@ -98,6 +98,13 @@ if $os in ['macos-latest'] or $USE_UBUNTU { $env.CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER = 'armv7r-linux-musleabihf-gcc' cargo-build-nu } + 'loongarch64-unknown-linux-gnu' => { + aria2c https://github.com/loongson/build-tools/releases/download/2024.08.08/x86_64-cross-tools-loongarch64-binutils_2.43-gcc_14.2.0-glibc_2.40.tar.xz + tar xf x86_64-cross-tools-loongarch64-*.tar.xz + $env.PATH = ($env.PATH | split row (char esep) | prepend $'($env.PWD)/cross-tools/bin') + $env.CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER = 'loongarch64-unknown-linux-gnu-gcc' + cargo-build-nu + } _ => { # musl-tools to fix 'Failed to find tool. Is `musl-gcc` installed?' # Actually just for x86_64-unknown-linux-musl target diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed42b5c3ca..00fec604f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,7 @@ jobs: - armv7-unknown-linux-gnueabihf - armv7-unknown-linux-musleabihf - riscv64gc-unknown-linux-gnu + - loongarch64-unknown-linux-gnu extra: ['bin'] include: - target: aarch64-apple-darwin @@ -64,6 +65,8 @@ jobs: os: ubuntu-22.04 - target: riscv64gc-unknown-linux-gnu os: ubuntu-latest + - target: loongarch64-unknown-linux-gnu + os: ubuntu-22.04 runs-on: ${{matrix.os}}