diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 366cd0b2b..18c9113ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -551,6 +551,52 @@ jobs: path: ${{ env.UV_WORKSPACE }}/target/debug/uv.exe retention-days: 1 + build-binary-freebsd: + needs: determine_changes + timeout-minutes: 10 + if: ${{ github.repository == 'astral-sh/uv' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} + runs-on: + labels: ubuntu-latest + name: "build binary | freebsd" + + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v2 + - name: "Cross build" + run: | + # Install cross from `freebsd-firecracker` + wget -q -O cross https://github.com/acj/freebsd-firecracker/releases/download/v0.0.10/cross + chmod +x cross + mv cross /usr/local/bin/cross + + cross build --target x86_64-unknown-freebsd + + - name: Test in Firecracker VM + uses: acj/freebsd-firecracker-action@v0.2.0 + with: + verbose: false + pre-run: | + # The exclude `*` prevents examination of directories so we need to + # include each parent directory of the binary + include_path="$(mktemp)" + cat < $include_path + target + target/x86_64-unknown-freebsd + target/x86_64-unknown-freebsd/debug + target/x86_64-unknown-freebsd/debug/uv + EOF + + rsync -r -e "ssh" \ + --relative \ + --copy-links \ + --include-from "$include_path" \ + --exclude "*" \ + . firecracker: + run-in-vm: | + cp target/x86_64-unknown-freebsd/debug/uv uv + chmod +x uv + ./uv --version + ecosystem-test: timeout-minutes: 10 needs: build-binary-linux diff --git a/crates/uv-performance-flate2-backend/Cargo.toml b/crates/uv-performance-flate2-backend/Cargo.toml index df9e4190b..5a7e27449 100644 --- a/crates/uv-performance-flate2-backend/Cargo.toml +++ b/crates/uv-performance-flate2-backend/Cargo.toml @@ -6,8 +6,8 @@ publish = false [lib] doctest = false -[target.'cfg(not(any(target_arch = "s390x", target_arch = "powerpc64")))'.dependencies] +[target.'cfg(not(any(target_arch = "s390x", target_arch = "powerpc64", target_os = "freebsd")))'.dependencies] flate2 = { version = "1.0.28", default-features = false, features = ["zlib-ng"] } -[target.'cfg(any(target_arch = "s390x", target_arch = "powerpc64"))'.dependencies] +[target.'cfg(any(target_arch = "s390x", target_arch = "powerpc64", target_os = "freebsd"))'.dependencies] flate2 = { version = "1.0.28", default-features = false, features = ["rust_backend"] }