Skip to content
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

Use default install directory if not specified. #6624

Merged
merged 1 commit into from
Apr 2, 2020

Conversation

m-renaud
Copy link
Collaborator

@m-renaud m-renaud commented Mar 29, 2020

Cabal 3.0.0.0 added the --installdir option to specify the location that binaries should be installed in. Running a cabal user-config update would populate the config file with the default value, but the cabal install program would error if it wasn't set. This change uses the default value that would be written to the config if its unset, and outputs a warning.

Previous error:

cabal: installdir is not defined. Set it in your cabal config file or use
--installdir=<path>

New warning (install succeds):

Warning: installdir is not defined. Set it in your cabal config file or use
--installdir=<path>. Using default installdir: "/path/to/the/default/installdir/bin"

This resolves #5973


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

/cc @phadej @fgaz

@m-renaud
Copy link
Collaborator Author

The "Windows / test ghc-8.6.5" test has failed for every PR I've made in the last week or so, is this a known issue? Anyways, I think this is ready to merge.

@phadej
Copy link
Collaborator

phadej commented Mar 30, 2020

@m-renaud yes it is, #6627

@m-renaud
Copy link
Collaborator Author

m-renaud commented Apr 1, 2020

@phadej should we merge this in before the next cabal-install release? It appears that the Windows failure is blocking the merge, at least from the GitHub UI.

Copy link
Collaborator

@phadej phadej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash commits into one. (Don't use squash and merge button).

This change updates the `cabal install` command to use the default install
directory for executables if one was not specified in either Cabal's config file
or on the command line with the --installdir flag.

Previously this would error out, now it warns that it used the default and
continues.

PR haskell#6624, resolves haskell#5973.
@m-renaud m-renaud force-pushed the m-renaud-default-installdir branch from 71a6fc9 to 735467e Compare April 2, 2020 15:18
@m-renaud
Copy link
Collaborator Author

m-renaud commented Apr 2, 2020

Done. CI re-running now.

OOC, why not use "Squash and Merge" button and re-write the commit message to be added to the master branch there?

@m-renaud m-renaud requested review from phadej and vrom911 April 2, 2020 15:20
@phadej
Copy link
Collaborator

phadej commented Apr 2, 2020

Because perfectly, I'd not use GitHub merge button at all, but let CI push to master the merge commit it tested (given the PR is accepted). We could get quite close to that with current CI setup, but GitHub actions doesn't support restarting individual jobs inside the workflow, so we cannot have whole CI as a single workflow (and thus know that all checks passed).

@phadej phadej merged commit a1a5fc7 into haskell:master Apr 2, 2020
@m-renaud m-renaud deleted the m-renaud-default-installdir branch April 2, 2020 22:14
@tomsmeding
Copy link
Collaborator

Sorry for coming back to this from #5973 — is there any reason why the warning message does not mention that cabal user-config update is something that the user might want to do?

@fgaz
Copy link
Member

fgaz commented May 7, 2020

@tomsmeding not really, I just didn't think of adding it

@phadej phadej added this to the 3.4.0.0-rc1 milestone Jul 10, 2020
@phadej phadej mentioned this pull request Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cabal-install-3.0 requires --installdir option which doesn't exist in existing ~/.cabal/configs
5 participants