Skip to content

install-method and overwrite-policy in .cabal/config are ignored #5942

Closed

Description

@maoe

I have these settings in my ~/.cabal/config:

overwrite-policy: always
install-method: copy           
installdir: /Users/maoe/.local/bin

but overwrite-policy and install-method seem to be ignored:

% cabal install exe:cabal
Wrote tarball sdist to
/Users/maoe/src/github.com/haskell/cabal/dist-newstyle/sdist/Cabal-3.0.0.0.tar.gz
Wrote tarball sdist to
/Users/maoe/src/github.com/haskell/cabal/dist-newstyle/sdist/cabal-testsuite-3.0.0.0.tar.gz
Wrote tarball sdist to
/Users/maoe/src/github.com/haskell/cabal/dist-newstyle/sdist/cabal-install-3.0.0.0.tar.gz
Wrote tarball sdist to
/Users/maoe/src/github.com/haskell/cabal/dist-newstyle/sdist/solver-benchmarks-3.0.0.0.tar.gz
Wrote tarball sdist to
/Users/maoe/src/github.com/haskell/cabal/dist-newstyle/sdist/pretty-show-1.6.16.tar.gz
Resolving dependencies...
Up to date
Symlinking 'cabal'
cabal: Path '/Users/maoe/.local/bin/cabal' already exists. Use
--overwrite-policy=always to overwrite.

As you can see it tries to symlink cabal and --overwrite-policy=always seems to be ignored.

I'm using recent master (e23d8d1) of cabal-install.

Activity

  1. fgaz commented on Mar 17, 2019

    @fgaz
    Member

    Good catch! I think I know why it happens, should be quick to fix

  2. added
    cabal-install: v2-build system
    on Mar 17, 2019
  3. self-assigned this
    on Mar 17, 2019
  4. fgaz commented on Mar 23, 2019

    @fgaz
    Member

    So, this is more complex than I thought. Seems like those two flags, when absent, do not generate a NoFlag, but a Flag mempty, which overrides the configured one. Oddly, other new-install flags like --env-file, DO generate a NoFlag when absent.

  5. benjaminselfridge commented on Apr 2, 2019

    @benjaminselfridge

    @fgaz Any update on this?

  6. fgaz commented on Apr 17, 2019

    @fgaz
    Member

    @benjaminselfridge nope. I'ts next on my cabal todo list though

  7. self-assigned this
    on Jun 22, 2019
  8. saurabhkukade commented on May 14, 2020

    @saurabhkukade

    I am still facing this issue.
    I have entry of flag in my ~/.cabal/config file as
    -- overwrite-policy: always

    but still cabal install is ignoring the flag.

  9. phadej commented on May 14, 2020

    @phadej
    Collaborator

    -- starts a comment line.

  10. andy0130tw commented on Aug 14, 2020

    @andy0130tw

    The v2-configure / v2-build command with --prefix seems to have no effects. The default prefix $HOME/.cabal... is still used, and does not being written to cabal.project.local. It even does not go through path checkings, where it should complain on non-absolute paths.

  11. fgaz commented on Aug 14, 2020

    @fgaz
    Member

    @andy0130tw if I remember correctly --prefix is a Cabal-the-library flag, which does not have effect on cabal-install. It's only there in the --help because cabal-install does accept some Cabal flags, so the whole set of options was put in there.

    I might be wrong though. Did it have an effect on v1-build?

    Also maybe --store-dir, which set the store directory, could be what you need

  12. andy0130tw commented on Aug 17, 2020

    @andy0130tw

    @fgaz: I was mainly compiling Agda and needed to specify datadir pointing to its libraries. Soon I realized that the --prefix argument is what I wanted. I used apt install in Debian Stretch, and there was only v1 in the repository.

    Apparently, the prefix argument worked in v1, but not in v2 and later.

  13. fgaz commented on Aug 19, 2020

    @fgaz
    Member

    @andy0130tw

    and needed to specify datadir pointing to its libraries. Soon I realized that the --prefix argument is what I wanted

    Could you explain further? I'm not sure I understand the use case

    edit: also I think you should open a separate issue for this, as it's a separate problem

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

Metadata

Metadata

Assignees

Labels

cabal-install: v2-build systemtype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions