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

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

Closed
DartBot opened this issue Jun 5, 2015 · 19 comments
Closed
Assignees
Labels
type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="96" height="96"hspace="10"> Issue by sethladd
Originally opened as dart-lang/sdk#3732


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2590778?v=3" align="left" width="48" height="48"hspace="10"> Comment by RWander


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


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.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd


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.

@DartBot DartBot added type-enhancement A request for a change that isn't a bug Fixed labels Jun 5, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/785058?v=3" align="left" width="48" height="48"hspace="10"> Comment by simonpai


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


Marked this as blocking #344.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/154468?v=3" align="left" width="48" height="48"hspace="10"> Comment by selkhateeb


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 ...

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


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.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1081711?v=3" align="left" width="48" height="48"hspace="10"> Comment by jmesserly


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/154468?v=3" align="left" width="48" height="48"hspace="10"> Comment by selkhateeb


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
Author

DartBot commented Jun 5, 2015

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
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/154468?v=3" align="left" width="48" height="48"hspace="10"> Comment by selkhateeb


I think issue dart-lang/sdk#8 has a different purpose than what we have here.

Issue dart-lang/sdk#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
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/480590?v=3" align="left" width="48" height="48"hspace="10"> Comment by Ladicek


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
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/785058?v=3" align="left" width="48" height="48"hspace="10"> Comment 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
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


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

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

2 participants