Skip to content

Add -w flag to cabal sandbox hc-pkg? #1899

Closed

Description

@nh2

To select which ghc version to use, I use the -w flag, like cabal install -w ghc-7.8 ....

However, when I use cabal sandbox hc-pkg list, I will only always get results for .cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d.

Should cabal sandbox hc-pkg have a -w flag, or is there a different way to select which compiler's package db hc-pkg shall look at? If so, it would be great if that could be mentioned in cabal help sandbox.

Activity

  1. self-assigned this
    on May 26, 2014
  2. 23Skidoo commented on May 26, 2014

    @23Skidoo
    Member

    Right now hc-pkg uses the compiler that the package was configured with. Example:

    $ cabal configure -w ghc-7.8
    $ cabal sandbox hc-pkg list
    # Uses ghc-7.8
    
    $ cabal configure -w ghc-7.6
    $ cabal sandbox hc-pkg list
    # Uses ghc-7.6
    
  3. nh2 commented on May 26, 2014

    @nh2
    MemberAuthor

    Ah, good to know. That means though that I first have to create some cabal package source instead of "just" looking what is in my sandbox. It would probably make sense to also have a way to do it without.

  4. rrnewton commented on May 30, 2014

    @rrnewton
    Member

    I had the same problem with respect to both cabal sandbox hc-pkg and cabal repl, but if it works to repeat cabal configure in place then that seems ok.

  5. lspitzner commented on Nov 29, 2014

    @lspitzner
    Collaborator

    @23Skidoo
    this does not seem to work, on both 1.20.0.3 and some commits behind master. maybe i am missing something; this is what i did:

    > cabal get foo
    > cd foo-1.0.0.0
    > cabal sandbox init
    > cabal install --only-dependencies -w PATH_TO_CUSTOM_GHC
    > cabal configure -w PATH_TO_CUSTOM_GHC
    > cabal sandbox hc-pkg list
    [only boot-packages; also it uses the default ghc version (not the one specified at configure)]
    > ls .cabal-sandbox/lib/ARCH-CUSTOMGHCVERSION/
    [non-empty set of libraries]
    
  6. modified the milestones: , on Apr 24, 2015
  7. adamgundry commented on Oct 11, 2015

    @adamgundry
    Member

    The problem with cabal sandbox hc-pkg not using the configured compiler is fixed by #2859. For the remaining feature request (-w flag for cabal sandbox hc-pkg and cabal exec) see #2177.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions