fix: pin musl 1.2.5 for DNS fixes (#6189)
## Summary musl 1.2.5 includes [several fixes to DNS over TCP](https://www.openwall.com/lists/musl/2024/03/01/2), which appears to be the root cause of #6116. This approach is a bit janky, but according to codex: > On the Ubuntu 24.04 runners we use, apt-cache policy musl-tools shows only the distro build (1.2.4-2ubuntu2)" We should build with this version and confirm. ## Testing - [ ] TODO: test and see if this fixes Azure issues
This commit is contained in:
47
.github/actions/setup-musl-1_2_5/action.yml
vendored
Normal file
47
.github/actions/setup-musl-1_2_5/action.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
name: Setup musl 1.2.5 toolchain
|
||||||
|
description: Install musl 1.2.5 from source and configure the linker for the requested target.
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
description: Cargo target triple that requires musl (e.g., x86_64-unknown-linux-musl).
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Install musl 1.2.5
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
MUSL_VERSION: 1.2.5
|
||||||
|
MUSL_PREFIX: /opt/musl-1.2.5
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
sudo apt-get -y update -o Acquire::Retries=3
|
||||||
|
sudo apt-get -y install --no-install-recommends build-essential curl pkg-config
|
||||||
|
|
||||||
|
curl -sSfL --retry 3 --retry-delay 1 "https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz" -o /tmp/musl.tar.gz
|
||||||
|
tar -xf /tmp/musl.tar.gz -C /tmp
|
||||||
|
|
||||||
|
pushd "/tmp/musl-${MUSL_VERSION}"
|
||||||
|
./configure --prefix="${MUSL_PREFIX}"
|
||||||
|
make -j"$(nproc)"
|
||||||
|
sudo make install
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo "${MUSL_PREFIX}/bin" >> "$GITHUB_PATH"
|
||||||
|
musl_gcc="${MUSL_PREFIX}/bin/musl-gcc"
|
||||||
|
"${musl_gcc}" --version
|
||||||
|
|
||||||
|
case "${{ inputs.target }}" in
|
||||||
|
x86_64-unknown-linux-musl)
|
||||||
|
echo "CC_x86_64_unknown_linux_musl=${musl_gcc}" >> "$GITHUB_ENV"
|
||||||
|
echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=${musl_gcc}" >> "$GITHUB_ENV"
|
||||||
|
;;
|
||||||
|
aarch64-unknown-linux-musl)
|
||||||
|
echo "CC_aarch64_unknown_linux_musl=${musl_gcc}" >> "$GITHUB_ENV"
|
||||||
|
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=${musl_gcc}" >> "$GITHUB_ENV"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported musl target '${{ inputs.target }}'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
12
.github/workflows/rust-ci.yml
vendored
12
.github/workflows/rust-ci.yml
vendored
@@ -217,14 +217,10 @@ jobs:
|
|||||||
key: apt-${{ matrix.runner }}-${{ matrix.target }}-v1
|
key: apt-${{ matrix.runner }}-${{ matrix.target }}-v1
|
||||||
|
|
||||||
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
|
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
|
||||||
name: Install musl build tools
|
name: Setup musl 1.2.5 toolchain
|
||||||
env:
|
uses: ./.github/actions/setup-musl-1_2_5
|
||||||
DEBIAN_FRONTEND: noninteractive
|
with:
|
||||||
shell: bash
|
target: ${{ matrix.target }}
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
sudo apt-get -y update -o Acquire::Retries=3
|
|
||||||
sudo apt-get -y install --no-install-recommends musl-tools pkg-config
|
|
||||||
|
|
||||||
- name: Install cargo-chef
|
- name: Install cargo-chef
|
||||||
if: ${{ matrix.profile == 'release' }}
|
if: ${{ matrix.profile == 'release' }}
|
||||||
|
|||||||
8
.github/workflows/rust-release.yml
vendored
8
.github/workflows/rust-release.yml
vendored
@@ -92,10 +92,10 @@ jobs:
|
|||||||
key: cargo-${{ matrix.runner }}-${{ matrix.target }}-release-${{ hashFiles('**/Cargo.lock') }}
|
key: cargo-${{ matrix.runner }}-${{ matrix.target }}-release-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
|
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
|
||||||
name: Install musl build tools
|
name: Setup musl 1.2.5 toolchain
|
||||||
run: |
|
uses: ./.github/actions/setup-musl-1_2_5
|
||||||
sudo apt-get update
|
with:
|
||||||
sudo apt-get install -y musl-tools pkg-config
|
target: ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Cargo build
|
- name: Cargo build
|
||||||
run: cargo build --target ${{ matrix.target }} --release --bin codex --bin codex-responses-api-proxy
|
run: cargo build --target ${{ matrix.target }} --release --bin codex --bin codex-responses-api-proxy
|
||||||
|
|||||||
Reference in New Issue
Block a user