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

feat(pack): automatically install non-matching charmlibs #1918

Merged
merged 8 commits into from
Oct 3, 2024

Conversation

lengau
Copy link
Collaborator

@lengau lengau commented Sep 24, 2024

If charmcraft.yaml specifies charmlibs, pack will now automatically upgrade libraries on disk that don't match the specifications in the yaml file.

@lengau lengau force-pushed the work/CRAFT-2333/pack branch from e434ac7 to 94d86dc Compare September 24, 2024 22:38
@lengau lengau changed the title Work/craft 2333/pack feat(pack): automatically upgrade non-matching charmlibs Sep 24, 2024
@lengau lengau requested review from dariuszd21, medubelko and mr-cal and removed request for medubelko September 25, 2024 13:56
@lengau lengau marked this pull request as ready for review September 25, 2024 13:56
@sergiusens
Copy link
Collaborator

@jdkandersson ^

Copy link
Collaborator

@sergiusens sergiusens left a comment

Choose a reason for hiding this comment

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

I copied verbatim from the spec, which believe we are not following with the change as described


The library fetching code can now always be run as part of charmcraft pack. There are three possible options during the pack process:

  • The required libraries are not in the source tree, and are fetched as part of the packing process
  • There exist libraries in the source tree that satisfy the requirements
  • There exist libraries in the source tree that conflict with charmcraft.yaml requirements (or are not specified at all)

It is important to note that while charmcraft pack will now be looking at the store, the charmcraft pack should never mutate the libraries on the filesystem, except in the first case. The interaction with the store during the pack process is only to provide warnings or information about the libraries in use (such as the availability of updates). The inability to reach the store should not make the pack process fail (except in the first case).

In the second and third cases, the fetch code is still run - if there are newer versions of the library available in the store, or the libraries do not match the constraints specified, the user should be notified as part of the packing process, but it should only be a warning/info notice, and the pack process should carry on using the in-tree libraries.

@lengau lengau changed the title feat(pack): automatically upgrade non-matching charmlibs feat(pack): automatically install non-matching charmlibs Sep 27, 2024
@lengau lengau force-pushed the work/CRAFT-2333/pack branch from c408ed0 to 6616890 Compare September 27, 2024 16:21
@lengau lengau force-pushed the work/CRAFT-2333/pack branch from 6616890 to 7fff8c4 Compare September 27, 2024 16:22
@lengau lengau requested a review from sergiusens September 27, 2024 18:17
Copy link
Collaborator

@sergiusens sergiusens left a comment

Choose a reason for hiding this comment

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

Looks good, have some minor comments and perhaps an expectation mismatch on fetching on pack (I thought it would be ephemeral and not persisted if I ran charmcraft clean)

@lengau lengau requested a review from sergiusens October 1, 2024 18:45
@lengau lengau force-pushed the work/CRAFT-2333/pack branch from 8528ccf to 0aafde7 Compare October 1, 2024 18:50
@lengau lengau merged commit dae4d32 into main Oct 3, 2024
24 checks passed
@lengau lengau deleted the work/CRAFT-2333/pack branch October 3, 2024 19:21
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