repo: normalize only if there are packages to unpack
Metadata
Current evaluation
Merged PR #3534 in commit bd493eb8a, fixing pathlib.glob generator handling so staged package contents are normalized only when packages exist to unpack.
Resolution: closed resolved
Reason: PR #3534 was merged as bd493eb8a. The fix uses generator-aware package-presence verification and adds a regression test in commit 1a162e698.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Stage package contents should be normalized after unpacking, but only
if there are packages to unpack. Previous code to test this condition
assumed that pathlib's glob returned a list instead of a generator.
Fix the package presence verification (without unecessarily obtaining
a package list from the generator).
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3534 in commit bd493eb8a, fixing pathlib.glob generator handling so staged package contents are normalized only when packages exist to unpack. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3534 via commit bd493eb8, fixing pathlib.glob generator handling so staged package contents are normalized only when packages exist to unpack. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged into master. Fixes a bug where pathlib.glob was incorrectly assumed to return a list instead of a generator. Ensures stage package normalization only runs when packages exist to unpack. Approved by two reviewers and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for pathlib.glob usage in stage package normalization. Previously assumed glob returned a list, causing verification errors. Updated to efficiently check for packages without converting the generator, then merged into master. |
Update history
No update history recorded yet.
Related work
-
Caused By:
snapcraft#3529
(confidence 95%)
The earlier stage-package normalization change introduced the incorrect list-based pathlib.glob check.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3529 repo: normalize if stage-packages and check types (CRAFT-222) | snapcraft | merged | Merged in #3529 as commit 58d50bf, fixing stage-packages normalization to check file types so directories such as snap.pc are not passed to fileinput. | |
| #76 packages: normalize unpacked stage packages (CRAFT-33) | craft-parts | merged | Merged PR #76 (commit 486bc6b9) added craft_parts/packages/normalize.py, porting Snapcraft package normalization: shebang rewriting, relative symlinks, suid/gid cleanup, and pkg-config/xml2/xslt path fixes. |