Skip to content

Commit e85d769

Browse files
committed
feat: add libc tagging support for Linux packages
Implement --tag-libc support for prebuildify to distinguish between glibc and musl variants on Linux, following official N-API best practices for precompiled binary distribution. Changes: - Add --tag-libc flag to prebuildify wrapper (ci-workflow.ts) - Update platform package naming to include libc suffix (platform-package.ts) - Update CI workflow to pass --libc glibc for Linux builds (ci.yml) - Update runtime binding loader to resolve glibc-tagged packages (binding.ts) - Update package.json optionalDependencies with new package name - Update create-platform-packages script for glibc platform config - Add comprehensive build system documentation (build-system.md) - Add detailed implementation guide (libc-tagging-implementation.md) Package name change: - Before: @pproenca/node-webcodecs-linux-x64 - After: @pproenca/node-webcodecs-linux-x64-glibc This change improves platform targeting and aligns with official prebuildify guidance for libc tagging. Infrastructure is now ready for future musl (Alpine Linux) support. Ref: https://nodejs.org/api/n-api.html#uploading-precompiled-binaries
1 parent 7d3e7ce commit e85d769

8 files changed

Lines changed: 965 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
run: npx tsx scripts/ci/ci-workflow.ts extract-ffmpeg --archive "ffmpeg-${{ matrix.platform }}.tar.gz" --out ffmpeg-install
206206

207207
- name: Build with prebuildify
208-
run: npx tsx scripts/ci/ci-workflow.ts prebuildify --arch "${{ matrix.arch }}" --platform "${{ matrix.platform }}"
208+
run: npx tsx scripts/ci/ci-workflow.ts prebuildify --arch "${{ matrix.arch }}" --platform "${{ matrix.platform }}"${{ runner.os == 'Linux' && ' --libc glibc' || '' }}
209209

210210
- name: Build TypeScript
211211
run: npm run build:ts
@@ -218,20 +218,21 @@ jobs:
218218
PLATFORM: ${{ matrix.platform }}
219219
PLATFORM_OS: ${{ runner.os == 'macOS' && 'darwin' || 'linux' }}
220220
PLATFORM_CPU: ${{ matrix.arch }}
221-
run: npx tsx scripts/ci/ci-workflow.ts package-platform --platform "$PLATFORM" --os "$PLATFORM_OS" --cpu "$PLATFORM_CPU" --prebuild "prebuilds/${{ matrix.platform }}/node.napi.node" --out packages
221+
PLATFORM_LIBC: ${{ runner.os == 'Linux' && 'glibc' || '' }}
222+
run: npx tsx scripts/ci/ci-workflow.ts package-platform --platform "$PLATFORM" --os "$PLATFORM_OS" --cpu "$PLATFORM_CPU" --prebuild "prebuilds/${{ matrix.platform }}/node.napi.node" --out packages${{ runner.os == 'Linux' && ' --libc glibc' || '' }}
222223

223224
- name: Upload platform package artifact
224225
uses: actions/upload-artifact@v6
225226
with:
226-
name: platform-pkg-${{ matrix.platform }}
227-
path: packages/@pproenca-node-webcodecs-${{ matrix.platform }}.tar
227+
name: platform-pkg-${{ matrix.platform }}${{ runner.os == 'Linux' && '-glibc' || '' }}
228+
path: packages/@pproenca-node-webcodecs-${{ matrix.platform }}${{ runner.os == 'Linux' && '-glibc' || '' }}.tar
228229
retention-days: 14 # Extended for release timing flexibility
229230
compression-level: 0
230231

231232
- name: Attest platform package
232233
uses: actions/attest-build-provenance@v3
233234
with:
234-
subject-path: packages/@pproenca/node-webcodecs-${{ matrix.platform }}/bin/node.napi.node
235+
subject-path: packages/@pproenca/node-webcodecs-${{ matrix.platform }}${{ runner.os == 'Linux' && '-glibc' || '' }}/bin/node.napi.node
235236

236237
# ============================================================================
237238
# Test Node version compatibility using prebuilt binaries

0 commit comments

Comments
 (0)