Skip to content

Implement cabal sandbox hc-pkg / cabal sandbox buildopts #1200

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

Closed
23Skidoo opened this issue Feb 13, 2013 · 6 comments
Closed

Implement cabal sandbox hc-pkg / cabal sandbox buildopts #1200

23Skidoo opened this issue Feb 13, 2013 · 6 comments

Comments

@23Skidoo
Copy link
Member

cabal-dev has a command ghc-pkg which is handy for manipulating the sandbox package DB using ghc-pkg:

cabal-dev ghc-pkg unregister foo

It'd be nice if cabal sandbox also supported this feature (see discussion in #1195). Additionally, there is cabal-dev buildopts that extracts the options that would be passed to the compiler when building.

@mightybyte
Copy link
Collaborator

In the discussion in #1195 it was suggested that I just use ghc-pkg to remove things from my sandbox, so I've been doing that. But I just encountered a situation where that is not sufficient. I have three projects, call them alpha, beta, and gamma. beta depends on alpha, and gamma depends on both alpha and beta. gamma is my top-level project and it is the one where I'm using a cabal sandbox. (It also depends on a number of other local packages that may or may not be on hackage.)

Originally I was working on changes that affected beta and gamma. If I made changes to beta, I would use ghc-pkg to unregister it from gamma's sandbox and then do sandbox-install to build gamma with the new changes. In spite of the advice against this approach, it seemed to be the most efficient way to make improvements to beta and test those changes in the context of gamma. But when I made a change to alpha this pattern failed. I used ghc-pkg to unregister both alpha and beta from the gamma sandbox and then did sandbox-install as before. But this time I got a linker error:

libHSbeta-0.1.a: unknown symbol `alphazm0zi1zi0zi0...

So it appears that unregistering with ghc-pkg is not sufficient. I was able to fix the problem with find .cabal-sandbox "alpha*" | xargs rm -fr and then repeating that command for beta. After that, sandbox-install worked correctly.

@23Skidoo
Copy link
Member Author

@mightybyte Can you open a separate ticket for this issue?

@mightybyte
Copy link
Collaborator

Yes, but I'm not sure what the ticket should say. To me this just seems like an implementation detail for this ticket.

@23Skidoo
Copy link
Member Author

@mightybyte I suspect that it's a ghc-pkg issue and the same error happens with cabal-dev.

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Apr 19, 2013
See haskell#1200 (for which this is a partial fix).
@hvr
Copy link
Member

hvr commented Jul 8, 2013

btw, imo cabal buildopts wouldn't need to be a sandbox-only feature.

@ttuegel ttuegel modified the milestones: cabal-install-1.24, cabal-install-1.22 Apr 23, 2015
@23Skidoo 23Skidoo modified the milestones: cabal-install 1.24, cabal-install 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: cabal-install 2.0 Sep 6, 2016
@23Skidoo 23Skidoo removed their assignment Sep 13, 2016
@phadej
Copy link
Collaborator

phadej commented Aug 31, 2020

sandbox functionality is removed.

@phadej phadej closed this as completed Aug 31, 2020
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

6 participants