Skip to content

Conversation

sigurdm
Copy link
Contributor

@sigurdm sigurdm commented Mar 12, 2024

This means the fast path (relying on modified timestamps) doesn't have to load pubspec.yaml.

dart run still uses the package-graph to deciding if a package is "mutable" so the real savings will not manifest yet.

This is a follow up to #4160 preparation for the `Update the ensureUptodate procedure to handle workspaces part of #4127

Comment on lines 97 to 100
$ pub run -C myapp 'bin/app.dart'
Resolving dependencies in myapp...
Got dependencies in myapp.
Resolving dependencies in myapp...
Got dependencies in myapp.
Building package executable...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we fixing something here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - pub run would in some cases end up doing double resolution

Comment on lines 146 to 147
Resolving dependencies in myapp...
Got dependencies in myapp.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we duplicating here?

Comment on lines 14 to 15
/// The path where the package_config.json file is stored.
final String path;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is orthogonal right?

I don't think I mind, but aren't we going to regret this at some point.

I guess a package_config.json needs to exist relative to some folder, otherwise we can't resolve relative paths.

Probably we should state that relative paths must always be resolved relative to path.

We could also consider calling it location? or?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah .. a bit iffy...

If Executable.resolve is to work without knowing the entrypoint, then we need to store the path to the package_config file somewhere else. And as you say - it contains relative uris.

Maybe we should just pass it to Executable.resolve... trying that.

Future<void> runProtected() async {
// Explicitly run this in the directory in case
// we don't access `entrypoint.packageGraph`.
await entrypoint.ensureUpToDate();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually always access entrypoint.packageGraph below

if (argResults.wasParsed('style')) {
usageException('Cannot combine --json and --style.');
}
await entrypoint.ensureUpToDate();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and for sure doing this twice was just ... not helpful!

Comment on lines 97 to 100
$ pub run -C myapp 'bin/app.dart'
Resolving dependencies in myapp...
Got dependencies in myapp.
Resolving dependencies in myapp...
Got dependencies in myapp.
Building package executable...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - pub run would in some cases end up doing double resolution

Comment on lines 14 to 15
/// The path where the package_config.json file is stored.
final String path;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah .. a bit iffy...

If Executable.resolve is to work without knowing the entrypoint, then we need to store the path to the package_config file somewhere else. And as you say - it contains relative uris.

Maybe we should just pass it to Executable.resolve... trying that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants