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 --program-suffix resulting in invalid symlink (backport #10056) #10079

Merged
merged 3 commits into from
Jun 7, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 6, 2024

Please read Github PR Conventions and then fill in one of these two templates.


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!)

Fixes #9919
Fixes #8823

Based on this comment.

It took me a lot of time to understand where to look at and I am still unsure this fix does not introduce side effects. I would need some guidance if improvements are needed.


This is an automatic backport of pull request #10056 done by Mergify.

Currently the options `--program-{prefix,suffix}` for cabal install
affects the name of the file in the install directory *and* the
executable name in the store. The installation fails:

- If using `--install-method=symlink`, the *target* of the symlink is
  not affected by the affix options and it results in an invalid symlink.
- If using `--install-method=copy`, the copy fails because the source
  is not found.

Another issue is that it affects the computation of the hash of the
build directory in the store, resulting in needless rebuild when using
successively different affix options.

Fixed by making the name of the executable in the store canonical, i.e.
always ignoring the program affix options.

Added a test for all the combinations of `--install-method` and program
affixes options.

(cherry picked from commit 8593474)

# Conflicts:
#	cabal-install/src/Distribution/Client/CmdInstall.hs
@mergify mergify bot added the conflicts label Jun 6, 2024
Copy link
Contributor Author

mergify bot commented Jun 6, 2024

Cherry-pick of 8593474 has failed:

On branch mergify/bp/3.12/pr-10056
Your branch is up to date with 'origin/3.12'.

You are currently cherry-picking commit 859347426.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   cabal-testsuite/PackageTests/Install/ProgramAffixes/Main.hs
	new file:   cabal-testsuite/PackageTests/Install/ProgramAffixes/cabal.project
	new file:   cabal-testsuite/PackageTests/Install/ProgramAffixes/cabal.test.hs
	new file:   cabal-testsuite/PackageTests/Install/ProgramAffixes/p.cabal
	new file:   changelog.d/issue-9919

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cabal-install/src/Distribution/Client/CmdInstall.hs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@ulysses4ever ulysses4ever added the squash+merge me Tell Mergify Bot to squash-merge label Jun 6, 2024
@mergify mergify bot merged commit 639928f into 3.12 Jun 7, 2024
53 checks passed
@mergify mergify bot deleted the mergify/bp/3.12/pr-10056 branch June 7, 2024 03:22
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