Tolerate missing .git in Marian, document --env local, bake engines into Dockerfile - #4
Open
wheatear-dev wants to merge 3 commits into
Open
Tolerate missing .git in Marian, document --env local, bake engines into Dockerfile#4wheatear-dev wants to merge 3 commits into
wheatear-dev wants to merge 3 commits into
Conversation
build-cleanup.sh --minimal deliberately strips marian/.git to save image size, which is fine for a one-shot build, but CMake hard-fails with "file failed to open for reading" if you ever need to reconfigure/rebuild Marian afterward (e.g. after changing a related CMakeLists.txt), since it unconditionally tries to read .git to embed a version string with no existence check. Verified: applied against a fresh checkout of the pinned Marian commit (in the same order build-marian.sh uses), and confirmed the actual failure scenario (a stripped .git) now reconfigures cleanly and embeds a "unknown" placeholder revision instead of erroring. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Cost real debugging time: without it, core silently gets the raw, unflattened services.yaml merged into its environment (since serenade.config.services(None) returns the whole default/docker/local structure rather than a flattened profile), so CODE_ENGINE_HOST etc. are never actually set and core falls back to bare service-name hostnames that only resolve via Compose's network aliases. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copies the Gradle subprojects each service needs (excluding client/, which .dockerignore blocks anyway) and runs a scoped installDist so the image ends up with all three engine services built in, not just their C++ dependencies. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
file(READ ../.git ...)version-string read so builds survive a source tree with.gitstripped (e.g. slimmed-down Docker base images), instead of crashing CMake configure.--env localflag requirement forscripts/serenade/bin/run.pywhen running services outside real Docker Compose networking (without it,corecan't resolvecode-engine/speech-enginehostnames).core/code-engine/speech-enginebuilds intoconfig/Dockerfilevia a scopedgradle installDist, so the image ends up with all three engine services built in rather than just their C++ dependencies.Test plan
.git-missing crash, confirmed the patch fixes it, verified normal (non-missing-.git) builds still work.gradle core:installDist code-engine:installDist speech-engine:installDistsucceeds against the exact directory set the modified Dockerfile copies in.🤖 Generated with Claude Code