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 committed Oct 28, 2024
1 parent 63c486a commit 5770ba3
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 5770ba3

Please sign in to comment.