Skip to content
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

fix(test): add patchelf to dev dependencies for testing #5135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bepri
Copy link
Contributor

@bepri bepri commented Oct 28, 2024

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run tox run -m lint?
  • Have you successfully run tox run -e test-py310? (supported versions: py39, py310, py311, py312)

@bepri bepri requested review from dariuszd21 and mr-cal October 28, 2024 15:55
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.71%. Comparing base (654871d) to head (3248e55).
Report is 633 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (654871d) and HEAD (3248e55). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (654871d) HEAD (3248e55)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5135      +/-   ##
==========================================
- Coverage   94.88%   89.71%   -5.17%     
==========================================
  Files         658      342     -316     
  Lines       55189    22640   -32549     
==========================================
- Hits        52364    20311   -32053     
+ Misses       2825     2329     -496     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dariuszd21 dariuszd21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite curious what exactly this PR fixes?

@@ -84,6 +84,7 @@ oauthlib==3.2.2
overrides==7.7.0
packaging==24.1
PasteDeploy==3.1.0
patchelf==0.17.2.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know requirements*.txt files are auto-generated and we keep dependencies in pyproject.toml or setup.py.
If I'm not mistaken this dependency should be added here, and then you should run tools/freeze-requirements.sh script.
https://github.com/canonical/snapcraft/blob/main/setup.py#L61

@bepri
Copy link
Contributor Author

bepri commented Nov 6, 2024

I'm quite curious what exactly this PR fixes?

I noticed that after a fresh clone, tox -f test would fail on multiple cases from patchelf not being installed. I mentioned it to Callahan and it was explained that we were using the apt package of patchelf, which was part of a weird software supply chain of us packaging our own patchelf with Snapcraft. He suggested I open this PR as a first step towards making this work without our own patchelf and setup script.

"Fix" was probably not the right commit message to include here - I made it before I understood the scope of this.

@mr-cal
Copy link
Collaborator

mr-cal commented Nov 7, 2024

He suggested I open this PR as a first step towards making this work without our own patchelf and setup script.

Thanks for making this PR, this is a good place to discuss.

I'm not sure of the right path forward. To be totally correct, we would need to build and install this version of patchelf: https://github.com/canonical/patchelf/tree/0.9%2Bsnapcraft as that's what snapcraft uses in it's own snap. I haven't checked what is different between it and the upstream implementation.

I prefer using patchelf as a python package over a system package to keep snapcraft's dev deps more contained. On the other hand, if you clone this repo, install the install deps only and try to run in destructive mode then snapcraft would fail because patchelf would still be missing.

Finally, I don't like that we have unit tests that require patchelf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants