dart-archive / polymer-dart

Polymer support for Dart
https://pub.dartlang.org/packages/polymer
BSD 3-Clause "New" or "Revised" License
181 stars 33 forks source link

"Missing entry point: tool/status.dart" but it's there #636

Closed zoechi closed 8 years ago

zoechi commented 8 years ago

pub serve prints

[Info from Reflectable on polymer_elements_demos|ReflectableTransformed]: Missing entry point: tool/status.dart

When I load a page from the polymer_elements_demos project (for example web/index.html

- reflectable:
    entry_points:
    - web/index.dart
    - tool/status.dart

Maybe related to the directory tool instead of web

This seems not to cause any harm, all seems working fine, still wondering if this needs some fix.

jakemac53 commented 8 years ago

This is really a bug on the reflectable transformer. It expects to be able to see all files but that isn't always the case with pub serve. I don't think the tool directory for instance gets served with just pub serve.

jakemac53 commented 8 years ago

see https://github.com/dart-lang/reflectable/issues/17

zoechi commented 8 years ago

I don't think the tool directory for instance gets served with just pub serve.

Right, didn't think of that because despite the warning the app works fine. I guess pub serve just serves the files in tool untranasformed.

jakemac53 commented 8 years ago

interesting, I would have just expected it to not work at all

zoechi commented 8 years ago

I was thinking more about it. pub serve is started by WebStorm and I guess it knows that it has to start pub serve with the tool directory. Then we are back to square one, why does it print this message ;-)

sigmundch commented 8 years ago

Recall that pub serve normally serves a single directory, by default it is just web, but you can make it serve test or other directories by calling pub serve dir. Could it be that WebStorm is starting multiple pub-serve servers? What URL can you use to fetch the code under tool when WebStorm launches pub-serve in web?

zoechi commented 8 years ago

@alexander-doroshko might be able to shed some light. If WebStorm starts pub serve for just one directory, the this would explain the message.

alexander-doroshko commented 8 years ago

WebStorm starts a separate pub serve process for each root folder requested by browser. So if files both from tool and web are queried then WebStorm starts 2 instances of pub serve on different ports. You can see full information in Pub Serve tool window. Note that normally in WebStorm you do not access pub serve directly, so you never have its url and port in browser page address. Instead all requests are made to WebStorm internal web server (default port is 63342) that simply behaves as a proxy for pub serve. For example in Pub Serve tool window you may see that there are 2 instances started: pub serve web --port=65119 pub serve tool --port=56875 In browser you have URLs like this: http://localhost:63342/ProjectName/web/foo.html http://localhost:63342/ProjectName/tool/bar.html WebStorm proxies first request to one instance of pub and the second one - to another. This is transparent to user, user doesn't have to know details about pub serve processes, their ports, etc.

zoechi commented 8 years ago

That explains the message. Thanks @alexander-doroshko.

eernstg commented 8 years ago

Hello all,

the reflectable transformer produces that Info message because it gets invoked with a barback settings object (which tells a transformer how pub was invoked) where an entry point is specified (e.g., 'web/index.dart'), but that entry point is not among the assets offered by pub to the transformer. So we are explicitly asked to work on that file, but it doesn't exist (as seen from the transformer). As Alexander explained, this could be because there are several pub processes, or simply because you have some entry points in 'web', but right now you are running pub build test, so pub doesn't give us access to any of the entry points in 'web'.

We have kept the Info message in place because it seems dangerous to ignore requests for doing something specific ("please transform 'web/index.dart'") if it is not possible to do so. For instance, the problem could be caused by a misspelled entry point name, and that should not be ignored silently. However, we wish to run an alternate test: If we can simply check for the existence of the specified entry point (as a file on disk, not as an asset delivered by pub) then we can suppress the Info message.

For that, we need support from barback (currently we cannot obtain information about the root directory of the package currently being transformed---and it is not the current working directory of the pub process at the OS level---so we cannot check for the existence of a file given as a relative path from there). That's what https://github.com/dart-lang/reflectable/issues/17 is about.

zoechi commented 8 years ago

:+1: thanks for the detailed explanation.

eernstg commented 8 years ago

Hello again,

CL https://codereview.chromium.org/1448333004/ is a new iteration on this issue: It eliminates as many 'Missing entry point' messages as possible (namely the ones where we can verify that the file exists, it just wasn't offered by pub {build,serve} .. to the transformer). It also allows for specifying 'suppressWarnings: missingEntryPoint' to eliminate all messages of that kind, and similarly for other warnings. The CL is included in commit https://github.com/dart-lang/reflectable/commit/2dc5e46ef6aa17daab9240a73f79fd7364c76193.

zoechi commented 8 years ago

great :smiley: