Skip to content

Commit

Permalink
fix cabal install --program-suffix/prefix (fix #10290 and #10476)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ulysses4ever authored and geekosaur committed Nov 2, 2024
1 parent 9e2b2db commit 5b043ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/CmdInstall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,8 @@ symlink
overwritePolicy
installDir
(mkSourceBinDir unit)
(mkExeName exe)
(mkFinalExeName exe)
(mkExeName exe)

-- |
-- -- * When 'InstallCheckOnly', warn if install would fail overwrite policy
Expand Down Expand Up @@ -1172,7 +1172,7 @@ installCheckUnitExes
errorMessage installdir exe = case overwritePolicy of
NeverOverwrite ->
"Path '"
<> (installdir </> prettyShow exe)
<> (installdir </> mkFinalExeName exe)
<> "' already exists. "
<> "Use --overwrite-policy=always to overwrite."
-- This shouldn't even be possible, but we keep it in case symlinking or
Expand Down

0 comments on commit 5b043ac

Please sign in to comment.