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:Pierre Le Marre <dev@wismill.eu> Co-authored-by:
Artem Pelenitsyn <a.pelenitsyn@gmail.com> Co-authored-by:
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Showing
- cabal-install/src/Distribution/Client/CmdInstall.hs 13 additions, 1 deletioncabal-install/src/Distribution/Client/CmdInstall.hs
- cabal-testsuite/PackageTests/Install/ProgramAffixes/Main.hs 1 addition, 0 deletionscabal-testsuite/PackageTests/Install/ProgramAffixes/Main.hs
- cabal-testsuite/PackageTests/Install/ProgramAffixes/cabal.project 1 addition, 0 deletions...stsuite/PackageTests/Install/ProgramAffixes/cabal.project
- cabal-testsuite/PackageTests/Install/ProgramAffixes/cabal.test.hs 27 additions, 0 deletions...stsuite/PackageTests/Install/ProgramAffixes/cabal.test.hs
- cabal-testsuite/PackageTests/Install/ProgramAffixes/p.cabal 8 additions, 0 deletionscabal-testsuite/PackageTests/Install/ProgramAffixes/p.cabal
- changelog.d/issue-9919 4 additions, 0 deletionschangelog.d/issue-9919
Loading
Please register or sign in to comment