Emit Depends and the 8 other dropped control fields - #10
Merged
Merged
Conversation
format_control_file emitted a hardcoded 12 fields, silently discarding Depends, Pre-Depends, Recommends, Suggests, Conflicts, Replaces, Provides, Vendor and Authors even though the CLI accepts them, the values reach DebianControl, and content_verifier parses them back out of dpkg-deb -I to check them. build could not produce a package its own verifier was written to validate. The failure was silent: build exited 0 and emitted a well-formed .deb that installed fine wherever the dependencies happened to already be present, and only failed on a clean target. Optional fields are omitted when unset or empty rather than emitted blank, since dpkg has no use for a valueless relationship field. The original twelve stay unconditional so existing packages keep byte-identical stanzas. Lists join with ", ", which round-trips through the verifier's split-on-comma-and-trim. Fixes #9
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.
Fixes #9
What
format_control_fileemitted a hardcoded 12 fields, silently discardingDepends,Pre-Depends,Recommends,Suggests,Conflicts,Replaces,Provides,VendorandAuthors— even though the CLI accepts all nine, the values reachDebianControl, andcontent_verifierparses them back out ofdpkg-deb -Iin order to check them.buildcould not produce a package its ownverify contentwas written to validate.The failure was silent:
buildexited 0 and produced a well-formed.debthat installed fine wherever the dependencies happened to already be present, failing only on a clean target.All the data already reached
DebianControl, so the change is confined to the renderer.Design calls
Optional fields are omitted when unset or empty, not emitted blank — dpkg has no use for a valueless
Depends:.The original twelve stay unconditional, blank or not, so packages built before this change keep byte-identical stanzas (
Installed-Size:andSource:are routinely empty in practice). I deliberately left their empty-handling alone; changing it is unrelated scope with real breakage risk.Lists join with
", ", which round-trips throughcontent_verifier's split-on-comma-and-trim. One test pins exactly that, so the writer and reader can't drift apart again.Field order follows Debian convention —
Vendor/AuthorsafterMaintainer, relationship fields afterInstalled-Size. Order is not semantically significant, and existing tests assert withcontains.Verification
7 new unit tests (this function had none): emission, omission when unset, empty-and-blank-only lists, entry trimming, the original twelve still unconditional, and the verifier round-trip.
Full CI gate green locally:
cargo fmt --check,cargo clippy --all-targets -D warnings,cargo test --all-targets(51 lib + 9 integration),cargo test --doc.Before/after on a real
.deb, identical flags both times:The
BEFORErun exited 0 and produced a package with none of them.Not in scope
Origin,LabelandBreaksare not modelled at all (absent fromDebianControl, not merely unemitted).minaemits all three, so they block a full migration of its build path — but they're additive features rather than this bug. The README's "Known limitation" section now names exactly those three.