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

Provide a way to exclude packages/slices when running cut #156

Open
lengau opened this issue Sep 5, 2024 · 0 comments
Open

Provide a way to exclude packages/slices when running cut #156

lengau opened this issue Sep 5, 2024 · 0 comments
Assignees

Comments

@lengau
Copy link

lengau commented Sep 5, 2024

It would be nice to be able to exclude certain packages or slices when running cut, even if those are dependencies of the requested chisel slices. This would allow snaps and charms to be able to use chiselled packages without pulling everything all the way back to libc.

Ideally for my particular use case (integrating chisel into more craft* apps), we'd be able to pass an exclusions file (one package/slice name per line in a text file), and if a slice is explicitly listed it overrides that exclusions file.

Examples for why I'd like this A core24 snap that only stages `curl_bins` is 8.6 MiB, whereas using craft-parts's ignore list but extracting the full debs is still only 1.1 MiB. Here's the `snapcraft.yaml` file:
name: my-snap-name # you probably want to 'snapcraft register <name>'
base: core24 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

parts:
  my-part:
    # See 'snapcraft plugins'
    plugin: nil
    stage-packages:
      - curl_bins  # Remove _bins here to extract the full packages

A real-world example that could use this feature are the postgresql charms. Currently they're using a workaround because Charmcraft doesn't stage packages correctly. However, an "ideal" version of this would have this part instead:

libpq:
  plugin: nil
  stage-packages: [libpq5_libs]
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

No branches or pull requests

2 participants