Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport non-Hackage dependencies #2189
Comments
23Skidoo
added
the
type: enhancement
label
Oct 31, 2014
23Skidoo
self-assigned this
Oct 31, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mietek
Nov 11, 2014
Contributor
Halcyon supports declaring sandbox sources with the HALCYON_SANDBOX_SOURCES option.
See Try Haskell for an example of declaring the git HEAD version of mueval as a sandbox source.
|
Halcyon supports declaring sandbox sources with the See Try Haskell for an example of declaring the git |
mietek
referenced this issue
Nov 11, 2014
Open
feature: cabal sandbox add-source <git-repo> (darcs too ideally…) #1534
23Skidoo
referenced this issue
Dec 13, 2014
Closed
Support alternate ways of referring to packages in build-deps #2271
ttuegel
added this to the
_|_ milestone
Apr 24, 2015
23Skidoo
referenced this issue
Jun 24, 2016
Closed
[Feature Request] Support for VCS as project's build-depends #3508
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
winterland1989
Jul 11, 2016
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.
winterland1989
commented
Jul 11, 2016
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ezyang
Jul 11, 2016
Contributor
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 cabal new-build will automatically build them together. Does that solve your proximal problem?
|
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 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
winterland1989
Jul 11, 2016
Thanks for your reply @ezyang ! I'm aware that there're multiple ways solving local package discovery: cabal sandbox add-source or a cabal.project file both solve this, and i'm aware that cabal.project file support parsing URI as package now. But we need an automatic way to pull/update the remote file into disk without hassle, currently available options are git submodule, hand-role shell and stack.(you really want to automate this process when you got more than 5 local depends).
If cabal.project file is the final solution, i'll dig into it to see what i can do.
winterland1989
commented
Jul 11, 2016
|
Thanks for your reply @ezyang ! I'm aware that there're multiple ways solving local package discovery: If |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
23Skidoo
Jul 11, 2016
Member
@winterland1989
There is already some code for declaring VCS dependencies in cabal.project files: https://github.com/haskell/cabal/blob/master/cabal-install/Distribution/Client/ProjectConfig.hs#L523
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.
|
@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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alanz
Jul 11, 2016
Collaborator
I would like to see something like http://docs.haskellstack.org/en/stable/yaml_configuration/#complex-package-locations-location
|
I would like to see something like http://docs.haskellstack.org/en/stable/yaml_configuration/#complex-package-locations-location |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
phadej
Jul 13, 2016
Collaborator
Looks like we only need to teach cabal-install how to fetch stuff from the internet:
tar support shouldn't be difficult, as cabal handles it already. git is trickier, as we need to teach cabal-install to call git clone (and darcs).
Question: were to put downloaded stuff, dist-newstyle/downloaded/hash-of-the-source ?
|
Looks like we only need to teach
Question: were to put downloaded stuff, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
phadej
Jul 13, 2016
Collaborator
(For now one can use git submodule, effectively the result should be the same)
|
(For now one can use |
phadej
added
the
cabal-install: nix-local-build
label
Jul 13, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alanz
Jul 13, 2016
Collaborator
FYI, every github commit can be downloaded as a zip file, e.g.
https://github.com/haskell/cabal/archive/master.zip
https://github.com/haskell/cabal/archive/59eabde01e7df7ac51602b40d867fe5ece2992c2.zip
|
FYI, every github commit can be downloaded as a zip file, e.g. https://github.com/haskell/cabal/archive/master.zip |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
winterland1989
Jul 13, 2016
FYI, every github commit can be downloaded as a zip file, e.g.
Yes, but that's github's convention, we probably shouldn't rely on that convention. In fact we can safely assume user have git binary installed if they want to use git depends, and we can use process package manage git clone/pull.
winterland1989
commented
Jul 13, 2016
Yes, but that's github's convention, we probably shouldn't rely on that convention. In fact we can safely assume user have |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alanz
Jul 13, 2016
Collaborator
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alanz
Jul 13, 2016
Collaborator
And there is a general-purpose variant too
https://git-scm.com/docs/git-archive
This supports a --remote=XXX flag
|
And there is a general-purpose variant too https://git-scm.com/docs/git-archive This supports a |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
phadej
Jul 13, 2016
Collaborator
@winterland1989 I hope we can interpret @alanz comment, as so even support for remote tarballs would make him a lot happier :)
|
@winterland1989 I hope we can interpret @alanz comment, as so even support for remote tarballs would make him a lot happier :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
winterland1989
Jul 13, 2016
Yes, support for remote tarballs is enough for me too ; )
Having a temporary config in a cabal.project is a lot more lightweight than adding a git submodule.
This is also my main motivation for this feature requesting, manually manage forked source is frustrating.
winterland1989
commented
Jul 13, 2016
•
|
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. |
acfoltzer
referenced this issue
Jul 21, 2016
Open
Tracking ticket for Galois `new-build` requirements #3577
aisamanra
referenced this issue
Jul 21, 2016
Open
Add flag to `new-configure` for adding extra `packages` to `cabal.project.local` #3585
23Skidoo
added
the
meta: 23Skidoo
label
Jul 27, 2016
23Skidoo
removed their assignment
Jul 27, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ezyang
Aug 28, 2016
Contributor
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 packages or similar fields), then they are not eligible to be cached and reused in the external store. That's probably not desirable.
|
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 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dcoutts
Sep 8, 2016
Member
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
23Skidoo
Sep 8, 2016
Member
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.
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. |
ezyang
modified the milestones:
Default nix-local-build,
⊥
Sep 8, 2016
ezyang
added
the
priority: low
label
Sep 8, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ezyang
Sep 8, 2016
Contributor
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 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... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bitemyapp
Oct 28, 2016
Contributor
I'm looking forward to celebrating this issue's second
|
I'm looking forward to celebrating this issue's second |
23Skidoo
referenced this issue
Nov 8, 2016
Closed
cabal doesn't support url to git repos as dependencies #4090
alexbiehl
referenced this issue
Feb 1, 2017
Closed
Prototype for source repository support in cabal.project #4289
fgaz
added this to planned
in Last Mile for `cabal new-build` (HSOC2017)
Jun 14, 2017
fgaz
moved this from planned
to stretch goals
in Last Mile for `cabal new-build` (HSOC2017)
Aug 7, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
gbaz
Mar 24, 2018
Collaborator
The provenance-qualified imports proposal (ghc-proposals/ghc-proposals#115) is relevant here.
|
The provenance-qualified imports proposal (ghc-proposals/ghc-proposals#115) is relevant here. |
typedrat
added this to ToDo
in Have new-build become build (GSOC2018)
May 2, 2018
typedrat
moved this from ToDo
to InProgress
in Have new-build become build (GSOC2018)
May 22, 2018
typedrat
moved this from In Progress
to To-Do
in Have new-build become build (GSOC2018)
Jun 12, 2018
typedrat
moved this from To-Do
to In Progress
in Have new-build become build (GSOC2018)
Jun 30, 2018
typedrat
moved this from In Progress
to Done
in Have new-build become build (GSOC2018)
Jul 14, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
hvr
Jul 14, 2018
Member
It's a pity @bitemyapp won't get to celebrate schadenfreude this year... ;-)
|
It's a pity @bitemyapp won't get to celebrate schadenfreude this year... ;-) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Closed by #5351. |
typedrat
closed this
Jul 15, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nomeata
Jul 18, 2018
Contributor
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
3. [STRIKEOUT:They can specify an ``http``, ``https`` or ``file``
URL, representing the path to a remote tarball to be downloaded
and built.] (not implemented yet)
and
[STRIKEOUT:There is also a stanza source-repository-package for specifying packages from an external version control.] (Not implemented.)
|
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
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
That's a documentation bug, I believe. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nomeata
Jul 18, 2018
Contributor
I will know in a few minutes when cabal has built and I can try the feature :-)
…
Yes, seems to work. Great!
|
I will know in a few minutes when |


23Skidoo commentedOct 30, 2014
•
edited by ezyang
Edited 1 time
-
ezyang
edited Jul 28, 2016 (most recent)
Summary by @ezyang:
packagesfield you can specify remote tarballs or local tarballs, and using thesource-repositorysyntax (from Cabal file) you can point to a VCS URL (this parser should also have been reused forcabal.project)cabal get -ssupports 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@revisionwould 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.