Repository navigation
fix(tier3): stop passing apt-get a blank package in generated Dockerfiles - #471
Conversation
…iles The three generated apt-get blocks end the base package line with a continuation backslash. When any staged skill declared packages in apt-packages.txt, the code appended a second " \", which gave `ripgrep \ \`. Docker joins the final continuation, and the shell then reads the escaped space as an argument of one space. apt-get failed with "Unable to locate package " and the image did not build. The blocks are in the shared eval base image, generated task Dockerfiles and the default Dockerfile for native Harbor tasks. Drop the extra backslash in all three. The new tests join Docker continuations, split the RUN command the way sh does, and assert the exact apt-get install arguments for each generator. On unfixed main the cases with extra packages fail. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
chrisknvidia
left a comment
There was a problem hiding this comment.
The fix is right: the base line already ends in a backslash, so the extra ' ' turned into an escaped space and apt-get got a package named ' '. Removing it in all three blocks (build_eval_base_image, _write_dockerfile, _write_default_environment_dockerfile) is the whole change, base-only output is identical, and there is no other generator that appends the same suffix. Blank and whitespace-only lines are already filtered by both collectors, so I could not produce a blank package from any path. The new tests are real: they fail on the old code, and the shlex-after-continuation approach mirrors what Docker and sh do.
Before merge: rebase (CHANGELOG conflict, keep both entries) and change _BASE_PACKAGES in the new test to adapter_module._BASE_APT_PACKAGES.split(), because main added procps to the base list and every case in the file fails with the hard-coded list. With that one-line change the file passes on a local merge with main.
Not blocking: a blank/whitespace/CRLF case in the test would pin the guarantee. And for the inline-comment follow-up you already noted: 'tree # for listing' makes the shell drop every later package and the apt-lists cleanup, silently.
Signed-off-by: Christopher Kevin <[email protected]>
The apt install line tests hard-coded the base package list, so adding procps to the base list made every case fail, including the ones that declare no extra packages. Build the expected base packages from _BASE_APT_PACKAGES instead. The assertions still compare the full package list, so a blank or stray entry still fails them. Signed-off-by: Christopher Kevin <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Reviewed all three generator changes, both dependency collectors, shell continuation behavior, and the full new test file at 373c26e. The author’s main integration and dynamic base-package expectation are preserved. Added the suggested blank/whitespace/CRLF cases; all 15 generated/shared/native cases pass, with clean Ruff/format. No new actionable regression. The inline tree # comment parser issue remains an acknowledged pre-existing follow-up; this PR changes only the redundant continuation and its test coverage. The earlier Python3.13 failure occurred in the unrelated RAGAS deadline test when logging swallowed SIGALRM; its full evidence was preserved and a separate fix is being prepared. Monitoring this new head’s CI.
rng1995
left a comment
There was a problem hiding this comment.
Current-head adoption review: 1062908 is the exact clean automatic merge of reviewed/tested 373c26e and main 6eb7563. Adapter AST, the dynamic base-apt package split fix, and its blank/whitespace/CRLF regression cases are preserved. The 15 focused cases were run on 373c26e; no full rerun on this merge commit is claimed. Current-head CI has only Python 3.12 coverage still running; all other current checks are successful or skipped. No new actionable finding from this merge review.
Summary
In each of the three generated
apt-getblocks, the base package line already ends with a continuation backslash. When any staged skill declared packages inapt-packages.txt, the code appended a second\, which producedripgrep \ \. Docker joins the final continuation, and the shell then reads the escaped space as an argument of one space.apt-getfailed withUnable to locate packageand the image did not build.The blocks are in the shared eval base image, generated task Dockerfiles, and the default Dockerfile for native Harbor tasks. This PR drops the extra backslash in all three.
Not changed: an inline
#comment inapt-packages.txtorrequirements.txtstill reaches the install line. This predates the PR and is out of scope here.Verification
tests/test_harbor_apt_install_lines.pyjoins Docker continuations, splits theRUNcommand the wayshdoes, and asserts the exactapt-get installarguments for each generator, with no extras, one extra, and two extras plus a comment line. On unfixed main, all 6 cases with extra packages fail on the' 'package.make lintmake test: every test file that imports the adapter passed (3285 passed). The 2test_harbor_secure_docker_environmentsidecar tests that fail also fail onorigin/main.make build(not run; no packaging change)Docker check on
python:3.12-slim:apt-packages.txt=treefails withE: Unable to locate package.treeandzstdbuilds, and both tools run.The OSS boundary scan passes.
Release Impact
CHANGELOG.md🤖 Generated with Claude Code