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 the install cache storing the wrong version of the opam file after a build failure #6213

Merged

Conversation

kit-ty-kate
Copy link
Member

@kit-ty-kate kit-ty-kate commented Sep 26, 2024

Upgrades from 2.2 to 2.3 can trigger issues where a repository forgot to add the missing extra-files field.
opam tells the user they should upgrade as the opam file changed (as extra-files was added automatically), then the build fails and upon fixing the error, opam still says the package is to be rebuilt because the previous version of the opam file was stored in the install cache.

This should be backported to the 2.3 branch as it can easily be triggered during the upgrade from 2.2 to 2.3.
Backported to 2.3 via #6214

Potentially related to #5922

@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha1 milestone Sep 26, 2024
@kit-ty-kate kit-ty-kate changed the title No recompile after build failure Fix the install cache storing the wrong version of the opam file after a build failure Sep 26, 2024
@rjbou rjbou requested review from dra27 and rjbou and removed request for dra27 September 27, 2024 07:46
tests/reftests/extrafile.test Outdated Show resolved Hide resolved
Comment on lines 832 to 838
List.exists (function
| `Fetch ps -> List.for_all (OpamPackage.equal nv) ps
| `Build p
| `Change (_, _, p)
| `Install p
| `Reinstall p
| `Remove p -> OpamPackage.equal nv p)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The failure is specific to build and fetch errors, maybe adding a comment have that information. It's permit to explain why we need to have that check on install cache update.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't really think this part of the code needs a comment but i do agree that the section (filtering as a whole) needed one so i added one. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@rjbou rjbou force-pushed the no-recompile-after-build-failure branch from ffa19eb to 9b891a7 Compare October 10, 2024 18:07
@kit-ty-kate kit-ty-kate force-pushed the no-recompile-after-build-failure branch 2 times, most recently from 39e587f to 28fe994 Compare October 10, 2024 19:30
kit-ty-kate and others added 2 commits October 10, 2024 21:46
…on failure

It highlights a package mistakenly marked as to be reinstalled

Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
@kit-ty-kate kit-ty-kate force-pushed the no-recompile-after-build-failure branch from 28fe994 to 232b15d Compare October 10, 2024 20:46
Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

lgtm! If my test part is ok, good to merge.

@kit-ty-kate kit-ty-kate merged commit 1b2e2a0 into ocaml:master Oct 11, 2024
40 checks passed
@kit-ty-kate kit-ty-kate deleted the no-recompile-after-build-failure branch October 11, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants