Open btrautmann opened 3 weeks ago
Summary: The user reports that dart pub global activate --source="path"
no longer updates activated executables when the executable's logic is changed. Deleting the .dart_tool/pub/bin/<executable>
directory before activating the executable again resolves the issue.
Summary: The user reports that
dart pub global activate --source="path"
no longer updates activated executables when the executable's logic is changed. Deleting the.dart_tool/pub/bin/<executable>
directory before activating the executable again resolves the issue.
Good bot
@bkonyi can you LMK if this fell through the cracks? This is a pretty annoying bug to run into, particularly in cases like self-hosted github actions runners where state is not wiped between runs and so implementation hangs around until you remember this is a thing. I imagine there are others scratching their heads as to why pub global activate
is not working. 👀
Yeah, I'm not sure if the pub team is subscribed to the dart-cli-pub
label, so I'll just cc @sigurdm and @jonasfj to make sure they're aware.
Yeah - this is a bug. We are using snapshots, but we don't get to invalidate them (as dart run does).
Perhaps best would be to have the binstub for a path-activated package just call dart path/to/package/bin/executable.dart
instead of precompiling.
Alternatively the binstub needs to recompile (like we do in dart run
).
Yeah - this is a bug. We are using snapshots, but we don't get to invalidate them (as dart run does).
Just curious: This at one point did work the way I expected; did something change?
A bisect shows it was introduced by a3ee209988af39c1d4f3c67b4910c317047356ca #3586
I can see that the claim "Always generate the full logic in the binstub (it will check for snapshot presence anyways)" is missing the point. There is no check if the code is updated relative to the snapshot.
Sorry about that. We should probably revert to having the binstubs just invoke dart global run <dart-file>.dart
instead of trying to use a snapshot.
The Issue
I started noticing a few weeks ago that
dart pub global activate --source="path" <path>
stopped working. To reproduce, you can:dart create -t console <name>
pubspec.yaml
dart pub global activate --source="path" <path/to/root/of/project>
name
and note resultdart create -t console
default project, updatecalculate()
to return a different integer)..dart_tool/pub/bin/<name>
directoryHere is a sample repo you can clone and use to do the above.
Expected results
Prior to this bug, re-running
dart pub global activate --source="path"
would correctly update the activated executable such that the new logic would be respected.