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

Ability to download dependencies from arbitrary sources. #632

Closed
Master-Foo opened this issue Jul 26, 2015 · 11 comments
Closed

Ability to download dependencies from arbitrary sources. #632

Master-Foo opened this issue Jul 26, 2015 · 11 comments
Labels

Comments

@Master-Foo
Copy link

Loving DUB as a tool. I'm a DUB newbie so, if this is already a feature tell me to fuck off. (Preferably with an explanation how to do this)

Anyway, it would be nice to have the ability to download dependencies from arbitrary sources. For instance, I'm working on a library and don't want to clog the code.dlange.org repository with my bullshit until it's worthy. So, it would be nice to have a configuration in the the dub.json to specify an arbitrary source, such as github, or my private gitlan repositories or any arbitrary git repository.

For example, something like this:

"dependencies": {
    "some_library" : {
        "version" >=0.0.1",
        "sourcePaths" : "https://github.com/PathTo/some_library.git"
},

I'd be willing to work on this feature myself if someone more knowledgeable with DUB is willing to mentor me.

@p0nce
Copy link
Contributor

p0nce commented Jul 27, 2015

Tjhe most common way is to use path-based dependencies: https://github.com/D-Programming-Language/dub/wiki/Cookbook#working-with-submodules-or-packages-that-are-not-in-the-registry

Alternatively see dub add-path and dub add-local.

Issue #525 has a discussion about it.

@Master-Foo
Copy link
Author

Thanks for your response. I'm using dub add-local currently. But, that seems like a bandaid, not a solution.

I like to be able to emulate the distribution process as accurately as possible during development. Likewise, some packages are not fit for hosting in a community repository, (specifically), but would benefit from having a private repository.

For instance, a valid use case would be: Unfinished libraries and libraries which have little or no interest to the community at large. Both use cases could still benefit from a distribution method, but perhaps not the default DUB repository.

Forgive my ignorance, correct me if I am wrong, but my understanding is that when you list a dependency in dub.json, it downloads that dependency straight from it's github source? Correct?

So, Why not add the ability to specify a specific source in the dependency declaration and forego the DUB registry all together? The DUB registry is a nice convenience, but why require it?

@p0nce
Copy link
Contributor

p0nce commented Jul 31, 2015

Forgive my ignorance, correct me if I am wrong, but my understanding is that when you list a dependency in dub.json, it downloads that dependency straight from it's github source? Correct?

Yes but the particular tag must have been acknowledged by the DUB registry before.

So, Why not add the ability to specify a specific source in the dependency declaration and forego the DUB registry all together? The DUB registry is a nice convenience, but why require it?

I would also like to bypass it for private libs, but this needs to really work and honestly build problems are more concerning to me currently :)
The book-keeping logic of the tags is currently managed by the registry not DUB.
What I do here is use path-based dependencies for private libs. Works well but you loose versionned dependencies.

@Master-Foo
Copy link
Author

Thanks for taking the time to describe this to me. I appreciate it.

I suppose, if there is some kind of feature request area, maybe it would be worth while to put this there so that when more pressing issues are behind the project, maybe we can come back to it?

It sounds like this kind of feature might require an overhaul of the system in general, so maybe hold off until the next major release?

Keep me informed of the situation and I'll try and lend a hand.

  • Thanks.

@p0nce
Copy link
Contributor

p0nce commented Aug 1, 2015

It sounds like this kind of feature might require an overhaul of the system in general, so maybe hold off until the next major release?

Eh I'm just a random user. I don't feel like what we do have is too bad. The problem with direct github access is that it would create pressure on the Github API which is not free after some volume of requests.
Hence the need for a third-party website that enumerate tags while using the minimum of API calls.

@Master-Foo
Copy link
Author

I agree, I love DUB as-it-is. There is always room for improvement though.

I suppose I should explain myself better though. I wasn't implying that there should be GitHub functionality. More like Git functionality in general, which wouldn't require using the GitHub API. For instance, I'm using GitLab for some of my projects. But I can use generic git commands to access those repositories, same goes for GitHub. Or any Git repository for that matter.

One of my concerns is, and I hate bringing politics into the discussion, GitHub is currently being swarmed by SJWs as noted in their recent CoC. GitHub is also dictating and threatening to ban projects based on arbitrary moral standards.

I'm not building anything particularity objectionable. But I think this is a warning for projects like DUB to rely less on requiring specific repositories and allow arbitrary repositories so DUB packages can't be censored.

I'll get off my soap box now. Thanks for putting up with my bullshit. LOL.

@Zalastax
Copy link

The node.js package manager does this very well by allowing arbitrary git repositories/commits as a version. This decreases friction when you need to create a fork to fix something (can't wait for a response from the maintainer) or when you need a specific commit between releases. It's possible to work around as you say but it would be very convenient to have.

@Zalastax
Copy link

This is a duplicate of #104

@andre2007
Copy link
Contributor

Dub supports now also Maven repositories in addition to Dub registries (Artifactory, Nexus).
Does this solve your issue?

@andre2007
Copy link
Contributor

Also file system provider will be available in near future: #1616

@Geod24
Copy link
Member

Geod24 commented Dec 27, 2019

Closing because:

@Geod24 Geod24 closed this as completed Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants