|
92 | 92 | yarn build --target aarch64-unknown-linux-gnu
|
93 | 93 | - host: ubuntu-latest
|
94 | 94 | target: armv7-unknown-linux-gnueabihf
|
95 |
| - build: yarn build --target armv7-unknown-linux-gnueabihf |
| 95 | + docker: 'ubuntu:22.04' |
| 96 | + build: | |
| 97 | + # -x prints each command before running it. -e stops on first error. |
| 98 | + set -e -x |
| 99 | +
|
| 100 | + echo "--- 1. Installing System Dependencies ---" |
| 101 | + export DEBIAN_FRONTEND=noninteractive |
| 102 | + apt-get update -y |
| 103 | + apt-get install -y \ |
| 104 | + build-essential curl ca-certificates git pkg-config libssl-dev \ |
| 105 | + nodejs npm \ |
| 106 | + cmake nasm libclang-dev \ |
| 107 | + gcc-arm-linux-gnueabihf # <-- The PACKAGE NAME |
| 108 | +
|
| 109 | + echo "--- 2. Installing Node.js v22 and Yarn ---" |
| 110 | + # Use NodeSource to get a modern version of Node.js |
| 111 | + curl -fsSL https://deb.nodesource.com/setup_22.x | bash - |
| 112 | + apt-get install -y nodejs |
| 113 | + # Verify Node.js version |
| 114 | + node -v |
| 115 | + # Install Yarn globally |
| 116 | + npm install -g yarn |
| 117 | +
|
| 118 | +
|
| 119 | + echo "--- 3. Verifying Cross-Compiler Installation ---" |
| 120 | + # This command MUST succeed and print a path. |
| 121 | + which arm-linux-gnueabihf-gcc # <-- The COMMAND NAME |
| 122 | +
|
| 123 | + echo "--- 4. Installing Rust Toolchain ---" |
| 124 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 125 | + # Add cargo to the PATH for the rest of this script |
| 126 | + . "$HOME/.cargo/env" |
| 127 | + rustup target add armv7-unknown-linux-gnueabihf |
| 128 | +
|
| 129 | + echo "--- 5. Creating Cargo Config (The Right Way) ---" |
| 130 | + # This is the most reliable way to configure Cargo. |
| 131 | + mkdir -p .cargo |
| 132 | + cat << EOF > .cargo/config.toml |
| 133 | + [target.armv7-unknown-linux-gnueabihf] |
| 134 | + linker = "arm-linux-gnueabihf-gcc" # <-- Use the correct COMMAND NAME |
| 135 | + EOF |
| 136 | + cat .cargo/config.toml # Print the file to be sure |
| 137 | +
|
| 138 | + echo "--- 6. Configuring Bindgen ---" |
| 139 | + # This is still required for aws-lc-sys |
| 140 | + export BINDGEN_EXTRA_CLANG_ARGS="--target=armv7-unknown-linux-gnueabihf --sysroot=/usr/arm-linux-gnueabihf" |
| 141 | +
|
| 142 | + echo "--- 7. Running The Build ---" |
| 143 | + # We now have a perfectly configured, isolated environment. |
| 144 | + yarn install |
| 145 | + yarn build --target armv7-unknown-linux-gnueabihf |
96 | 146 | - host: ubuntu-latest
|
97 | 147 | target: aarch64-linux-android
|
98 | 148 | build: yarn build --target aarch64-linux-android
|
@@ -156,10 +206,6 @@ jobs:
|
156 | 206 | with:
|
157 | 207 | node-version: 22
|
158 | 208 | cache: yarn
|
159 |
| - - name: Setup Zig |
160 |
| - uses: goto-bus-stop/setup-zig@v2 |
161 |
| - with: |
162 |
| - version: 0.11.0 |
163 | 209 | - name: Install NASM
|
164 | 210 | if: runner.os == 'Windows'
|
165 | 211 | run: choco install nasm
|
|
0 commit comments