astashov/dartdocs.org

Recently published Flutter plugins do not build

devoncarew opened this issue · 38 comments

From @matanlurey on May 9, 2017 22:50

For example:

I'm assuming this is because of some language features or flags that are not on the dartdoc server?

/cc @filiph @sethladd

Copied from original issue: dart-lang/dartdoc#1408

Do we plan on fixing this by I/O?

From the other linked bugs, what happened here was that dartdocs runs its generation (inside a VM) as root. The flutter tool explicitly refuses to run as root and thus generation fails.

Now the question is, why do "dart:" libraries appear in those docs? :D But that's a separate bug.

Yup. :)

@astashov as per flutter/flutter#9547 crossdart now works great for plugins (e.g. https://www.crossdart.info/p/firebase_database/0.0.3/).

However, dartdocs.org seems to only work for some plugins. For example, https://www.dartdocs.org/documentation/url_launcher/0.4.2%2B1/ is there but https://www.dartdocs.org/documentation/firebase_database/0.0.3/ is not.

Do we need to trigger a build or something to get dartdocs for all plugins?

We could manually remove failed package names from Datastore, and then dartdocs.org would try to build them again. Or just launch a full rebuild of all the Dart packages, but that would take a while.

There's no command/script to rebuild only the packages, that failed, unfortunately.

Since you have just like 20 of them, it's prob simpler to do that manually :)

Okay, I've relaunched generation for all the Flutter plugins.

Thanks!

The generation is not finished yet, you can track progress there: https://www.dartdocs.org/history/index.html

By some reason it takes quite long to generate docs for Flutter plugins, because by some reason it generates docs for half of SDK as well.

Yes, I'm working on a bug to have our dartdoc team look at that.

The flutter SDK is in some instances referenced directly with a 'path' to sky_engine, which seems to confuse crossdart (many errors and warnings that dartdocs.org seems to ignore). Probably something similar is happening to dartdoc. I'm investigating dartdoc's part of the problem in dart-lang/dartdoc#1431.

@astashov, perhaps we can make the crossdart generation independent of that for dartdocs.org? Specifically I'm thinking that it would be nice to have docs available on dartdocs.org even if the crossdart generation fails.

Exceptions from crossdart don't affect documentation - worst case scenario - the source code in the generated dartdoc HTML won't have links to crossdart.

Although it is hard for me to tell as this is a flutter plugin (and I am still becoming familiar with these), the firebase_database looks like a bad package. It doesn't analyze properly because of missing imports for @required and @VisibleForTesting.

Looking at the others now.

Flutter "plugins" are just Dart packages with a bit of java and obj-c thrown in (and such is noted in the pubspec.yaml). From a dart perspective, they're no different from dart packages (and we should probably drop the distinction anyway). The source for firebase_database is:
https://github.com/flutter/plugins/tree/master/packages/firebase_database

I agree, I see use of @required, but no import of package:meta (or dependency on it in the pubspec). https://github.com/flutter/plugins/blob/master/packages/firebase_database/lib/ui/firebase_list.dart How would this package have passed analysis or pub publish validation?

Don't know; it fails analysis with the old analyzer too.

firebase_auth on the other hand will work with 0.12.0 dartdoc but fails analysis with 0.11.2.

@mit-mit made a change to github that isn't published yet to correct the SDK dependency for flutter_video_launcher, but once that is fixed the plugin will document successfully with 0.12.0

From dartdoc's perspective these are/were 'bad' packages in two cases (firebase_database and flutter_video_launcher), while 0.12.0 seems to do a better job with firebase_auth and you should just rerun with the new version there.

I see those firebase_database analyzer errors locally. Looking into fixing them right now...

I wish we could run the analyzer on the plugins on Travis to catch these problems, but flutter/flutter#10015 is currently blocking that, unfortunately.

@goderbauer, you could explore using tuneup on travis to catch analysis errors. It's based on the analysis server, so would be able to handle nested .packages files.

pub global activate tuneup
pub global run tuneup check

@jcollins-g are you still looking at this? We are still missing docs for these two:
https://pub.dartlang.org/packages/firebase_database
https://pub.dartlang.org/packages/firebase_auth

Ah, wait, this is likely this right? flutter/flutter#10528

@mit-mit That may be part of it, as I mentioned above those two packages are/were broken from analyzer's perspective. Until that gets corrected docs won't properly generate for them.

They pass flutter analyze for me now, after flutter/plugins#103. Is that enough?

It seems that some flutter plugins documentation generation fail again:

due to some dependency conflict

21:51:45.346 [INFO] dartdoc:Running 'pub --version'
21:51:45.514 [INFO] dartdoc:Stdout: Pub 1.24.2
21:51:45.514 [INFO] dartdoc:Running 'pub cache add sqflite -v 0.6.2'
21:51:46.043 [INFO] dartdoc:Stdout: Downloading sqflite 0.6.2...
21:51:46.043 [INFO] dartdoc:Running 'pub get'
21:51:47.419 [INFO] dartdoc:Stdout: Resolving dependencies...
21:51:47.419 [INFO] dartdoc:
             Stderr: Incompatible version constraints on async:
             - flutter_test 0.0.0 depends on version 2.0.3
             - pub itself depends on version >=1.8.0 <2.0.0

it worked some time (weeks?) ago