From bd1d3fe0a6d1ce5f237f51ac81704e60c584b6f2 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 9 Dec 2022 19:17:10 +0800 Subject: [PATCH] fix(cli): ci template upgrade --- cli/src/new/cargo-config.ts | 5 ----- cli/src/new/ci-template.ts | 13 ++++++------- cli/src/new/index.ts | 9 +-------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/cli/src/new/cargo-config.ts b/cli/src/new/cargo-config.ts index 9fde9c63..c97e6b28 100644 --- a/cli/src/new/cargo-config.ts +++ b/cli/src/new/cargo-config.ts @@ -1,13 +1,8 @@ export const createCargoConfig = ( enableLinuxArm7: boolean, - enableLinuxArm8Gnu: boolean, enableLinuxArm8Musl: boolean, ) => { const result: string[] = [] - if (enableLinuxArm8Gnu) { - result.push(`[target.aarch64-unknown-linux-gnu] -linker = "aarch64-linux-gnu-gcc"`) - } if (enableLinuxArm8Musl) { result.push(`[target.aarch64-unknown-linux-musl] linker = "aarch64-linux-musl-gcc" diff --git a/cli/src/new/ci-template.ts b/cli/src/new/ci-template.ts index 564d2e92..591e1581 100644 --- a/cli/src/new/ci-template.ts +++ b/cli/src/new/ci-template.ts @@ -75,7 +75,7 @@ jobs: target: 'armv7-unknown-linux-gnueabihf' setup: | sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y + sudo apt-get install gcc-arm-linux-gnueabihf -y build: | yarn build --target=armv7-unknown-linux-gnueabihf arm-linux-gnueabihf-strip *.node @@ -145,11 +145,10 @@ jobs: target/ key: \${{ matrix.settings.target }}-cargo-\${{ matrix.settings.host }} - - name: Cache NPM dependencies - uses: actions/cache@v3 - with: - path: .yarn/cache - key: npm-cache-build-\${{ matrix.settings.target }}-node@16 + - uses: goto-bus-stop/setup-zig@v2 + if: \${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }} + with: + version: 0.10.0 - name: Setup toolchain run: \${{ matrix.settings.setup }} @@ -211,7 +210,7 @@ jobs: usesh: true mem: 3000 prepare: | - pkg install -y curl node16 python2 + pkg install -y -f curl node libnghttp2 curl -qL https://www.npmjs.com/install.sh | sh npm install --location=global --ignore-scripts yarn curl https://sh.rustup.rs -sSf --output rustup.sh diff --git a/cli/src/new/index.ts b/cli/src/new/index.ts index a713811f..c4cb9b51 100644 --- a/cli/src/new/index.ts +++ b/cli/src/new/index.ts @@ -175,20 +175,13 @@ test('sum from native', (t) => { join(process.cwd(), this.dirname!), ) - const enableLinuxArm8Gnu = this.targets!.includes( - 'aarch64-unknown-linux-gnu', - ) const enableLinuxArm8Musl = this.targets!.includes( 'aarch64-unknown-linux-musl', ) const enableLinuxArm7 = this.targets!.includes( 'armv7-unknown-linux-gnueabihf', ) - const cargoConfig = createCargoConfig( - enableLinuxArm7, - enableLinuxArm8Gnu, - enableLinuxArm8Musl, - ) + const cargoConfig = createCargoConfig(enableLinuxArm7, enableLinuxArm8Musl) if (cargoConfig.length) { const configDir = join(process.cwd(), this.dirname!, '.cargo') if (!this.dryRun) {