Handle core module versions in snapshot #49
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a major change in how core modules pinned in the snapshot works.
Context
34b3687 combined with 8ea6b68 introduced a bug where a core module pinned in the snapshot has always been ignored in the first carmel run (i.e. when the pinned version doesn't exist in the artifact repository).
If a version is pinned in the snapshot and has a higher version than the version shipped with perl, it's clear that Carmel should install that version. This is now fixed in this PR.
Core Module in the Snapshot
If a version is pinned in the snapshot and has a lower version than core, it gets a little messy. Technically you could do this, but is difficult to implement with Menlo, because Menlo automatically skips this dependency, unless you pin to the exact version with what's in the snapshot, which caused some issues like #33 (removed the
== $ver
in 8ea6b68)In this PR, I added a workaround and a behavior change as a result, so that if:
Carmel will ignore it and remove it from the snapshot, meaning that it would upgrade to the core version of the module. I think this is a safe behavior for core modules.
Example
Because perl has a higher version of HTTP::Tiny than what's in the snapshot, and your cpanfile doesn't specify any version, the version pinning will be removed from the snapshot, on the first run of
carmel install
.If you really want to pin to the version that's older than core, you can still do this with:
First Installation
Related to this bug fix above, there's still a chance where you encounter
Can't find artifact for Module => version
in the first carmel run. Here's how this happens:cpanfile
and uses the snapshot to install all of themUsually this can be fixed by running
carmel install
again. This PR updates the install code so that the retry is unnecessary - it will automatically retry until there's no new missing modules from the installation.