Package 'log4dart' is depended on from both sources 'hosted' and 'git'
Asked Answered
B

2

6

Trying to review a tutorial from the following links:

http://blog.dartwatch.com/2012/03/building-client-server-dart-app-part-1.html http://blog.dartwatch.com/2012/03/building-client-server-dart-app-part-2.html

Here's my pubspec.yaml:

name:  myapp
description:  A sample application

dependencies:
  log4dart: any
  mongo_dart: 0.0.1
  unittest: { sdk: unittest }
  crimsonhttp:
    git: git://github.com/chrisbu/CrimsonHttp.git

And here's the error:

Resolving dependencies...

Package 'log4dart' is depended on from both sources 'hosted' and 'git'.

It doesn't matter if I add 'log4dart' to pubspec (any) or not. The error is always the same. 'log4dart' got installed from 'mongo_dart' anyway. Has anyone any kind of experience with that particular error message? To me, it seem so what like a circular dependency issue.

solution Until 'crimsonhttpd' get's the issue fixed or accepts my pull request, use my repository from github with following pubspec example:

name:  myapp
description:  A sample application

dependencies:
  mongo_dart: 0.0.1
  unittest: { sdk: unittest }
  crimsonhttp:
    git: git://github.com/geekrumper/CrimsonHttp.git
  log4dart:
Bountiful answered 31/10, 2012 at 10:1 Comment(1)
Thanks for the report. I've filed github.com/Solvr/log4dart/issues/5 to fix up the package.Puppet
P
3

John is correct, the workaround is to specify the same git repo for log4dart that crimson does.

Packages are identified by their (source, description) pair. For hosted packages, the description is just the package name, but for Git packages the description also includes the Git URL. So two Git checkouts of log4dart from different repositories would also be incompatible.

I've opened two bugs to fix up the packages you're trying to use:

Puppet answered 31/10, 2012 at 20:57 Comment(3)
One of the challenges right now is the lag time to get packages up. Looking forward to the pub upload capability, which currently looks blocked on HTTPS (for oAuth2) according to Nathan.Multinuclear
No doubt, that will speed things along.Puppet
here's my pull request for 'crimson...'. Also in the pubspec, use my repo until the request is accepted.Bountiful
M
2

I'm not sure why this would be an error for pub, but it appears that crimsonhttp is referencing the git version of log4dart. This is likely the cause of the error message.

To fix the issue, you could reference the git: version of log4dart in your own pubspec.

Multinuclear answered 31/10, 2012 at 13:10 Comment(4)
thx 4 reply, John... I just updated my question upon the result of your hint.Bountiful
What is the format of adding version when referencing to a package from git? I've double checked the docs and only see that referrencing to a branch is supported.Bountiful
@Maglebolia pub can only pull the most recent commit from a given branch. Imagine if there were 5 commits, all with the same pubspec version #. Which one should pub choose? pub.dartlang.org solves this by enforcing unique version numbers per upload.Multinuclear
okay... then I'll wait until crimsonhttpd does the fix or initiate a pull request... thank you anyway, John.Bountiful

© 2022 - 2024 — McMap. All rights reserved.