From 7f825e5d73b38be8dbfb887f17e25739b6b0e005 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 11 Apr 2024 13:21:42 +0100 Subject: [PATCH 1/4] Add test showing what currently happens --- tests/reftests/update-upgrade.test | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/reftests/update-upgrade.test b/tests/reftests/update-upgrade.test index a81680d29dc..2f438bd0a56 100644 --- a/tests/reftests/update-upgrade.test +++ b/tests/reftests/update-upgrade.test @@ -506,3 +506,38 @@ The following actions will be performed: -> removed ongoing.dev -> installed ongoing.dev Done. +### +opam-version: "2.0" +build: [ "false" ] +### opam update +[NOTE] ongoing.dev has previously been updated with --working-dir, not resetting unless explicitly selected + +<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><> +[second] no changes from file://${BASEDIR}/REPO2 +[default] synchronised from file://${BASEDIR}/REPO + +<><> Synchronising development packages <><><><><><><><><><><><><><><><><><><><> +[quux.dev5] synchronised (no changes) +Now run 'opam upgrade' to apply any package updates. +### opam upgrade +The following actions will be performed: +=== recompile 1 package + - recompile d-foo 6 [upstream or system changes] + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +[ERROR] The compilation of d-foo.6 failed at "false". + + + + +<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ++- The following actions failed +| - build d-foo 6 ++- +- No changes have been performed +# Return code 31 # +### : Running opam upgrade a second time should do the same thing - the same +### : failure with the same return code 31. +### opam upgrade +Already up-to-date. +Nothing to do. From f0825c2f1d8f6782111cd5b86c3c6d1aa6aa94c4 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 11 Apr 2024 13:22:51 +0100 Subject: [PATCH 2/4] Update test with what should happen --- tests/reftests/update-upgrade.test | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/reftests/update-upgrade.test b/tests/reftests/update-upgrade.test index 2f438bd0a56..a6a93154f20 100644 --- a/tests/reftests/update-upgrade.test +++ b/tests/reftests/update-upgrade.test @@ -539,5 +539,19 @@ The following actions will be performed: ### : Running opam upgrade a second time should do the same thing - the same ### : failure with the same return code 31. ### opam upgrade -Already up-to-date. -Nothing to do. +The following actions will be performed: +=== recompile 1 package + - recompile d-foo 6 [upstream or system changes] + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +[ERROR] The compilation of d-foo.6 failed at "false". + + + + +<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> ++- The following actions failed +| - build d-foo 6 ++- +- No changes have been performed +# Return code 31 # From 5332008fac34b7cc0b0888fa42bf3ee844aca153 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 11 Apr 2024 13:25:48 +0100 Subject: [PATCH 3/4] Show that the state written after upgrade is the problem --- tests/reftests/update-upgrade.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/reftests/update-upgrade.test b/tests/reftests/update-upgrade.test index a6a93154f20..383dc727788 100644 --- a/tests/reftests/update-upgrade.test +++ b/tests/reftests/update-upgrade.test @@ -536,6 +536,10 @@ The following actions will be performed: +- - No changes have been performed # Return code 31 # +### : Removing the installed packages cache from the switch corrects the +### : behaviour - i.e. at present the packages are being marked as up-to-date +### : even though recompilation failed. +### rm OPAM/upgrading/.opam-switch/packages/cache ### : Running opam upgrade a second time should do the same thing - the same ### : failure with the same return code 31. ### opam upgrade From 4517796e95158f0d4777e4ee39524580fae2b5a8 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 11 Apr 2024 13:26:03 +0100 Subject: [PATCH 4/4] Fix it (TODO...) --- master_changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/master_changes.md b/master_changes.md index cea1b3a25e8..3cfd7f88b0d 100644 --- a/master_changes.md +++ b/master_changes.md @@ -40,6 +40,7 @@ users) ## Var/Option ## Update / Upgrade + * Failure when rebuilding a package owing to upstream changes no longer marks the package as successfully installed [#5922 @dra27] ## Tree