-
Notifications
You must be signed in to change notification settings - Fork 697
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
--package-db clear does not seem to work #7926
Comments
Hi! Package database is a GHC concept that v2 barely uses (v1 used it for the lack of something better). What is it exactly that you'd like to accomplish? Why is standard workflow not sufficient for your use case? Could you let us know the documentation that led you to this workflow so that we can perhaps fix anything that is misleading? |
Thanks for the quick answer. My use case: I want (if possible) to develop my cabal project on my (and other) developer machines and then push it to a local server that has no internet connection but needs to build the project. Thus, my idea was to create a "local package database" in a directory, check the directory into git and push the whole project including the local database to that (local) server, so that it has all dependencies that it needs to build. The documentation which led me to this is simply the documentation of |
Thank you for the details. Indeed, some old flags don't quite work with v2 commands and the documentation about that is not up to date. There are already tickets about that, I think. I have no idea if you can make it work the way you do, perhaps using v1 while it's still (sort of) working and is not removed. Anybody? The tricky part may be the distinction between a db of compiled library object files and a db of package source tarballs. These are different things and GHC package db is more of the former kind (I guess, plus some metadata?). I know people accomplish something like that from another end, by building a Hackage or Stackage mirror on a machine the server can connect to and then using cabal as usual. Perhaps there are better ways. Another way might be via freeze files and caches of packages downloaded based on a freeze file. I don't remember how it's done, right now, and it has improved since I did it years ago. Please note down in this issue (regardless if you close it or not) what worked for you so that people searching the issue tracker may find a solution. If the experience shows something in cabal can be improved, please let us know as well. |
We are about to add Still, I think what you want to do could be better accomplished by copying the sources of the dependencies and building it all on the target machine. You could do that with by running Another approach is to use |
@farao given there is an issue about adding that option and some way to get your final goal I think we could close this one, feel free to reopen or post any question here, thanks! |
Description
I would like to run cabal only from a user defined package database and ignore the
global
(as I understood systemwide) andlocal
(as I understood ~/.cabal) ones.First, I would expect
cabal v2-build --package-db=clear
not to build at all (because of missing dependencies) and (second)mkdir database; cabal v2-build --package-db=clear --package-db=database/
to download the missing dependencies to the database/ directory.Unfortunately, in both cases, cabal downloads the missing dependencies to
~/.cabal
. Is my understanding of the--package-db
option wrong or does it simply not work?System information
The text was updated successfully, but these errors were encountered: