Skip to content

Add path: source strategy to pub, pull packages from location on disk #3732

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

Closed
sethladd opened this issue Jun 18, 2012 · 20 comments
Closed

Add path: source strategy to pub, pull packages from location on disk #3732

sethladd opened this issue Jun 18, 2012 · 20 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug
Milestone

Comments

@sethladd
Copy link
Contributor

Not all packages come from git, some come from a location on disk (like the SDK). Add a path: source strategy to find and use them.

e.g.

dependencies:
  unittest:
    path: /absolute/path/to/sdk/lib

@munificent
Copy link
Member

We do plan to have a file path source, but you won't need that for SDK packages since they already have their own source.


Added this to the Later milestone.

@munificent
Copy link
Member

Removed this from the Later milestone.
Added this to the M3 milestone.

@DartBot
Copy link

DartBot commented Oct 31, 2012

This comment was originally written by [email protected]


This feature is very useful. Please add support of 'path'..

@kevmoo
Copy link
Member

kevmoo commented Nov 1, 2012

Perhaps to double-down on the obvious.

If I'm developing two packages at the same time on local disk, I can use git with local path syntax, but then I have to constantly commit on one and re-run 'pub update' on the other.

Being able to reference a local path and have the symbolic link point to my working 'lib' dir would rock.

@sethladd
Copy link
Contributor Author

sethladd commented Nov 1, 2012

Hi Nathan and Bob,

Would you take a patch for this? Is this functionality that you'd like to see in pub?


cc @nex3.
cc @munificent.

@munificent
Copy link
Member

Yes, this is definitely a planned feature (and, last I checked, the most starred pub bug). Patches are welcome!

@DartBot
Copy link

DartBot commented Nov 21, 2012

This comment was originally written by @simonpai


Linking some related discussion, just FYI:
https://groups.google.com/a/dartlang.org/d/msg/misc/J9OR0zzZATE/LdfToVn94HMJ

@nex3
Copy link
Member

nex3 commented Dec 7, 2012

Marked this as blocking #7199.

@selkhateeb
Copy link

I'm not convinced this is the right way to go as it makes it hard to share code with other developers, everyone must have his own pubspec.yaml file that points to some paths in his system.

I would propose having a 'development' version string, similar to the 'any' version concept. When 'pub install' encounters a 'development' version it would look for a global config file somewhere in the home directory named 'pubconfig.yaml'. The 'pubconfig.yaml' file would contain the path source that is needed by pub to install the dependancy.

Example:
project/pubspec.yaml:

dependencies:
    web_ui: development

~/pubconfig.yaml:
development:
    web_ui: /path/to/web_ui/

pub install
Resolving dependencies...
Linking web_ui /path/to/web_ui ...

@kevmoo
Copy link
Member

kevmoo commented Jan 12, 2013

Ooo...that's kinda nice.

Then pub publish can raise holy hell if it sees the development dependencies.

I have a lot of projects on my machine that depend on each other. Being able to register the 'dev' location for project X and refer to it w/ one change in other projects is pretty clean.

@jmesserly
Copy link

+1 for some way to set up development dependencies!
it's painful to try and coordinate work across several packages right now

@selkhateeb
Copy link

If anybody is interested, here is a patch that implements the path source idea. This patch can be applied to this latest stable trunk.

I used this for the past few days and concluded that its not the best way to be used for larger teams as in Comment 9

Give it a try and let me know what ideas you might come up with

Thanks


Attachment:
pub_path.patch (4.54 KB)

@DartBot
Copy link

DartBot commented Jan 12, 2013

This comment was originally written by [email protected]


+1 for the 'development' dependency idea ('dev' might be simpler and less prone to typos) and separating the local paths into a separate mechanism.

@DartBot
Copy link

DartBot commented Jan 13, 2013

This comment was originally written by [email protected]


'development' dependency idea looks very promising to me too.

@munificent
Copy link
Member

We're planning to do dev dependencies at some point. Here's the relevant bug to follow: http://code.google.com/p/dart/issues/detail?id=5358

same@, I have similar thoughts about path: dependencies. I'll see if I can sit down with Nathan soon and work out what we want to do here. I would definitely like to address this relatively soon.

@selkhateeb
Copy link

I think issue #8 has a different purpose than what we have here.

Issue #8 talks about dependencies that are needed for developing the project, like unittest. Which we don't care about in production.

This issue talks about a development "version" of a production dependency.

I have implemented a working prototype of whats in comment #­9. Let me know if you want me to share the code here and take it for a spin

Thanks

@DartBot
Copy link

DartBot commented Jan 15, 2013

This comment was originally written by [email protected]


So here's an idea I had and wanted to explore, but didn't (yet) due to lack of time.

Pub could spawn a local server that would act as a repository (i.e., it would speak the pub.dartlang.org protocol) serving a set of defined packages from local filesystem and acting as a proxy to pub.dartlang.org for other packages. Then, pub install/update (when ran in special mode) would use this local server instead of pub.dartlang.org. The main advantage is that pubspec itself wouldn't necessarily have to be aware of this "development mode", which I'd consider a good thing.

@DartBot
Copy link

DartBot commented Jan 16, 2013

This comment was originally written by @simonpai


+1 for having a local server.

As you will not want to commit the path dependency setting in your pubspec to the remote, it is much better if pub can resolve this issue transparently, independently from your code base. Otherwise you will have the leave untracked changes all the way during your development, in every project on the dependency chain, which is very very annoying.

@DartBot
Copy link

DartBot commented Jan 16, 2013

This comment was originally written by [email protected]


Very annoying, please add a workaround (e.g. path: ...)!

@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#54.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants