-
Notifications
You must be signed in to change notification settings - Fork 68
[hooks_runner] Don't report immutable Dart sources as dependencies #2296
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
Conversation
ce1b9cc
to
a76fa11
Compare
ef80619
to
7bc2b16
Compare
PR HealthAPI leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
2 similar comments
PR HealthAPI leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
PR HealthAPI leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
7bc2b16
to
2204c18
Compare
// TODO(https://github.com/dart-lang/pub/issues/4577): Use immutability bit | ||
// when available. | ||
static bool _isImmutable(Uri e) => | ||
e.toFilePath(windows: false).contains('/hosted/pub.dev/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we store the pub cache in package_config.json.
You could check if that is a prefix of the package path.
But remember that a cached package potentially can depend on a path-dependency, and thus be mutable. Perhaps you need to calculate the transitive dependency closure via package_graph.json...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We get all Dart sources in a list, and I'm just filtering out the ones in the pub cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right - what I'm saying is that your filter is imprecise (having false positives). You don't want lib/src/hosted/pub.dev/my_file.dart
to be assumed immutable.
Rather you could look up package_config.json['pubCache']
And see if the file is p.within
that url.
Closes: #2290
Shaves 50ms off a fully cached
flutter build
forflutter create --template package_ffi
's example project. (See #2290.)