Skip to content

Commit 441d3d8

Browse files
committed
fix(build): rendre effectifs deux garde-fous qui passaient à vide
Deux trouvailles de la revue CodeRabbit sur #220, vérifiées avant correction. assertLgpl propageait l'environnement partagé à -L et -buildconf mais pas au contrôle -encoders ni à la bannière -version finale. Sur un build SHARED Linux, ffmpeg ne résout pas ses propres libav*.so sans LD_LIBRARY_PATH : il n'imprime rien, et le contrôle ceinture-bretelles qui cherche libx264/libx265 opérait donc sur une chaîne vide. Il ne rejetait rien, jamais. Mesuré : 0 octet sans l'environnement, 13 397 octets et 229 encodeurs avec. C'est un garde-fou de conformité LGPL. Passer à vide y est pire qu'échouer. Les téléchargements macOS d'artefacts portaient continue-on-error: true, alors qu'un workflow_dispatch peut cibler une seule arch tout en fournissant un release_tag. Le contrôle final ne rejette qu'un répertoire entièrement vide, si bien qu'une release pouvait se publier avec un seul DMG sur les deux, sans que rien ne rougisse. C'est le mode d'échec silencieux que cette PR entend supprimer, appliqué à macOS au lieu de Windows. Le revert avait déjà retiré le même drapeau côté Linux ; les deux macOS le suivent. Un dispatch délibérément mono-arch échouera désormais à la publication plutôt que de livrer une release incomplète. C'est le comportement voulu : l'opérateur le verra et tranchera.
1 parent e123f20 commit 441d3d8

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,12 @@ jobs:
415415
path: artifacts/windows
416416

417417
- name: Download macOS arm64 DMG
418-
continue-on-error: true
419418
uses: actions/download-artifact@v4
420419
with:
421420
name: openscreen-mac-arm64
422421
path: artifacts/mac-arm64
423422

424423
- name: Download macOS x64 DMG
425-
continue-on-error: true
426424
uses: actions/download-artifact@v4
427425
with:
428426
name: openscreen-mac-x64

scripts/fetch-ffmpeg.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ function assertLgpl(exePath, extraEnv) {
190190

191191
// Belt and braces: whatever the flags claim, the binary must not actually
192192
// expose a GPL encoder.
193-
const encoders = run(exePath, ["-hide_banner", "-encoders"]).stdout ?? "";
193+
// `opts` here too: without it a SHARED build cannot resolve its own libav*.so,
194+
// prints nothing, and this check passes on an empty string — silently vouching
195+
// for exactly the binaries it exists to reject. Measured: 0 bytes without the
196+
// env, 229 encoders with it.
197+
const encoders = run(exePath, ["-hide_banner", "-encoders"], opts).stdout ?? "";
194198
for (const lib of ["libx264", "libx265"]) {
195199
if (new RegExp(`\\s${lib}\\s`).test(encoders)) problems.push(`exposes the ${lib} encoder`);
196200
}
@@ -202,7 +206,7 @@ function assertLgpl(exePath, extraEnv) {
202206
"Bundling it would relicense OpenScreen under the GPL.",
203207
);
204208
}
205-
const ver = run(exePath, ["-hide_banner", "-version"]).stdout ?? "";
209+
const ver = run(exePath, ["-hide_banner", "-version"], opts).stdout ?? "";
206210
return ver.split("\n")[0]?.trim() ?? "";
207211
}
208212

0 commit comments

Comments
 (0)