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

Backport #10483: fix cabal install --program-suffix/prefix (fix #10290 and #10476) #10510

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 3, 2024

#10290 shows: when checking for existing installations, cabal would not account for an affix (suffix or prefix). So, if you had a hello binary installed, installing a second one with a non-empty affix (a perfectly legal operation) would fail.

The reason seemed to be a typo in 09c04e9, which passed the arguments to the Symlink structure in a wrong order.

#10476 shows: when failing to install a binary because of an existing one, cabal would report suffix-less existing target even if a suffix was set.

This turned out to be a little issue in pretty printing.


I haven't gotten around to adding tests, sadly.


QA notes

Try to check that both #10290 and #10476 don't reproduce with this patch (they both have clear instructions for reproduction).


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • Manual QA notes have been included.
  • Tests have been added. (Ask for help if you don’t know how to write them! Ask for an exemption if tests are too complex for too little coverage!)

This is an automatic backport of pull request #10483 done by [Mergify](https://mergify.com).

…10483)

* fix cabal install --program-suffix/prefix (fix #10290 and #10476)

When checking for existing installations, cabal would not account for
an affix (suffix or prefix). So, if you had a `hello` binary installed, installing a
second one with a non-empty affix (a perfectly legal operation) would
fail.

The reason seemed to be a typo in
09c04e9, which passed the arguments to
the Symlink structure in a wrong order.

When failing to install a binary because of an existing one, cabal would
report suffix-less existing target even if a suffix was set.

* Add regression tests for overwrite policies and porgram-affixes

Add regression tests for the `program-prefix` and `program-suffix` flags
combined with the overwrite-policy.
In short, the overwrite-policy needs to take potential program affixes
into account when deciding whether it will need to overwrite a program
path during installation.

---------

Co-authored-by: Fendor <fendor@posteo.de>
(cherry picked from commit ee3c313)
@ulysses4ever
Copy link
Collaborator

@Kleidukos wanted to test the original PR , so I'm not merging the backport right away and rather requesting a review...

@geekosaur
Copy link
Collaborator

geekosaur commented Nov 3, 2024

FWIW I'd've added tests to the original PR before merging.


ETA: oh, sorry, it has one (slow, apparently). Proceed, then.

@ulysses4ever
Copy link
Collaborator

Merging based on this #10483 (comment)

@ulysses4ever ulysses4ever added the squash+merge me Tell Mergify Bot to squash-merge label Nov 5, 2024
@mergify mergify bot merged commit 460375d into 3.14 Nov 5, 2024
53 checks passed
@mergify mergify bot deleted the mergify/bp/3.14/pr-10483 branch November 5, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport squash+merge me Tell Mergify Bot to squash-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants