feat: warn on overlapping output files and unused staging files - #2790
Open
wolfv wants to merge 2 commits into
Open
feat: warn on overlapping output files and unused staging files#2790wolfv wants to merge 2 commits into
wolfv wants to merge 2 commits into
Conversation
After all outputs are built, warn when two outputs of one recipe package the same file (installing both clobbers it), and when files from a staging cache were not included in any output that inherits from it. `--error-overlapping-files` and `--error-unused-staging-files` turn the warnings into hard errors. Both checks compare the prefix-relative files each output selected for packaging, recorded in the build summary before noarch path remapping. A cache is only judged when all of its inheriting outputs were packaged in the run, so `--skip-existing` or a failed output cannot produce false positives. Ref #2730 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Rj3CRpTRFpCtsnCVdaaQd
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.
Ref #2730 (see also #2753)
Adds two cross-output consistency checks that run after all outputs are built:
filesselection.files:constraint inherits entire staging output as content #2730).Both are warnings by default;
--error-overlapping-filesand--error-unused-staging-filesturn them into hard errors. Warnings are also recorded on the involved outputs so they appear in build/markdown summaries.How
create_packagenow records the prefix-relative files each output selected for packaging (before noarch path remapping) in the build summary. The checks in the newoutput_checksmodule compare those sets:prefix_filesfrom the cache'smetadata.json, minus files packaging always drops (CACHEDIR.TAG,.pyo, …). A cache is only judged when all of its inheriting outputs were packaged in the run — a consumer skipped by--skip-existing/--noarch-build-platformor failed under--continue-on-failureleaves usage unknown, so no false errors (verified manually with--skip-existing=local --error-unused-staging-files).Notes
test-data/recipes/staging/multiple-staging-caches.yamlnow (correctly) warns:libcoreandcore-headersgenuinely both packageinclude/core.h.--error-prefix-in-binary; py-rattler-build passes the defaults (can be exposed as kwargs later).rattler_build_docs; prose section added todocs/multiple_output_cache.md.Tests
test_staging_consistency_checks: both warnings fire on a new fixture, and each flag makes the build fail.test_staging_checks_quiet_when_all_files_used: a recipe whose outputs cover the cache and share nothing builds clean under both strict flags.test_system_tool(nopatchelfin the dev container); all 23 staging e2e tests pass; fmt and clippy clean.🤖 Generated with Claude Code
https://claude.ai/code/session_016Rj3CRpTRFpCtsnCVdaaQd
Generated by Claude Code