Skip to content

--package-root does not appear to work #766

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
eseidelGoogle opened this issue Aug 5, 2015 · 10 comments
Closed

--package-root does not appear to work #766

eseidelGoogle opened this issue Aug 5, 2015 · 10 comments
Assignees
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone

Comments

@eseidelGoogle
Copy link
Contributor

Here is an example package:
http://filebin.ca/2B2DDfWYrFNu/docdemo.zip

Here is a diff version of that zip:

diff --git a/packages/test b/packages/test
new file mode 120000
index 0000000..187d1b6
--- /dev/null
+++ b/packages/test
@@ -0,0 +1 @@
+../test/lib
\ No newline at end of file
diff --git a/test/lib/one.dart b/test/lib/one.dart
new file mode 100644
index 0000000..e4aa859
--- /dev/null
+++ b/test/lib/one.dart
@@ -0,0 +1,4 @@
+import 'packages:test/two.dart';
+
+class One {
+}
diff --git a/test/lib/two.dart b/test/lib/two.dart
new file mode 100644
index 0000000..a5a8403
--- /dev/null
+++ b/test/lib/two.dart
@@ -0,0 +1,2 @@
+class Two {
+}
diff --git a/test/pubspec.yaml b/test/pubspec.yaml
new file mode 100644
index 0000000..b327536
--- /dev/null
+++ b/test/pubspec.yaml
@@ -0,0 +1 @@
+name: test

(Note that in the above diff packages/test is a symlink, that's just the way git diff represents it.)

Now attempt to run dartdoc:

%dartdoc --input test
Generating documentation for 'test' into /src/docdemo/doc/api/

parsing test/lib/two.dart...
parsing test/lib/one.dart...
Parsed 2 files in 3.0 seconds.

[error] Target of URI does not exist: 'packages:test/two.dart' at /src/docdemo/test/lib/one.dart, line 1.
Generation failed: encountered 1 analysis error.

Now try with a --package-root:

dartdoc --input test --package-root packages
Generating documentation for 'test' into /src/docdemo/doc/api/

parsing test/lib/two.dart...
parsing test/lib/one.dart...
Parsed 2 files in 3.0 seconds.

[error] Target of URI does not exist: 'packages:test/two.dart' at /src/docdemo/test/lib/one.dart, line 1.
Generation failed: encountered 1 analysis error.

It appears the package-root is just being ignored.

eseidelGoogle added a commit to eseidelGoogle/engine that referenced this issue Aug 5, 2015
I can't really make further progress until at least:
dart-lang/dartdoc#766
is resolved, ideally also:
dart-lang/dartdoc#763

@abarth
@sethladd sethladd added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Aug 5, 2015
@eseidelGoogle
Copy link
Contributor Author

This is the one bug in dartdoc I can't easily work around at the moment. Short of actually doing a pub get inside the sky package before running dartdoc.

@sethladd sethladd added this to the Branch milestone Aug 5, 2015
@keertip keertip self-assigned this Aug 5, 2015
@keertip
Copy link
Collaborator

keertip commented Aug 5, 2015

Will take a look.

@keertip
Copy link
Collaborator

keertip commented Aug 5, 2015

@eseidelGoogle, are you passing in the complete path to the directory for package root?

@eseidel
Copy link

eseidel commented Aug 5, 2015

I tried both a relative and absolute path. "--package-root /src/docdemo/packages" as well as "--package-root packages" when running inside the docdemo directory. I also tried with and without a = separating package-root and the value. I didn't try debugging dartdoc itself.

@keertip
Copy link
Collaborator

keertip commented Aug 5, 2015

How are you running dartdoc? from source? pub global run?

@eseidel
Copy link

eseidel commented Aug 5, 2015

Pub global activate dartdoc
Dartdoc
On Aug 5, 2015 8:38 AM, "Keerti Parthasarathy" [email protected]
wrote:

How are you running dartdoc? from source? pub global run?


Reply to this email directly or view it on GitHub
#766 (comment).

@keertip
Copy link
Collaborator

keertip commented Aug 5, 2015

@eseidelGoogle , see that it is 'packages:test/two.dart', should be 'package:test/two.dart'

@eseidel
Copy link

eseidel commented Aug 5, 2015

Apologies. This was an attempt at making a reduction for an error we're
experiencing with the larger sky package. I'll fix my reduction and see if
I can still reproduce.
On Aug 5, 2015 8:52 AM, "Keerti Parthasarathy" [email protected]
wrote:

@eseidelGoogle https://github.com/eseidelGoogle , see that it is
'packages:test/two.dart', should be 'package:test/two.dart'


Reply to this email directly or view it on GitHub
#766 (comment).

@eseidelGoogle
Copy link
Contributor Author

Sigh. My repo was definitely busted. This can be closed. I'll figure out what the actual bug is.

@sethladd
Copy link
Contributor

sethladd commented Aug 5, 2015

No worries. Keep the feedback coming.

@sethladd sethladd modified the milestones: Branch, 0.5.0 Aug 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants