Skip to content
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

Allow installing from github #1278

Open
ndmitchell opened this issue Nov 3, 2015 · 11 comments
Open

Allow installing from github #1278

ndmitchell opened this issue Nov 3, 2015 · 11 comments

Comments

@ndmitchell
Copy link
Contributor

I'd like to do:

stack install https://github.com/ndmitchell/hoogle.git

And have that "just work". Bonus points if the version without .git also works. In particular, this would need to check out the repo, if a stack.yaml was missing it would need to stack init, and then stack install. See https://hackage.haskell.org/package/cabalg by @dmaliko for a version for Cabal.

@ndmitchell
Copy link
Contributor Author

It would be nice if stack install hoogle:git worked too, since stack knows where the hoogle repo is.

@ndmitchell
Copy link
Contributor Author

In fact, it would be super cool if stack upgrade --git was an alias for stack install stack:git - then everyone can reuse the upgrade stuff with very low effort.

@bitemyapp
Copy link
Contributor

👍 I like this :)

@mgsloan
Copy link
Contributor

mgsloan commented Nov 4, 2015

I agree that this would be cool! It'd also be nice to be able to install from a URL / path to a tarball.

The hoogle:git syntax won't fly, because it's already used for the targets parsing - hoogle:git refers to building the git component (an exe, test, or bench). If the parameter fails to be parsed as a package name / component spec, it's interpreted as a directory (and all packages that are contained within are included (recursively)).

So, targets syntax is already pretty involved.. But having a short thing for "Look up the source control metadata and use it" would be pretty darn sweet :) . This would be like supporting stack upgrade --git, but for other projects than stack. Could be a can of worms as well, though, if folks start asking for support for version control support beyond git.

@ndmitchell
Copy link
Contributor Author

stack install hoogle --git is probably a better syntax, being consistent with upgrade. If you support --git and http tarballs then users of other VCS (those mythical people) can use a tarball of their repo.

@tchoutri
Copy link

tchoutri commented Aug 31, 2017

Then perhaps should we think about a way to make stack more a package manager, with uninstalling and such?
People (me included) are using it like that and if no (serious) alternative is provided to the community, more and more will complain that they cannot uninstall software with Stack.

(now for the on-topic comment: This is a great idea and will probably avoid having a lot of packages on hackage/stackage that are only there to provide their users a better user experience for the installation process)

@ghost
Copy link

ghost commented Dec 18, 2018

I'm all for this 👍 I just found myself in a situation where I have developed a library that I want my installed tool (Shake) to see. I currently see no way of doing that. Is there some kind of temporary workaround? Like copying/symlinking certain files?

@dbaynard
Copy link
Contributor

dbaynard commented Dec 18, 2018

Hi @samvv, more detail would be helpful. Is your library published somewhere?

In particular, the manual has a number of approaches that may be relevant — but from the information you've given so far it's hard to judge what to suggest.

@ghost
Copy link

ghost commented Dec 19, 2018

@dbaynard Thanks for the response. This is the library. It's isn't published anywhere yet; my account on Hackage has yet to get approved. I've managed to fix it by installing vanilla Cabal, doing a stack sdist and then a cabal install <tarfile>. A bit ugly, but it works.

@dbaynard
Copy link
Contributor

dbaynard commented Dec 19, 2018

That’s helpful. You may wish to use a custom snapshot which includes your github repo.

I can give more detail if the (relevant bit of the) shakefile is public. Would you be willing to put it in a gist, or something?

@ghost
Copy link

ghost commented Dec 20, 2018

@dbaynard The project is over here, though it doesn't matter much, because I've switched back to CMake for this particular project instead of Shake. Thanks for wanting to help anyways, and I still think it would be a cool feature to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants