-
Notifications
You must be signed in to change notification settings - Fork 696
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
Support non-Hackage dependencies #2189
Comments
Halcyon supports declaring sandbox sources with the See Try Haskell for an example of declaring the git |
I'd like to bump this issue's priority and start to discuss implementation, currently it's stopping us using cabal in company environment because we have multiple packages can't be upload to hackage, and a hackage mirror is an overkill. now we use stack to solve this headache, but it's really not necessary to rely both on hackage and stackage infrastructure. |
Hello @winterland1989. Have you tried the new new-build functionality (http://blog.ezyang.com/2016/05/announcing-cabal-new-build-nix-style-local-builds/). If you have all of the non-Hackagable packages on disk in a build tree, you can write a cabal.project to pick them up, and then |
Thanks for your reply @ezyang ! I'm aware that there're multiple ways solving local package discovery: If |
@winterland1989 If you want to contribute code to Cabal, I suggest improving the nix-local-build code path, since the plan is to make it the default in the future. |
I would like to see something like http://docs.haskellstack.org/en/stable/yaml_configuration/#complex-package-locations-location |
Looks like we only need to teach
Question: were to put downloaded stuff, |
(For now one can use |
FYI, every github commit can be downloaded as a zip file, e.g. https://github.com/haskell/cabal/archive/master.zip |
Yes, but that's github's convention, we probably shouldn't rely on that convention. In fact we can safely assume user have |
A use case for this is during development when another client component has not yet been released to hackage. E.g. ghc-mod for HaRe. This is a temporary state. Having a temporary config in a cabal.project is a lot more lightweight than adding a git submodule. |
And there is a general-purpose variant too https://git-scm.com/docs/git-archive This supports a |
@winterland1989 I hope we can interpret @alanz comment, as so even support for remote tarballs would make him a lot happier :) |
Yes, support for remote tarballs is enough for me too ; )
This is also my main motivation for this feature requesting, manually manage forked source is frustrating. |
If you do this for nix-local-build, a determination of whether or not such external dependencies should be local or external needs to be made. If they're treated as local (which I believe is what the current code will do if you list it in |
In principle if we can get a reliable source hash (and guarantee this isn't changed locally) then we can use the store approach. So for git we can use the git hash, but we'd have to avoid letting users fiddle with the sources locally in that case. If we allow fiddling then it has to be treated like a local dir. |
We can ask git if the source has been fiddled with and then fall back to treating it like a local dir if it is the case. |
I'm inclined to just not allow specification of a hash if you don't specify a remote URL. Don't really want new-build to be checking out git branches or ignoring my hash... |
I'm looking forward to celebrating this issue's second 🎂 in two days. |
The provenance-qualified imports proposal (ghc-proposals/ghc-proposals#115) is relevant here. |
It's a pity @bitemyapp won't get to celebrate schadenfreude this year... ;-) |
Closed by #5351. |
Exciting! I want to play with this But is this really fixed? https://github.com/haskell/cabal/blob/master/Cabal/doc/nix-local-build.rst on master still says
and
|
That's a documentation bug, I believe. |
I will know in a few minutes when |
Summary by @ezyang:
packages
field you can specify remote tarballs or local tarballs, and using thesource-repository
syntax (from Cabal file) you can point to a VCS URL (this parser should also have been reused forcabal.project
)cabal get -s
supports getting things from source repositories.This should be doable in a day.
This came up on Twitter:
https://twitter.com/darinmorrison/status/527716059889954816
Basically, people want to publish packages that depend on stuff that is not on Hackage. One solution is to upload a forked package (example), but this has its own downsides (Hackage namespace becomes polluted). Implementing something like
build-depends: https://repo.git@revision
would be a nice alternative. Most other package managers (e.g.sbt
) support this.It should also be possible to prohibit downloading packages not on Hackage via a config file option.
See also #1534.
The text was updated successfully, but these errors were encountered: