Skip to content
Snippets Groups Projects
Unverified Commit 639928f9 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Fix --program-suffix resulting in invalid symlink (backport #10056) (#10079)


* Fix --program-{prefix,suffix} resulting in invalid installation

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

# Conflicts:
#	cabal-install/src/Distribution/Client/CmdInstall.hs

* fixup! resolve conflicts

---------

Co-authored-by: default avatarPierre Le Marre <dev@wismill.eu>
Co-authored-by: default avatarArtem Pelenitsyn <a.pelenitsyn@gmail.com>
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 42b93b75
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment