Skip to content
Draft
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
70 changes: 3 additions & 67 deletions .github/workflows/boring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,11 @@ jobs:
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'
# The `fetch` build mode downloads the libraries pinned in hashes.dart,
# which boring_binaries.yaml builds from the native sources on main. A
# release of package:boring mustn't ship libraries built from other
# sources than the ones it vendors, so this fails once the version is no
# longer a -wip one.
- name: Check that the prebuilt libraries match the native sources
run: ./tool/check_prebuilt_binaries.sh
if: always() && steps.install.outcome == 'success'

# Build BoringSSL from source with the build hook and run the tests on each
# desktop OS (Linux, macOS, and Windows each use different linker flags in
# hook/link.dart), including cross-compiling to linux-arm64 with and without
# a cross-toolchain.
# hook/link.dart). test/prebuilt_test.dart, which needs the prebuilt
# libraries, runs in boring_binaries.yaml.
test:
needs: analyze
runs-on: ${{ matrix.os }}
Expand All @@ -81,58 +73,6 @@ jobs:
- name: Setup NASM
if: runner.os == 'Windows'
uses: ./.github/actions/setup-nasm
- name: Install Linux cross toolchain (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
# The release of messense/homebrew-macos-cross-toolchains that its
# Homebrew tap installs, downloaded directly to pin its SHA-256, like the
# Windows download below.
- name: Install Linux cross toolchain (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
case "$(uname -m)" in
arm64)
url="https://github.com/messense/homebrew-macos-cross-toolchains/releases/download/v15.2.0/aarch64-unknown-linux-gnu-aarch64-darwin.tar.gz"
expected="0f224db36d8572489f09ed5bce39f189eee998f9ab4f8ea07f510d6c7078caa3"
;;
x86_64)
url="https://github.com/messense/homebrew-macos-cross-toolchains/releases/download/v15.2.0/aarch64-unknown-linux-gnu-x86_64-darwin.tar.gz"
expected="7fa485313b7049d57c5de56bf876d5c4648ebfd736f86a8f4739596218523127"
;;
*)
echo "::error::Unsupported macOS architecture: $(uname -m)"
exit 1
;;
esac
curl -fSL -o "$RUNNER_TEMP/aarch64-linux-gnu.tar.gz" "$url"
actual="$(shasum -a 256 < "$RUNNER_TEMP/aarch64-linux-gnu.tar.gz" | cut -d' ' -f1)"
if [ "$actual" != "$expected" ]; then
echo "::error::Expected SHA-256 $expected for $url, got $actual."
exit 1
fi
tar -xzf "$RUNNER_TEMP/aarch64-linux-gnu.tar.gz" -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/aarch64-unknown-linux-gnu/bin" >> "$GITHUB_PATH"
- name: Install Linux cross toolchain (Windows)
if: runner.os == 'Windows'
shell: bash
env:
TOOLCHAIN_URL: https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-aarch64-none-linux-gnu.zip
# From the .sha256asc file published next to the zip.
TOOLCHAIN_SHA256: 9428b2039923916418ec7037025be8cec3202926d65db9452519977834ad2a89
run: |
curl -fSL -o "$RUNNER_TEMP/arm-gnu-toolchain.zip" "$TOOLCHAIN_URL"
actual="$(sha256sum < "$RUNNER_TEMP/arm-gnu-toolchain.zip" | cut -d' ' -f1)"
if [ "$actual" != "$TOOLCHAIN_SHA256" ]; then
echo "::error::Expected SHA-256 $TOOLCHAIN_SHA256 for $TOOLCHAIN_URL, got $actual."
exit 1
fi
7z x "$RUNNER_TEMP/arm-gnu-toolchain.zip" -o"$RUNNER_TEMP/arm-gnu-toolchain" -y >/dev/null
BIN_DIR="$RUNNER_TEMP/arm-gnu-toolchain/bin"
for f in "$BIN_DIR"/aarch64-none-linux-gnu-*.exe; do
cp "$f" "${f/aarch64-none-linux-gnu-/aarch64-linux-gnu-}"
done
cygpath -w "$BIN_DIR" >> "$GITHUB_PATH"
- id: install
name: Install dependencies
run: dart pub get
Expand Down Expand Up @@ -194,15 +134,11 @@ jobs:
sdk: dev
- name: Regenerate at tool/REVISION
run: ./tool/bump-boringssl-revision.sh "$(cat tool/REVISION)"
# Also checks that every prebuilt target's asset exists in the pinned
# release, since `fetch` fails for a target without a hash.
- name: Regenerate the hashes of the pinned release
run: dart run tool/regenerate_hashes.dart
- name: Check for changes
run: |
if [ -n "$(git status --porcelain -- .)" ]; then
git status --short -- .
echo "::error::Generated files are out of date. Run ./tool/bump-boringssl-revision.sh \"\$(cat tool/REVISION)\" and dart run tool/regenerate_hashes.dart in pkgs/boring and commit the result."
echo "::error::Generated files are out of date. Run ./tool/bump-boringssl-revision.sh \"\$(cat tool/REVISION)\" in pkgs/boring and commit the result."
exit 1
fi

Expand Down
Loading
Loading