-
Notifications
You must be signed in to change notification settings - Fork 701
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 #10056
Conversation
9120622
to
0e47036
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this very annoying issue! I am wondering, whether it would be easy to add a regression test that makes sure this doesn't break again, e.g. a PackageTests/ConfigProgTest
which installs a local executable with --program-suffix
into the current directory and simply tests, whether the binary can be executed?
0e47036
to
af2989a
Compare
I have not seen that somebody pushed some commits before force-pushing… Was it just a rebase? |
Updated code: fix Reworked commit message for full explanation: Currently the options
Another issue is that it affects the computation of the hash of the Fixed by making the name of the executable in the store canonical, i.e. Added a test for all the combinations of |
af2989a
to
1091537
Compare
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I have one documentation nitpick, please explain in ignoreProgramAffixes
why we are ignoring these prefixes, so that the knowledge isn't lost in the future :)
1091537
to
09adccb
Compare
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.
09adccb
to
8593474
Compare
@mergify backport 3.12 |
✅ Backports have been created
|
…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 8593474) # Conflicts: # cabal-install/src/Distribution/Client/CmdInstall.hs * fixup! resolve conflicts --------- Co-authored-by: Pierre Le Marre <[email protected]> Co-authored-by: Artem Pelenitsyn <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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:
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.