-
Notifications
You must be signed in to change notification settings - Fork 710
haddock: can't find a package database at <sandbox> #1281
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
Comments
Aha. I found the reason. This package that I'm building docs for was add-source'd into haskell-names, so it was configured with its sandbox package database. It'd still be nice if that didn't happen, but I've no idea how to address it. |
Perhaps add-source'd packages should be copied rather than built in place?.. |
This way they'll have to be rebuilt from scratch each time, which is unrealistic. The point of Again, |
Not necessarily. We could keep the build tree ( |
Is there a portable way to do this? |
In any case, copying will also introduce additional overhead on each build. Current behaviour is already annoying, and this will just make it worse. I think that implementing |
...though if we decide to implement the smarter rebuild check I described in #1274, copying might become feasible (just copy over the files that have a newer timestamp than |
I've got a new idea. Copying the source files is not really necessary. It doesn't really matter where source files lie, as soon as we always want to use the latest version (which is not true for
Would it make things any easier for you? |
@feuerbach I like this idea. We will still use copying for things like @tibbe, what do you think? |
@feuerbach |
But a different |
@feuerbach You may be right, I need to test this. |
I think people shouldn't be using the same source directory for different sandboxes. It's confusing (modifying the source for the purpose of one project will affect the other). If we accept that we should be fine using the builddir in the add-source:d package's dir. This might require some retraining for a few people, but I think it's worth it. Alternatively we could try to use the builddir of the current package for all building. This makes sense when we move to a less current-package centric world where the builddir will probably be in a directory that doesn't contain any packages. @dcoutts thoughts? |
I'm not sure this won't lead to conflicts. I think something like |
If the source a git clone then I think it should be fine. Although I'd like to support this case directly in the future. |
Yes, that's what I had in mind. We should still compile the current package in |
What I meant is that the following is a bad idea:
As changes made to text for the purpose of proj2 happened to affect proj1. The user probably wanted to clone the text repo twice, once for each project. |
This may or may not be a bad idea, depending on the circumstances. E.g. a company can have a bunch of patched libraries intended to be used by all projects in the source tree. |
That's totally fine. Those patches would be checked into the source tree. What I'm saying is not the greatest idea is to share local modifications (i.e. not checked in) between two local checkouts of two different projects. |
Yes, I guess that could be confusing. The behaviour described in the first post is also confusing. I should say that I like this idea better than copying. We'll still use copying (or tarballs, like |
Also, using the builddir in the add-sourced package dir won't by itself prevent the users from reusing the same source directory for different sandboxes. We'll have to come up with additional checks. |
I don't think it's confusing — it's doing precisely what the user has asked. Yes, users can make mistakes, but you can't prevent all of them. If you force the user to have two separate source trees, it is as likely that she will make changes to the wrong tree, or make changes to one when both need that change. |
When I run
cabal haddock
in a non-sandboxed directory, I get the following error:haddock: can't find a package database at /home/feuerbach/prog/haskell-names/.cabal-sandbox/ghc-7.6.1.20121207-packages.conf.d
(To make it clear, the directory where I run
cabal haddock
is not related tohaskell-names
.)The reason why it can't find the database is that the sandbox has been deleted.
-v
shows that indeed haddock was passed'--optghc=-package-db' '--optghc=/home/feuerbach/prog/haskell-names/.cabal-sandbox/ghc-7.6.1.20121207-packages.conf.d'
I think that the proper solution is not to pass that package db at all (even when it exists), since it breaks sandbox isolation.
The text was updated successfully, but these errors were encountered: