fix: compile all deps in CI image to resolve transitive compile deps
Some checks failed
Build and Push / Build CI test image (push) Successful in 5m11s
Build and Push / Build and Push Docker Image (push) Failing after 15m14s

EXLA's cached_make needs Mix.Tasks.Compile.ElixirMake (from elixir_make),
which must be compiled first. mix deps.compile exla alone doesn't handle
transitive compile-time deps. Use mix deps.compile without args to
compile in dependency order.
This commit is contained in:
Graham McIntire 2026-08-05 09:26:16 -05:00
parent 32b428f49b
commit 88c46b9c1d

View file

@ -38,13 +38,13 @@ COPY vendor /tmp/exla_warm/vendor
RUN mkdir -p /tmp/exla_warm/config && \ RUN mkdir -p /tmp/exla_warm/config && \
printf 'import Config\nconfig :nx, :default_backend, EXLA.Backend\n' > /tmp/exla_warm/config/config.exs printf 'import Config\nconfig :nx, :default_backend, EXLA.Backend\n' > /tmp/exla_warm/config/config.exs
# Fetch deps and compile EXLA. xla must be compiled first — exla's # Fetch and compile all deps. EXLA's cached_make compiler calls
# extract_xla compiler calls XLA.archive_path!/0 at build time. # Mix.Tasks.Compile.ElixirMake at build time, which requires elixir_make
# mix deps.compile exla alone skips transitive deps, so we explicitly # to be compiled first. mix deps.compile without arguments handles
# order xla → exla. The cached_make compiler then downloads the XLA # dependency ordering automatically. The cached_make step downloads the
# archive, extracts it, compiles the C++ NIF, and caches libexla.so at # XLA archive, compiles the C++ NIF, and caches libexla.so at
# ~/.cache/xla/exla/{cache_key}/libexla.so. # ~/.cache/xla/exla/{cache_key}/libexla.so.
RUN mix deps.get && mix deps.compile xla && mix deps.compile exla RUN mix deps.get && mix deps.compile
# Clean up the temp project — the cache in ~/.cache/xla/ persists in # Clean up the temp project — the cache in ~/.cache/xla/ persists in
# the image and is what matters. # the image and is what matters.