-
Notifications
You must be signed in to change notification settings - Fork 705
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
The PUB_CACHE have moved. #4882
Conversation
This migration started in Dart 2.8.0, since then we've used the old location of the PUB_CACHE if it already existed at that location. But users who have started using Dart since 2.8.0 should be unaffected as we started creating the PUB_CACHE in the new location, when no PUB_CACHE was present anywhere.
a498d35
to
5b83f5d
Compare
f4af388
to
7400fea
Compare
src/resources/dart-3-migration.md
Outdated
* Ending backwards compatibility for the old location of pub-cache on Windows. | ||
Prior to Dart 3 `%APPDATA%\Pub\Cache` was a fallback location for pub-cache. | ||
As of Dart 3, the default pub-cache is always `%LOCALAPPDATA%\Pub\Cache`. | ||
If you have added globally activated packages to your `PATH`, you may wish | ||
to update `PATH` to contain `%LOCALAPPDATA%\Pub\Cache\bin`. |
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.
suggestion: Clean up for length, clarity, and active voice.
* Ending backwards compatibility for the old location of pub-cache on Windows. | |
Prior to Dart 3 `%APPDATA%\Pub\Cache` was a fallback location for pub-cache. | |
As of Dart 3, the default pub-cache is always `%LOCALAPPDATA%\Pub\Cache`. | |
If you have added globally activated packages to your `PATH`, you may wish | |
to update `PATH` to contain `%LOCALAPPDATA%\Pub\Cache\bin`. | |
* Ending backwards compatibility for the old location of pub-cache on Windows. | |
Prior to Dart 3, `%APPDATA%\Pub\Cache` was a fallback location for pub-cache. | |
Starting with Dart 3, the default pub-cache is located at `%LOCALAPPDATA%\Pub\Cache`. | |
If you [added a package][] to your `PATH` as a command line app, | |
to update `PATH` to contain `%LOCALAPPDATA%\Pub\Cache\bin`. | |
[added a package]: /tools/pub/cmd/pub-global |
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.
If you [added a package][] to your `PATH` as a command line app,
to update `PATH` to contain `%LOCALAPPDATA%\Pub\Cache\bin`.
You can do dart pub global activate <package>
.
If the <package>
being activated contains and executable
section in pubspec.yaml
, then executable files will be created in $PUB_CACHE/bin
.
Thus, if you do dart pub global activate mono_repo
you can execute: $PUB_CACHE/bin/mono_repo
.
But the executable mono_repo
is only available on PATH
if you've added $PUB_CACHE/bin
to PATH
.
So I wouldn't really say that "you have added a package to your PATH".
What you did was:
- (a) Globally activate one or more packages (which contains an
executable
section). - (b) Added
$PUB_CACHE/bin
toPATH
.
We're trying to suggest that if you did (b), then action may be warranted.
"you have added a package to your PATH"
Implies to me that there was some action you did that added a package to PATH.
I suggest using the term "added globally activated packages to PATH" because it might remind the user of that time they modified PATH
in order to get globally activated packages working without having to type dart pub global run <package>
.
Note. I figured that referring to "globally activated packages", because it's usually dart pub global activate <package>
that will be print a notice suggesting you update your PATH
by adding ...\path\to\pub-cache\bin
to PATH
.
We could also change the line to:
If you previously added
path\to\pub-cache\bin
toPATH
you may wish to updatePATH
to contain%LOCALAPPDATA%\Pub\Cache\bin
.
Intentionally, avoiding to use the qualifier "If you previously added %APPDATA\Pub\Cache\bin
", because while doing so might work, it's quite likely that users actually added the absolute path (e.g. c:\path\to\pub-cache\bin
) to PATH
.
I think it's viable to argue that path\to\pub-cache\bin
can be a stand-in for both:
%APPDATA\Pub\Cache\bin
, and,c:\path\to\pub-cache\bin
.
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.
If you [added a package][] to your
PATH
as a command line app,
to updatePATH
to contain%LOCALAPPDATA%\Pub\Cache\bin
.
I don't think "added a package to your PATH" is a good description of what might have happened.
You can't add a package, only the executables declared within a package. This happens when you globally activate a package.
But the action that is concerning is "adding globally activated packages to PATH".
Which is really a shorter variant of "adding all executables from globally activated packages to PATH".
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.
@jonasfj : A small update. I'll approve once fixed.
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.
Changed issue to suggestion. LGTM % suggestion.
Let's ship this, the goal was the help Dart 3 migration -- and we shipped Dart 3 a while ago 🤣 |
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.
Thanks!
Context: dart-lang/sdk#52386 --------- Co-authored-by: Anthony Sansone <[email protected]> Co-authored-by: Parker Lougheed <[email protected]>
Context: dart-lang/sdk#52386