Skip to content

Commit 3ed7c54

Browse files
authored
Fix Linux manylinux wheel builds with Docker sibling deps (#35)
- Use manylinux: auto for Linux builds (not off) - Mount parent directory in Docker for sibling deps - Create symlinks in before-script-linux for ../syft-crypto-core and ../syftbox - PyPI requires manylinux platform tags for Linux wheels
1 parent 57071f4 commit 3ed7c54

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,15 @@ jobs:
121121
fail-fast: false
122122
matrix:
123123
include:
124-
# Linux builds natively (not in Docker) due to sibling path dependencies
125-
# Uses manylinux_2_28 tag but builds on host for compatibility
124+
# Linux builds use manylinux Docker with parent directory mounted
125+
# for sibling dependencies (../syft-crypto-core, ../syftbox)
126126
- os: ubuntu-latest
127127
target: x86_64-unknown-linux-gnu
128-
manylinux: off
129-
container: off
128+
manylinux: auto
130129
py-interpreter: "python3.13"
131130
- os: ubuntu-24.04-arm
132131
target: aarch64-unknown-linux-gnu
133-
manylinux: off
134-
container: off
132+
manylinux: auto
135133
py-interpreter: "python3.13"
136134
# macOS and Windows build natively
137135
- os: macos-latest
@@ -183,7 +181,26 @@ jobs:
183181
args: --release --out dist --interpreter ${{ matrix.py-interpreter }}
184182
sccache: "true"
185183
manylinux: ${{ matrix.manylinux }}
186-
container: ${{ matrix.container || '' }}
184+
docker-options: -v ${{ github.workspace }}/..:/parent:ro
185+
before-script-linux: |
186+
# Install protoc in the manylinux container
187+
PROTOC_VERSION="28.3"
188+
ARCH="$(uname -m)"
189+
if [ "$ARCH" = "aarch64" ]; then
190+
PROTOC_ARCH="aarch_64"
191+
else
192+
PROTOC_ARCH="$ARCH"
193+
fi
194+
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip"
195+
unzip -q protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip -d /usr/local
196+
rm protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip
197+
protoc --version
198+
# Create symlinks for sibling dependencies at root level
199+
# Cargo.toml in /io references ../syft-crypto-core which resolves to /syft-crypto-core
200+
echo "Setting up workspace dependencies in container..."
201+
ln -sf /parent/syft-crypto-core /syft-crypto-core
202+
ln -sf /parent/syftbox /syftbox
203+
ls -la /syft-crypto-core /syftbox
187204
188205
- name: Upload wheels
189206
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)