From b49ecf3d6a6d2f83ed44c61fb348dcbe5a1037e8 Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Tue, 5 Mar 2024 15:55:21 +0800 Subject: [PATCH 1/4] Add linux-musl build target --- .github/workflows/build-and-test-make.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 0001f49b..6e368425 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -33,6 +33,10 @@ jobs: host: x86_64-linux-gnu capture_interface: eth0 zigflags: -target x86_64-linux-gnu.2.17 + - arch: x86_64 + host: x86_64-linux-musl + capture_interface: eth0 + zigflags: -target x86_64-linux-musl - arch: i386 host: i386-linux-gnu capture_interface: eth0 @@ -41,6 +45,10 @@ jobs: host: aarch64-linux-gnu capture_interface: eth0 zigflags: -target aarch64-linux-gnu.2.17 + - arch: aarch64 + host: aarch64-linux-musl + capture_interface: eth0 + zigflags: -target aarch64-linux-musl - arch: arm host: arm-linux-gnueabihf capture_interface: eth0 From 31cc0fe90d2b9bc35cdd50bb75bc7514189c84f3 Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Tue, 5 Mar 2024 16:05:44 +0800 Subject: [PATCH 2/4] Consolidate github workflow build triggers --- .github/workflows/build-and-test-docker.yml | 3 +++ .github/workflows/build-and-test-make.yml | 2 ++ .github/workflows/build-win.yaml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-docker.yml b/.github/workflows/build-and-test-docker.yml index 19596d85..365c63b4 100644 --- a/.github/workflows/build-and-test-docker.yml +++ b/.github/workflows/build-and-test-docker.yml @@ -5,6 +5,9 @@ on: branches: - main - feature/* + - bugfix/* + tags: + - "v*.*.*" pull_request: branches: - main diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 6e368425..026b1e5f 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -4,6 +4,8 @@ on: push: branches: - main + - feature/* + - bugfix/* tags: - "v*.*.*" pull_request: diff --git a/.github/workflows/build-win.yaml b/.github/workflows/build-win.yaml index e8f644ca..b92c6fe7 100644 --- a/.github/workflows/build-win.yaml +++ b/.github/workflows/build-win.yaml @@ -4,6 +4,7 @@ on: branches: - main - feature/* + - bugfix/* tags: - "v*.*.*" pull_request: @@ -14,7 +15,6 @@ permissions: contents: write env: - NSS_VERSION: nss-3.77 BORING_SSL_COMMIT: d24a38200fef19150eef00cad35b138936c08767 jobs: From 1ef8b7e2f5ac0a60e39425bed0fe37f6ee390beb Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Tue, 5 Mar 2024 16:18:30 +0800 Subject: [PATCH 3/4] Change boringssl cache key to use host instead of arch --- .github/workflows/build-and-test-make.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 026b1e5f..5c2e1b75 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -102,17 +102,17 @@ jobs: # rebuild BoringSSL. This whole thing is a bit hacky, but necessary to # reduce the insanely long build times. - name: Cache BoringSSL source - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: boringssl.zip - key: ${{ runner.os }}-${{ matrix.arch }}-boring-source-${{ env.BORING_SSL_COMMIT }} + key: ${{ runner.os }}-${{ matrix.host }}-boring-source-${{ env.BORING_SSL_COMMIT }} - name: Cache BoringSSL build id: cache-boringssl - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: boringssl/build - key: ${{ runner.os }}-${{ matrix.arch }}-boring-build-${{ env.BORING_SSL_COMMIT }}-${{ hashFiles('chrome/patches/boringssl*.patch') }} + key: ${{ runner.os }}-${{ matrix.host }}-boring-build-${{ env.BORING_SSL_COMMIT }}-${{ hashFiles('chrome/patches/boringssl*.patch') }} # Trick the Makefile into skipping the BoringSSL build step # if it was found in the cache. See Makefile.in From 3f8028e351021685b433a25aef9c431bcee1a1f7 Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Tue, 5 Mar 2024 17:18:46 +0800 Subject: [PATCH 4/4] Skip test and strip for musl builds --- .github/workflows/build-and-test-make.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 5c2e1b75..9604b251 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -20,7 +20,7 @@ env: jobs: build-and-test-linux: - name: (Linux ${{ matrix.arch }}) Build curl-impersonate and run the tests + name: (${{ matrix.host }}) Build curl-impersonate and run the tests runs-on: ubuntu-latest env: CC: ${{ github.workspace }}/zigshim/cc @@ -130,25 +130,25 @@ jobs: make chrome-install - name: Prepare the tests - if: matrix.arch == 'x86_64' + if: matrix.host == 'x86_64-linux-gnu' run: | # Compile 'minicurl' which is used by the tests gcc -Wall -Werror -o ${{ runner.temp }}/install/bin/minicurl tests/minicurl.c `curl-config --libs` - uses: actions/setup-python@v4 - if: matrix.arch == 'x86_64' + if: matrix.host == 'x86_64-linux-gnu' with: python-version: '3.10' - name: Install dependencies for the tests script - if: matrix.arch == 'x86_64' + if: matrix.host == 'x86_64-linux-gnu' run: | pip3 install -r tests/requirements.txt # For now we can only run the tests when native # tests run the curl-impersonate binary locally. - name: Run the tests - if: matrix.arch == 'x86_64' + if: matrix.host == 'x86_64-linux-gnu' run: | cd tests # sudo is needed for capturing packets @@ -201,7 +201,11 @@ jobs: set -e make chrome-build make chrome-checkbuild - make chrome-install-strip + if [[ "${{ endsWith(matrix.host, 'musl') }}" == "true" ]]; then + make chrome-install + else + make chrome-install-strip + fi - name: Create tar release files for curl-impersonate run: |