← Back to issue list

pluginhandler: do not search installdir or stagedir for dependencies

View original Github issue

Metadata

Project
snapcraft
Number
#2942
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged in snapcraft#2942 (commit 80ff1935), restricting plugin dependency checks to primedir so files filtered from the final snap are not used.

Resolution: closed resolved

Reason: PR #2942 was merged as commit 80ff1935. It replaced dependency searching across install and stage directories with primedir-only checks and added coverage for found and missing dependencies.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The search paths already include primedir which has all of the primed and staged files at this point. The installdir and stagedir may contain files that are not shipped in the final snap, so limit search to primedir as it should be fully populated. - Replace _handle_dependencies() with a simpler _warn_missing_dependencies() and _calculate_dependency_paths() called from _handle_elf(). - Add a couple useful debug prints. - Add two tests to cover the case where the dependency is found, and another where the dependency is missing. For the latter, the lib is removed using `stage` configuration. This last test would have previously failed, because the dependency was found in installdir, and ignored by the missing dependency resolver. Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged in snapcraft#2942 (commit 80ff1935), restricting plugin dependency checks to primedir so files filtered from the final snap are not used.
stealth/space-bunny-alpha — closed resolved Merged in PR #2942 (commit 80ff1935), limiting plugin dependency checks to primedir to avoid using files filtered from the final snap.
qwen/qwen3.6-35b-a3b — — Merged. Refactors dependency resolution to search only primedir, preventing false positives for filtered files. Replaces _handle_dependencies() with _warn_missing_dependencies() and _calculate_dependency_paths(), adds tests, and prepares for future migration.
qwen3.6-35b-a3b-mtp-q6 — — Merged pluginhandler changes restricting dependency searches to primedir, excluding installdir and stagedir. Replaces _handle_dependencies with simpler warning and path functions, adds tests, and fixes false positive detection.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1231 pluginhandler: exclude `/snap/` from libraries. snapcraft merged Merged snapcraft#1231 in commit 0e9b5a84e, excluding /snap/ paths from classic-confinement library collection to avoid bundling libraries from installed snaps.
71%
#3211 pluginhandler: fix stage-snaps for v2 plugins snapcraft merged Merged in canonical/snapcraft#3211 (0870f1738), fixing v2 stage-snaps handling and preventing prepare_build from discarding unpacked snaps.
71%