-
-
Notifications
You must be signed in to change notification settings - Fork 78
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 for git dependencies #238
Comments
note that it would be great to also be able to specify commit number/branch/tag (like npm does I think) |
Yes, it's like |
+1 for this |
As mentioned in #135 (comment), I think we should adopt NPM dependency format, see https://docs.npmjs.com/files/package.json#dependencies. |
I'm fine with following anything that is quite standardized as NPM seems to be, as long as we keep backward compatibility with our previous format, so users can continue downloading and submitting libraries using the old format. |
|
Maybe something like Cargo from rust lang? |
That is interesting stuff, thanks! |
I like the Cargo impl too. but this is new format and will change the our current format: But we can really preserve backward compatibility. We can easy support old(current) and new formats - detect format via Reflection and use the special provider (parser) for it (Or EitherType). |
Another one variant - namespace-like: "dependencies": {
"libFromHaxelibA": "",
"libFromHaxelibB": "10.2.4",
"libFromGit": "git::https://github.com/HaxeFoundation/libFromGit.git",
"libFromHg": "hg::https://bitbucket.org/HaxeFoundation/libFromHg"
} But without tags/revs/branches. |
I love the NPMs format but it doesn't support any other control version system. |
The npm tool itself doesn't support anything but git, but the URL format looks extensible enough (e.g. |
As discussed in #105, it would be also nice to support |
This raises more questions: should we / how to store multiple versions of a library checked out from some vcs. For example, library A declares Technically, we can support that by generating some unique version identifier from a vcs url (like |
It depends if we can make the hypothesis that the user won't modify the content. In that case when installing we only fetch, and when compiling we do a checkout of the required commit/branch/tag. |
Note that the git version dependencies are still not work if you install a library from haxelib because HaxeFoundation/haxelib#238
Hello, We have the same need so I've investigated the sources and this thread, and have some conclusion and some code now.
To make it backward compatible, i've tried with the following syntax: haxelib.json Later we can introduce maybe a structured syntax for the haxelib.json, to describe all the features of git dependency (like subfolder). So for now i would not follow fully the npm style According to these conclusions i've made some implementation here: This branch implement the following features that i've mentioned above:
I still need to write the tests if we can agree on the things. Also we could think about some extra syntax to describe subdir like git:https://github.com/grosmar/something.git#commit-ish@subDir What do you think guys? |
I'm yet to look at the code, but the proposition looks nice. I agree about expanding
another option would be to add another colon here, e.g. as for tags, I think commit-ish is sufficient. |
Let me know if you have time to check the repository. |
I'm looking at the code right now. Can't say I like it very much, but that's not about your part, but haxelib codebase in general. I think if we decide on the design here, any code will do as long as it works, then we can refactor it from there. Also, I remembered one issue with losing dev-mode for vcs dependencies - using a subdir inside a repository for the haxelib (see #263 (comment)). I wonder though if that feature used at all and worth caring about... |
Anyway, I can't think of any issues regarding the proposed syntax. |
I also cannot say that i like the code, but i didn't want to change deeply the codebase because of this implementation. I can look into the subdir devmode problem later. But for me this subdir stuff sounds a bit nasty anyway. I prefer one repository for one lib, so why should i need a subdir? So can we agree on the followings as a final decision:
commit-ish means anything that can be passed to And later we can improve the implementation and use versioned git folder like this: This way we can have multiple git version checked out and used. But I don't want to mix it now. So can we agree on this syntax? If yes, i finish the development and create the tests. |
No idea, I think I have never needed that.
Fine with me 👍
Not sure about the subdir syntax, but if we lose that feature, we don't need it anyway :) I don't feel like I can decide for the HF here though, so let's summon @ncannasse @Simn @andyli. Check it out guys, this feature is quite important IMO. Also ping @fponticelli and @andywhite37, since they are using the hmm tool they wrote, so they may have an opinion on this! |
I really want this feature too. However, I don't think we will have enough time to make sure the design and implementation is solid enough for the upcoming haxe 3.3 release. So I will suggest looking into it after that. |
I agree with Andy, let's focus on getting selfupdate stable so we can take our time with features like this. |
Ok, then I'll work on it according to "docs" that i've wrote above, and i'll let you know guys when it's finished. |
Fine with me! We'll focus on making haxelib easily updateable and then will introduce this feature. |
Just letting you know that we've implemented the new self-update mechanism and new version notification. So we can deliver this at any time. |
I've been thinking more about this and I don't think this is a good idea.
Also what happens when two libraries add a different git url under the same name?
And since I fail to see the point of this (if you are sending your lib to haxelib with not the dependencies?) that looks like a nightmare for nothing as far as I see (could be extremely useful and I just don't realize it, but still the issues apply). |
@ibilon These concerns are indeed valid for libraries published on lib.haxe.org, but publishing a library with git dependencies are just bad style and is headache for library's author (if they want their library to be used by someone anyway). I doubt many authors would do that. At least it's not a problem on NPM. OTOH, as discussed above, I still think it makes sense to expand the purpose of Aside from that, it can be useful when working in a company with private repositories, when different teams create different modules and it's often much less annoying to just use git instead of doing releases on some private haxelib server.
One option also discussed above is generating an unique version directory name like |
I think it shouldn't be allowed, if we can make the hypothesis that libraries on lib.haxe.org only have dependencies on lib.haxe.org then there are several things we can do like #290.
I see, I'm not sure haxelib is the best place to have this, but I don't want another file format either. In that case the format should be relaxed, all the fields (except the name?) should be optional, Should it be picked by |
I see the advantage of having published haxelib only depend on other At the same time, not all libraries are on haxelib for various reasons, I do think that haxelib git should be able to deal with other git Among other things, this makes it easier to use haxelib with an ecosystem On Fri, Mar 18, 2016 at 3:54 PM, Valentin Lemière [email protected]
|
I agree, Though about something, why is the git url used as version? That's clearly the library "name" (if you think of name as a uri it makes more sense) and commit/tag/branch the version. That way there's a lot less name conflict between libraries, especially between published and non published. With the exception of path all name would uniquely define a library. |
On Sat, Mar 19, 2016 at 11:32 AM, Valentin Lemière <[email protected]
If we had https support (which doesn't seem worthy of inclusion in the
|
IIRC our repository server currently validates that all dependencies are present in the database. I think we could as well check for absence of |
Sorry guys, i didn't disappear but became extremely overloaded in this time. As the things getting better I will get back to this issue. |
Hi! Finally I'm back on the issue. I've updated with all the changes from the master since, and here is now the branch that contains the modifications: As I see there are still a few open questions, also I added some. Let's talk about them and make a decision:
Guys, please look through the problems and if we can agree what to do we should finish this long topic. I think many people would be happy with this feature! |
Hey @grosmar, thanks for working on it!
Agreed, that should work just fine.
I'm not sure about these ones, have to think some more. Right now, I feel like the feature wouldn't be very useful without supporting multiple repos/branches for a lib...
Yeah, just check the dependencies at upload time (both on client and server), so that it only accepts released versions.
Agreed, that's really not much different. However, this gave me an idea that we could have a command that "bakes" current active haxelib versions in a
Sorry, I didn't understand what that was about, could you elaborate? |
Hey,
I was thinking about it, and it's not so trivial. Let's imagine you want to work on that get dependency at the same time as you develop. Normally everyone get used to switch with git between branches when he need to switch, but now we want to override this behavior, and make clones by branches (even more maybe commits!!!).
It would be nice, and yes npm have it. But do it as a different improvement. I think this change already getting a bit big...
I just tried to say 2 things:
Everything else that you marked as agree I consider as we finished that topic and we can go in that way that I've wrote above (including subdir support, we agreed on it before i think) |
Ping? :) |
Sorry, I totally forgot about your comment, since I'm pretty busy at the moment. Alright, let's not bother with multiple git dep versions right now. The single git checkout should be already useful for setting up local projects together with local repositories ( What would be a nice addition is to display current git remote and branch/commit for
Yeah,
I agree and that complies with my vision of PS man, I more and more often think we should just throw away haxelib and write a brand new package manager, getting the best from npm, cargo, opam, gem... |
Hi guys, |
Hi, |
It already works for me in haxelib bundled with Haxe 3.4.x like this: "dependencies" : {
"library": "git:ssh://[email protected]:7999/repo.git#e462962ee27"
} I guess to setup a dependency on a repo from github, you need to specify it like this: "dependencies" : {
"library": "git:https://github.com/HaxeFoundation/hxnodejs.git"
} |
thank you |
It doesn't seem possible to have git dependencies currently :
The above seems to fail. Or maybe there is another syntax ?
If not, then I think it would be nice to support git dependencies, pretty much like
npm
does.The text was updated successfully, but these errors were encountered: