<div dir="ltr"><div><div>AFAIK there's no way to selectively "hide" packages. However, you might be able to use cabal2nix4dev [1]. You'll have to modify the nix expressions to use your packages instead of the existing ones from the platform (in NIX they can happily coexist).<br><br></div>Perhaps somebody with direct NIX experience could provide more detailed step by step instructions?<br><br></div>Michal<br><div><div><br>[1] <a href="https://github.com/dave4420/cabal2nix4dev">https://github.com/dave4420/cabal2nix4dev</a><br><br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 9:07 AM, Sven Panne <span dir="ltr"><<a href="mailto:svenpanne@gmail.com" target="_blank">svenpanne@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As a maintainer of the various OpenGL-related packages I have the<br>
following problem: The Haskell platform has those packages (OpenGLRaw,<br>
GLURaw, ...) exposed, which is the right thing to do in general. When<br>
I want to work on those packages, I'd like to use Cabal sandboxes to<br>
avoid screwing up the platform versions of them, but things get a bit<br>
tricky then. Consider e.g. the GLURaw package, which depends on the<br>
OpenGLRaw package. Assume that I'd like to add some stuff to the<br>
OpenGLRaw package and use that in GLURaw. With cabal sandboxes I'll<br>
have to fight a little bit, because versions of these packages are<br>
already exposed:<br>
<br>
-----------------------------------------------------------------------------------------------------------------------<br>
svenpanne@svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal sandbox init<br>
Writing a default package environment file to<br>
/usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/cabal.sandbox.config<br>
Creating a new sandbox at<br>
/usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox<br>
svenpanne@svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal<br>
sandbox add-source ../OpenGLRaw<br>
-----------------------------------------------------------------------------------------------------------------------<br>
<br>
No problem so far. But the next step is not so OK:<br>
<br>
-----------------------------------------------------------------------------------------------------------------------<br>
svenpanne@svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal<br>
install --only-dependencies<br>
Resolving dependencies...<br>
All the requested packages are already installed:<br>
Use --reinstall if you want to reinstall anyway.<br>
-----------------------------------------------------------------------------------------------------------------------<br>
<br>
Hmmm, obviously cabal sees the globally exposed OpenGLRaw and ignores<br>
that I've done add-source above. OK, next try with --constraint added:<br>
<br>
-----------------------------------------------------------------------------------------------------------------------<br>
svenpanne@svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal<br>
install --only-dependencies --constraint='OpenGLRaw source'<br>
Resolving dependencies...<br>
In order, the following would be installed:<br>
OpenGLRaw-1.5.0.0 (reinstall)<br>
cabal: The following packages are likely to be broken by the reinstalls:<br>
OpenGL-2.9.2.0<br>
GLUT-2.5.1.1<br>
GLURaw-1.4.0.1<br>
Use --force-reinstalls if you want to install anyway.<br>
-----------------------------------------------------------------------------------------------------------------------<br>
<br>
(Is there any documentation about --constraint? I figured that out by<br>
actually reading the cabal sources. :-/ ) Better, but still not OK, so<br>
let's add --force-reinstalls:<br>
<br>
-----------------------------------------------------------------------------------------------------------------------<br>
svenpanne@svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal<br>
install --only-dependencies --constraint='OpenGLRaw source'<br>
--force-reinstalls<br>
Resolving dependencies...<br>
Warning: The following packages are likely to be broken by the reinstalls:<br>
OpenGL-2.9.2.0<br>
GLUT-2.5.1.1<br>
GLURaw-1.4.0.1<br>
Continuing even though the plan contains dangerous reinstalls.<br>
Notice: installing into a sandbox located at<br>
/usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox<br>
Configuring OpenGLRaw-1.5.0.0...<br>
Building OpenGLRaw-1.5.0.0...<br>
Installed OpenGLRaw-1.5.0.0<br>
-----------------------------------------------------------------------------------------------------------------------<br>
<br>
That works, so after that I could actually build/install GLURaw. So in<br>
a nutshell what I have to do is:<br>
<br>
   cabal sandbox init<br>
   cabal sandbox add-source ../OpenGLRaw<br>
   cabal install --constraint='OpenGLRaw source' --force-reinstalls<br>
--enable-documentation --haddock-hyperlink-source<br>
<br>
And for other packages I even have to add several --constraint flags,<br>
because they depend on several locally modified packages. This seems a<br>
bit weird. Is this the recommended workflow? How do other maintainers<br>
of platform packages handle this? What one *actually* wants is hiding<br>
some of the globally exposed packages while being in the sandbox<br>
(--constraint and --force-reinstalls could go away then), but I've<br>
found no way to do that.<br>
<br>
Cheers,<br>
   S.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br><br clear="all">
</div></div>