-
Notifications
You must be signed in to change notification settings - Fork 841
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 git repos / http folders in packages stanza #199
Comments
Wow, that'd be pretty awesome! |
+1 I've had the use-case once or twice. |
If we make some simplifying assumptions, this should be trivial. In particular: assume that the URL or Git commit represents something immutable. Then we unpack/clone into a directory inside |
Where "unwanted" means "not a wanted target" in the Make-like |
cabal-meta does much of this and works with darcs also |
I already have an issue open about merging in mega-sdist functionality. Are you opposed to absorbing a few other of the cabal-wrapping tools we've created over the years? |
This is another tool that could possibly stay as a separate executable, except that the tool could benefit from |
This is great. The only thing I'd add is that some (reasonably prominent) haskell packages put more than one package in the same repository (as subdirectories). For example, all of the
|
Despite my better judgement, I decided to take a crack at this right now, so your timing is perfect @dbp. I was just thinking about what the syntax would be, and of the subdirs. Another option I was toying with was, instead of trying to shoe-horn everything into a single string, turning it into a YAML object, e.g.: projects:
- some/dir
- location: another/dir
- location: https://github.com/foo/bar
commit: deadbeef
subdirs:
- subdir1
- subdir2 It feels kind of wordy to me, but also may be much easier to work with long term. It also allows us an easy way to encode extra useful information, like "never run test suites on this package" (which is needed for #219). We can bikeshed the syntax easily later, the meat of this will be the rest of the implementation. I'll start on a branch that uses the YAML syntax, and we can figure out what the real thing will look like later. |
I was just going to chime in and suggest favoring YAML over grammar. |
I think what @snoyberg proposed actually looks pretty good. At least for me, most of the time that this comes up are when I find a bug (or needed improvement :P) in a released package and need to patch it until the fix is released upstream, so having it be wordy really doesn't matter (as there are rarely many). |
I've implemented the stack-specific stuff already, and now just have some stubs for downloading/unpacking/cloning at: 038ec35#diff-6cd1b827a90e053dc1b700465b1a94c0R316 I slightly tweaked the syntax above regarding Git locations to start with the word - location: git https://github.com/yesodweb/wai master
subdirs:
- wai
valid-wanted: false Obviously using |
Alright, I've implemented HTTP support. Git support should be much the same, I'm just too tired to continue. If someone wants to take a crack at it, have fun. |
Alright, it's implemented :) @mboes Want to give it a test drive? |
This looks awesome. Thanks a bunch! Now go to sleep. ;) |
@snoyberg leaving open - close once branch is merged. |
Just wanted to leave my +1 on this feature. Love it. |
I would go farther with the YAML and not require any custom parsing. For reference, here is Ruby's Bundler. It uses Ruby's hash syntax, which is conceptually like YAML.
With stack, we could have
This does not necessarily preclude allowing the custom parsing for a location field if that is still desired for some reason. But it makes it easier to document the available configurations and gets us out of the business of parsing. |
+1 on less custom parsing |
I like the idea of supporting both a short syntax and a more complete syntax like you've demonstrated here. Would you be able to add a commit to extend the |
OK, merged to master, closing. |
Currently, if a package depends on a patched up upstream, the recommendation found in the FAQ is to check out the package as a git submodule, or unpack the source code for that package in some local directory.
However, often it's not so much that a user wants to depend on a patched up package, as the fact that the user is depending on an unreleased version of upstream. In this case it would be nice to be able to directly point to a remote repository, or to a commit hash in some remote repository, directly in the stack.yml file without needing to checkout the remote code just for the purpose of building against it.
The text was updated successfully, but these errors were encountered: