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

RFC: post-2.4 redesign of v2 --bindir UI #5843

Closed
hvr opened this issue Jan 13, 2019 · 2 comments
Closed

RFC: post-2.4 redesign of v2 --bindir UI #5843

hvr opened this issue Jan 13, 2019 · 2 comments
Milestone

Comments

@hvr
Copy link
Member

hvr commented Jan 13, 2019

This is a bit of a follow-up to #5837 (which is intended to provide an incremental pain remedy for 2.4.x) which is expected to result in the following situation for v2-install:

We have two bindir "install" paths settings,

  • --symlink-bindir=DIR (used when --bindir-method=symlink)
  • --bindir=DIR (used when --bindir-method=copy)

This is mostly for historical reasons as cabal has had these two configuration properties for about a decade.

However, it doesn't seem to make much sense in the nix-style paradigm to have two separate folders; instead I suggest to redesign this for cabal 3.0 to

  1. deprecate --symlink-bindir=DIR
  2. Use a single --bindir=DIR configuration field
  3. Use --bindir-method={copy,symlink,auto} to control how executables are "installed" into the folder denoted by --bindir

This would IMO be a less confusing UI as you need to be careful which bindir field you set; there's now only one!


So e.g. if you're preparing some binary dist for an executable (for which you know it is relocatable as it doesn't have any ties to the nix-style store), you can just say

cabal install --bindir=./bindist/bin --bindir-method=copy  mypackage

and if you instead want to prepare some local bin-folder with symlinks to some build tools, you can instead say

cabal install --bindir=${HOME}/buildtools-bin --bindir-method=symlink alex happy

and if you use the auto method (i.e. try to use symlinks and fallback to copy if not possible), now you can say

cabal install --bindir=${HOME}/buildtools-bin --bindir-method=auto alex happy

With the UI as implemented for #5837 for cabal 2.4 however, you'd have to use the following incantations respectively:

cabal v2-install --bindir=./bindist/bin --bindir-method=copy  mypackage

cabal v2-install --symlink-bindir=${HOME}/buildtools-bin --bindir-method=symlink alex happy

# NB: we need to set both bindir locations!
cabal v2-install --bindir=${HOME}/buildtools-bin --symlink-bindir=${HOME}/buildtools-bin --bindir-method=auto alex happy
@hvr hvr added this to the 3.0 milestone Jan 13, 2019
@bgamari
Copy link
Contributor

bgamari commented Jan 16, 2019

Sounds right to me.

@fgaz
Copy link
Member

fgaz commented Jan 16, 2019

+1.

This requires:

  • a bindir in NewInstallFlags, the proper place to put it
  • NewInstallFlags in SavedConfig, so bindir remains configurable in ~/.cabal/config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants