Skip to content

demo: ship the GPL x264 flavor in the docker image - #154

Merged
pcarrier merged 1 commit into
mainfrom
demo-image-gpl
Aug 2, 2026
Merged

demo: ship the GPL x264 flavor in the docker image#154
pcarrier merged 1 commit into
mainfrom
demo-image-gpl

Conversation

@pcarrier

@pcarrier pcarrier commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

The demo image built plain blit (openh264). Ship the GPL flavor instead — same feature flags as the BLIT_GPL=1 install (--no-default-features --features x264) — so the container's software H.264 path uses the better encoder, including 4:4:4. The image already bundles plenty of GPL software (busybox, git, …), so nothing changes about its distribution terms in practice.

  • nix/packages.nix: fold the crane blit package into a mkBlit flavor function, add blit-gpl, expose it as a Linux package (nix build .#blit-gpl), and put it in the demo image contents
  • README: note the demo image carries the GPL flavor

Verified

  • nix build .#blit-gpl succeeds; the produced binary's blit --license reports the libx264/GPL-2.0-or-later notice
  • .#demo-image evaluates

The demo image built plain `blit` (openh264). Ship the GPL flavor
instead — same feature flags as the BLIT_GPL=1 install
(--no-default-features --features x264) — so the container's software
H.264 path uses the better encoder, including 4:4:4. The image already
bundles plenty of GPL software, so nothing changes about its
distribution terms in practice.

- packages.nix: fold the crane blit package into a mkBlit flavor
  function, add blit-gpl, expose it as a Linux package
  (nix build .#blit-gpl), and put it in the demo image contents
- README: note the demo image carries the GPL flavor

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@indent

indent Bot commented Aug 2, 2026

Copy link
Copy Markdown
PR Summary

Ships the GPL x264 flavor of blit in the grab/blit-demo Docker image so the container's software H.264 path uses x264 (better quality, 4:4:4-capable) instead of openh264, matching a BLIT_GPL=1 install's feature flags.

  • Refactors the crane blit package into an mkBlit pname featureArgs factory (behavior-preserving for plain blit).
  • Adds blit-gpl = mkBlit "blit-gpl" gplFeatureArgs and exposes it as a Linux flake package (nix build .#blit-gpl).
  • Puts blit-gpl (instead of blit) in the demo image contents; libx264 is bundled automatically via the binary's rpath closure.
  • Updates the README to note the demo image carries the GPL flavor.

Issues

Review closed.

CI Checks

Waiting for CI checks...

View session

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 69.7% (698/1002) 72.0% (54/75) 71.7% (1050/1464)
browser 0.0% (0/807) 0.0% (0/65) 0.0% (0/1370)
cli 17.2% (1521/8818) 28.1% (200/712) 20.1% (2730/13552)
compositor 2.6% (246/9558) 7.3% (32/439) 2.7% (352/12801)
fonts 81.4% (721/886) 88.6% (70/79) 83.0% (1427/1719)
fssync 92.5% (4880/5274) 94.1% (445/473) 92.5% (8926/9647)
gateway 26.1% (375/1437) 29.9% (38/127) 19.9% (470/2360)
git 87.2% (4162/4771) 88.2% (328/372) 86.9% (6589/7582)
lsp 76.0% (2503/3295) 78.2% (248/317) 73.8% (3886/5266)
proxy 19.3% (172/892) 20.5% (26/127) 21.2% (293/1381)
remote 90.2% (8628/9561) 92.9% (619/666) 88.0% (14359/16310)
sd-notify 73.9% (68/92) 100.0% (6/6) 83.2% (109/131)
server 37.2% (6500/17458) 51.0% (624/1224) 39.9% (11107/27824)
ssh 1.9% (7/374) 3.2% (1/31) 0.7% (4/613)
upsidedown 31.4% (391/1247) 27.8% (55/198) 34.8% (797/2287)
webrtc-forwarder 2.7% (72/2624) 2.1% (4/187) 1.2% (50/4335)
webserver 60.3% (1051/1742) 64.7% (156/241) 63.1% (1800/2851)
Total 45.8% (31995/69838) 54.4% (2906/5339) 48.4% (53949/111493)

@pcarrier
pcarrier merged commit f1f9c63 into main Aug 2, 2026
9 of 11 checks passed
@pcarrier
pcarrier deleted the demo-image-gpl branch August 2, 2026 19:05
pcarrier added a commit that referenced this pull request Aug 2, 2026
The demo image built plain `blit` (openh264). Ship the GPL flavor
instead — same feature flags as the `BLIT_GPL=1` install
(`--no-default-features --features x264`) — so the container's software
H.264 path uses the better encoder, including 4:4:4. The image already
bundles plenty of GPL software (busybox, git, …), so nothing changes
about its distribution terms in practice.

- `nix/packages.nix`: fold the crane `blit` package into a `mkBlit`
flavor function, add `blit-gpl`, expose it as a Linux package (`nix
build .#blit-gpl`), and put it in the demo image contents
- README: note the demo image carries the GPL flavor

## Verified

- `nix build .#blit-gpl` succeeds; the produced binary's `blit
--license` reports the libx264/GPL-2.0-or-later notice
- `.#demo-image` evaluates
@indent indent Bot mentioned this pull request Aug 2, 2026
pcarrier added a commit that referenced this pull request Aug 3, 2026
`publish-bin-npm` has been red since 0.43.0, so npm still has
`@blit-sh/bin` 0.42.0 while `@blit-sh/core` and `@blit-sh/browser` are
at 0.43.0:

```
scanning /home/runner/work/blit/blit/artifacts for release artifacts...
error: conflicting versions in artifacts: 0.43.0 vs blit-gpl
```

#152/#154 added `blit-gpl_*` tarballs to the release, and
`bin/build-npm-bin-packages` scans every `*.tar.gz`; stripping the
`blit_` prefix off `blit-gpl_0.43.0_linux_x86_64` leaves the name
untouched, so it read `blit-gpl` as the version.

Rather than skipping those artifacts, this publishes them:
**`@blit-sh/bin-gpl`** plus `@blit-sh/bin-gpl-linux-{x64,arm64}[-musl]`,
licensed `GPL-2.0-or-later`, so anyone who wants the x264 build can take
it off npm instead of unpacking a release tarball behind a
hand-maintained digest pin.

Details worth a look:

- Both launchers ship the same `npm/bin` sources. `resolve.js` used to
hardcode `@blit-sh/bin-…`; it now reads its own package name, so one
copy serves both flavors and the "no prebuilt binary" message names the
right package.
- The GPL launcher has **no `bin` field**. Two packages claiming the
`blit` shim would collide wherever both are installed (neo will have
both: GPL for linux boxes, MIT for the macOS desktop). Spawn its default
export, or use `curl -sf https://install.blit.sh | BLIT_GPL=1 sh` for a
CLI.
- `license` is `GPL-2.0-or-later` on the GPL packages and stays `MIT` on
the rest. Windows and macOS have no GPL build, so that set is unchanged.
- The first publish of each new package name has to be manual — npm only
lets you configure trusted publishing on a package that already exists —
so the script's usage comment now spells out the local bootstrap.

## Verified

Ran the script over a fixture artifact set holding both flavors
(`blit_0.43.0_{linux,linux-musl}_{x86_64,aarch64}`,
`blit_0.43.0_darwin_aarch64`, `blit_0.43.0_windows_x86_64.zip`, and the
four `blit-gpl_*`): it generates the ten platform packages plus both
launchers at `0.43.0`, with `.publish-order` listing platform packages
first. The same fixtures reproduce the CI error on `main`.

`npm pack`ed `@blit-sh/bin`, `@blit-sh/bin-gpl` and their linux-x64
platform packages and installed all four into one project:
`require`/`import` of each launcher resolves to its own binary
(`@blit-sh/bin` → the MIT one, `@blit-sh/bin-gpl` → the GPL one),
`candidatePackages()` returns the right prefixes, and
`node_modules/.bin` holds exactly one `blit`.

[![View in
Indent](https://assets.indent.com/view-in-indent.svg)](https://app.indent.com/c/019fc45e-4144-7ab5-bae5-e47db3ae9aeb)
Tag `@indent` to continue the conversation here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants