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

dirs, many: detect snapd libexecdir location #15215

Conversation

bboozzoo
Copy link
Contributor

@bboozzoo bboozzoo commented Mar 18, 2025

Similarly as we do with snap mount directory, attempt to detect that correct path for snapd libexecdir by inspecting the host filesystem.

Followup PR to #15206.

Related: SNAPDENG-34646

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.

Project coverage is 78.13%. Comparing base (d6d95f0) to head (f9635be).
Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
dirs/dirstest/mocks.go 33.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #15215      +/-   ##
==========================================
+ Coverage   78.09%   78.13%   +0.04%     
==========================================
  Files        1190     1187       -3     
  Lines      158458   159077     +619     
==========================================
+ Hits       123746   124296     +550     
- Misses      27017    27048      +31     
- Partials     7695     7733      +38     
Flag Coverage Δ
unittests 78.13% <84.61%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bboozzoo bboozzoo added the cross-distro Runs all spread systems in parallel label Mar 18, 2025
Copy link

github-actions bot commented Mar 18, 2025

Fri Mar 21 12:16:17 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/13987117784

Failures:

Preparing:

  • google:ubuntu-25.04-64:tests/main/snap-ns-forward-compat

Executing:

  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-pre-download:restart
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-pre-download:ignore
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-pre-download:close
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-gating
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh:parallel
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-pre-download:close_mid_restart
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh:regular
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-backoff
  • openstack:opensuse-tumbleweed-64:tests/main/snap-refresh-hold
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-gating-from-snap
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-retry
  • openstack:opensuse-tumbleweed-64:tests/main/refresh-app-awareness-notify
  • google:ubuntu-25.04-64:tests/main/microk8s-smoke:edge

Restoring:

  • openstack:debian-sid-64:tests/main/interfaces-timeserver-control
  • openstack:opensuse-tumbleweed-64:tests/main/refresh-app-awareness-notify

@bboozzoo bboozzoo force-pushed the bboozzoo/reexec-support-usr-libexec-snapd-followup branch from c4b9271 to 5ab1eef Compare March 19, 2025 13:39
Copy link
Contributor

@zyga zyga left a comment

Choose a reason for hiding this comment

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

I really like how this makes the code care less about the name of the distro and more about the files on disk.

@bboozzoo bboozzoo force-pushed the bboozzoo/reexec-support-usr-libexec-snapd-followup branch from 5ab1eef to 38b8cff Compare March 20, 2025 10:36
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

thanks

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Follow the same approach as for snap mount directory and detect snapd
libexecdir by inspecting which paths are present in the system.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Make sure that the detection matches what we expected on known
distributions.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
@bboozzoo bboozzoo force-pushed the bboozzoo/reexec-support-usr-libexec-snapd-followup branch from 38b8cff to f9635be Compare March 21, 2025 07:55
Copy link
Contributor

@ZeyadYasser ZeyadYasser left a comment

Choose a reason for hiding this comment

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

Thank you!

@bboozzoo bboozzoo requested a review from zyga March 21, 2025 08:40
Copy link
Contributor

@zyga zyga left a comment

Choose a reason for hiding this comment

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

Thanks, this is better IMO

@bboozzoo bboozzoo merged commit 858801c into canonical:master Mar 21, 2025
73 of 76 checks passed
@bboozzoo bboozzoo deleted the bboozzoo/reexec-support-usr-libexec-snapd-followup branch March 21, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-distro Runs all spread systems in parallel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants