New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pluginhandler: do not search installdir or stagedir for dependencies #2942
Conversation
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>
This is the starter fix, but I think we should take it further and eliminate use of _find_directory(). I don't think we should be attempting to (re)-search for dependencies. If we should in fact be re-searching installdir and stagedir for dependencies that were scuttled along the way, perhaps we should move that logic into MissingDependencyResolver..? I'll hold on this pending further discussion. |
@sergiusens just to confirm - we did agree that this check should simply be moved into MissingDependencyResolver? What do you think about a message like:
And my thought would be to filter those files out from the stage-package list, since they were already built/installed/staged. |
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Codecov Report
@@ Coverage Diff @@
## master #2942 +/- ##
=========================================
Coverage ? 88.14%
=========================================
Files ? 229
Lines ? 16589
Branches ? 2564
=========================================
Hits ? 14622
Misses ? 1430
Partials ? 537
Continue to review full report at Codecov.
|
tests/spread/general/dependency-check-missing-lib/snaps/missing-lib/snap/snapcraft.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
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
./runtests.sh static
?./runtests.sh tests/unit
?