Documentation Index
Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
Use this file to discover all available pages before exploring further.
bootsnap precompile defaults to host-CPU parallelism. Inside docker buildx’s QEMU emulation —
the standard path for any multi-arch Rails container build — that parallel mode trips a known QEMU
bug and crashes the build. The Rails 7.1+ generator template carries -j 1 and a code comment
about this exact failure mode.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | Correctness |
| Default | Enabled |
| Auto-fix | Yes (safe) |
Description
This rule fires when aRUN instruction executes bootsnap precompile (with or without a
bundle exec prefix) and does not carry -j 1 (or any of the equivalent forms -j1, -j=1,
--jobs 1, --jobs=1).
Recognized as compliant:
-j 1/-j1/-j=1--jobs 1/--jobs=1- The same
RUNis wrapped in aBUILDPLATFORM == TARGETPLATFORMshell check (the user has explicitly avoided emulated paths). Detection is heuristic: bothBUILDPLATFORMandTARGETPLATFORMmust appear in the script alongside the bootsnap call.
ruby:* bases,
known derivatives, or stages whose env or runtime command signals Ruby/Rails. Stages explicitly
named dev, development, test, testing, ci, or debug are skipped, as are Windows-based
stages.
When Gemfile.lock is observable in the build context (via --context, Bake, or Compose), the
rule additionally suppresses if the lockfile does not list bootsnap as a dependency. Some
boilerplate Dockerfiles still carry bootsnap precompile for projects that have removed
bootsnap from their Gemfile; the rule should not fire on those.
The rule does not fire on bootsnap invocations other than precompile (for example,
bootsnap doctor).
Examples
Before
After
The Rails-generator-style fix inserts-j 1 directly after bootsnap precompile. Bootsnap then
compiles serially and avoids the QEMU emulation crash.
if [ "$BUILDPLATFORM" = "$TARGETPLATFORM" ]; then …; fi check, the rule stands down — the
parallel path is provably never reached under QEMU.
Auto-fix
The rule offers aFixSafe text edit that inserts -j 1 immediately after the
bootsnap precompile token. The edit is structural-neutral: it adds one flag without rewriting
any surrounding shell or moving any other arguments, so it is eligible for batch --fix runs.
References
- bootsnap issue #495 — upstream tracking issue
for the QEMU multi-arch crash that motivated the
-j 1flag. - Rails Dockerfile generator template
— emits
bundle exec bootsnap precompile -j 1 …with a code comment about the QEMU bug.