这是indexloc提供的服务,不要输入任何密码
Skip to content

[flutter_tools] Add the NoProfile parameter to the PowerShell execution statement #120786

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

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

WHYBBE
Copy link
Contributor

@WHYBBE WHYBBE commented Feb 15, 2023

Use the NoProfile parameter of pwsh.exe/PowerShell.exe to start PowerShell without a profile to avoid executing the scripts in the user profile

I fixed the issue mentioned by #120785 by adding the NoProfile parameter.

This parameter is mentioned in Microsoft's Powershell documentation: The NoProfile parameter in pwsh or The NoProfile parameter in Powershell.

…on statement

Use the NoProfile parameter of `pwsh.exe`/`PowerShell.exe` to start PowerShell without a profile to avoid executing the scripts in the user profile
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@google-cla
Copy link

google-cla bot commented Feb 15, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@loic-sharma
Copy link
Member

@christopherfujino This change looks good to me and I verified it doesn't break anything on my machine.

Should we get a test exemption for this? We could modify the bots' Powershell profile to print something and then add a devicelab test that verifies the console output of flutter upgrade.

@christopherfujino
Copy link
Contributor

Should we get a test exemption for this? We could modify the bots' Powershell profile to print something and then add a devicelab test that verifies the console output of flutter upgrade.

I wouldn't stop you from doing this, but I would recommend requesting a test exemption, because:

  1. I'm not sure how to automate provisioning all our devicelab bots with a custom profile
  2. I suspect editing that profile may break other things?

@Hixie
Copy link
Contributor

Hixie commented Feb 15, 2023

I could go either way on this. Testing it is the right thing to do in principle, but testing this kind of low-level stuff can end up being more trouble than it's worth, and we already have enough troubles with our testing infrastructure.

I would probably establish a time box of 1 hour, try to write a test, and if it proves more difficult than is reasonably possible to do in one hour, move on without a test.

test-exempt: pragmatism

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM.

With regards to testing, I'd feel a lot better about adding a test if we could do it in a hermetic way (that is, not just editing global profile on the physical machines). Not sure if that's possible, however.

@loic-sharma
Copy link
Member

loic-sharma commented Feb 15, 2023

With regards to testing, I'd feel a lot better about adding a test if we could do it in a hermetic way (that is, not just editing global profile on the physical machines). Not sure if that's possible, however.

I completely agree. Right now the best solution I can think of:

  1. Update the bot's PowerShell profile to source the file pointed by FLUTTER_POWERSHELL_PROFILE_INJECT, if the environment variable is set
  2. Create a new devicelab test that:
    1. For current process & child processes, set FLUTTER_POWERSHELL_PROFILE_INJECT to point to a PowerShell script that prints something
    2. Runs flutter upgrade
    3. Verifies that the injected Powershell script's output isn't present

I suspect this is not a 1 hour job (though feel free to prove me wrong!)

Copy link
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

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

LGTM given the test exemption. I verified this works as expected on my machine

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 15, 2023
@auto-submit auto-submit bot merged commit 1f85497 into flutter:master Feb 15, 2023
@WHYBBE
Copy link
Contributor Author

WHYBBE commented Feb 16, 2023

Thank you for your understanding.😊👍

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 16, 2023
* 3ad7ea3 Roll Plugins from 9c312d4d2f5f to 2ce625f1a87e (5 revisions) (flutter/flutter#120793)

* 7865713 Roll Flutter Engine from 1328c4bc6299 to 4db9673d48d6 (2 revisions) (flutter/flutter#120796)

* 541a8bf Fix switching from scrollable and non-scrollable tab bars throws (flutter/flutter#120771)

* ab1390e Use black30 for CupertinoTabBar's border (flutter/flutter#119509)

* a513d4e Fix `flutter_localizations` README references (flutter/flutter#120800)

* a664f08 In test of --(no-)fatal-infos analyzer flags, pin missing_return to info (flutter/flutter#120797)

* ef49f56 Add Android unit tests to plugin template (flutter/flutter#120720)

* a12e242 Improve CupertinoContextMenu to match native more (flutter/flutter#117698)

* a9f4366 Fix the `flutter run -d linux` tests (flutter/flutter#120721)

* dff0955 09da59a5a Roll Dart SDK from c022d475e9d8 to 5d17a336bdfe (1 revision) (flutter/engine#39649) (flutter/flutter#120816)

* f35de0c Adds wide gamut saveLayer integration test (flutter/flutter#120131)

* 99dcaa2 Roll Flutter Engine from 09da59a5adcf to a8b3d1af55b6 (3 revisions) (flutter/flutter#120821)

* 8d15083 Use the impellerc GLES output flag when compiling shaders for Android (flutter/flutter#120647)

* c6b636f [flutter_tools] Replace Future.catchError() with Future.then(onError: ...) (flutter/flutter#120637)

* 2b7d709 Add `@widgetFactory` annotation (flutter/flutter#117455)

* e65dfba Add Linux unit tests to plugin template (flutter/flutter#120814)

* dccec41 5de007b90 Remove "bringup: true" from "Linux Fuchsia FEMU" (flutter/engine#39651) (flutter/flutter#120826)

* d6de6bc 9f3b061b7 Roll buildroot to 64b0c3deecaff8e66c2deb74e2171e8297b2bfcd (flutter/engine#39653) (flutter/flutter#120830)

* da2508c bb1ff84b6 Add a white background to app anatomy diagram (flutter/engine#39638) (flutter/flutter#120832)

* 1f85497 [flutter_tools] Add the NoProfile parameter to the PowerShell execution statement (flutter/flutter#120786)

* 4ad47fb Fix `StretchingOverscrollIndicator` not handling directional changes correctly (flutter/flutter#116548)

* 9a721c4 Update AndroidManifest.xml.tmpl (flutter/flutter#120527)

* c0b7d2d Roll Flutter Engine from bb1ff84b6c4f to 02a379db1d38 (4 revisions) (flutter/flutter#120845)

* a10e295 Added identical(a,b) short circuit to Material Library lerp methods (flutter/flutter#120829)

* efde350 Roll Flutter Engine from 02a379db1d38 to a966cf878ffd (2 revisions) (flutter/flutter#120846)

* cc473e4 Roll Flutter Engine from a966cf878ffd to 3fc40ca5beb9 (3 revisions) (flutter/flutter#120850)

* d125242 Roll Flutter Engine from 3fc40ca5beb9 to 9fa2a5c3cfbd (2 revisions) (flutter/flutter#120856)

* 22e17bb ea1d087c4 Roll Skia from b8b36146c7a0 to 7b3fb04bc3d4 (3 revisions) (flutter/engine#39673) (flutter/flutter#120860)

* f85438b c8b1d2ffa Roll Fuchsia Mac SDK from YpQKlqmyn8r_snx06... to xl9Y8o-9FDyvPogki... (flutter/engine#39675) (flutter/flutter#120887)

* 174a562 d699b4a91 Roll Flutter from e3471f0 to df41e58 (83 revisions) (flutter/plugins#7184) (flutter/flutter#120888)

* 170539f Roll Flutter Engine from c8b1d2ffaec8 to 0d8d93306822 (2 revisions) (flutter/flutter#120891)
auto-submit bot pushed a commit to flutter/plugins that referenced this pull request Feb 16, 2023
* 3ad7ea3c9 Roll Plugins from 9c312d4 to 2ce625f (5 revisions) (flutter/flutter#120793)

* 786571368 Roll Flutter Engine from 1328c4bc6299 to 4db9673d48d6 (2 revisions) (flutter/flutter#120796)

* 541a8bfd9 Fix switching from scrollable and non-scrollable tab bars throws (flutter/flutter#120771)

* ab1390e0a Use black30 for CupertinoTabBar's border (flutter/flutter#119509)

* a513d4e7b Fix `flutter_localizations` README references (flutter/flutter#120800)

* a664f08a5 In test of --(no-)fatal-infos analyzer flags, pin missing_return to info (flutter/flutter#120797)

* ef49f5661 Add Android unit tests to plugin template (flutter/flutter#120720)

* a12e242c0 Improve CupertinoContextMenu to match native more (flutter/flutter#117698)

* a9f43665c Fix the `flutter run -d linux` tests (flutter/flutter#120721)

* dff09558d 09da59a5a Roll Dart SDK from c022d475e9d8 to 5d17a336bdfe (1 revision) (flutter/engine#39649) (flutter/flutter#120816)

* f35de0c80 Adds wide gamut saveLayer integration test (flutter/flutter#120131)

* 99dcaa2d9 Roll Flutter Engine from 09da59a5adcf to a8b3d1af55b6 (3 revisions) (flutter/flutter#120821)

* 8d150833b Use the impellerc GLES output flag when compiling shaders for Android (flutter/flutter#120647)

* c6b636fa5 [flutter_tools] Replace Future.catchError() with Future.then(onError: ...) (flutter/flutter#120637)

* 2b7d709fd Add `@widgetFactory` annotation (flutter/flutter#117455)

* e65dfba8e Add Linux unit tests to plugin template (flutter/flutter#120814)

* dccec41d5 5de007b90 Remove "bringup: true" from "Linux Fuchsia FEMU" (flutter/engine#39651) (flutter/flutter#120826)

* d6de6bc68 9f3b061b7 Roll buildroot to 64b0c3deecaff8e66c2deb74e2171e8297b2bfcd (flutter/engine#39653) (flutter/flutter#120830)

* da2508c9f bb1ff84b6 Add a white background to app anatomy diagram (flutter/engine#39638) (flutter/flutter#120832)

* 1f85497ef [flutter_tools] Add the NoProfile parameter to the PowerShell execution statement (flutter/flutter#120786)

* 4ad47fb47 Fix `StretchingOverscrollIndicator` not handling directional changes correctly (flutter/flutter#116548)

* 9a721c456 Update AndroidManifest.xml.tmpl (flutter/flutter#120527)

* c0b7d2ddd Roll Flutter Engine from bb1ff84b6c4f to 02a379db1d38 (4 revisions) (flutter/flutter#120845)

* a10e295a0 Added identical(a,b) short circuit to Material Library lerp methods (flutter/flutter#120829)

* efde35081 Roll Flutter Engine from 02a379db1d38 to a966cf878ffd (2 revisions) (flutter/flutter#120846)

* cc473e4f1 Roll Flutter Engine from a966cf878ffd to 3fc40ca5beb9 (3 revisions) (flutter/flutter#120850)

* d1252428c Roll Flutter Engine from 3fc40ca5beb9 to 9fa2a5c3cfbd (2 revisions) (flutter/flutter#120856)

* 22e17bb71 ea1d087c4 Roll Skia from b8b36146c7a0 to 7b3fb04bc3d4 (3 revisions) (flutter/engine#39673) (flutter/flutter#120860)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
waegari pushed a commit to waegari/flutter_plugins that referenced this pull request Jul 3, 2025
…r#7186)

* 3ad7ea3c9 Roll Plugins from 9c312d4 to 2ce625f (5 revisions) (flutter/flutter#120793)

* 786571368 Roll Flutter Engine from 1328c4bc6299 to 4db9673d48d6 (2 revisions) (flutter/flutter#120796)

* 541a8bfd9 Fix switching from scrollable and non-scrollable tab bars throws (flutter/flutter#120771)

* ab1390e0a Use black30 for CupertinoTabBar's border (flutter/flutter#119509)

* a513d4e7b Fix `flutter_localizations` README references (flutter/flutter#120800)

* a664f08a5 In test of --(no-)fatal-infos analyzer flags, pin missing_return to info (flutter/flutter#120797)

* ef49f5661 Add Android unit tests to plugin template (flutter/flutter#120720)

* a12e242c0 Improve CupertinoContextMenu to match native more (flutter/flutter#117698)

* a9f43665c Fix the `flutter run -d linux` tests (flutter/flutter#120721)

* dff09558d 09da59a5a Roll Dart SDK from c022d475e9d8 to 5d17a336bdfe (1 revision) (flutter/engine#39649) (flutter/flutter#120816)

* f35de0c80 Adds wide gamut saveLayer integration test (flutter/flutter#120131)

* 99dcaa2d9 Roll Flutter Engine from 09da59a5adcf to a8b3d1af55b6 (3 revisions) (flutter/flutter#120821)

* 8d150833b Use the impellerc GLES output flag when compiling shaders for Android (flutter/flutter#120647)

* c6b636fa5 [flutter_tools] Replace Future.catchError() with Future.then(onError: ...) (flutter/flutter#120637)

* 2b7d709fd Add `@widgetFactory` annotation (flutter/flutter#117455)

* e65dfba8e Add Linux unit tests to plugin template (flutter/flutter#120814)

* dccec41d5 5de007b90 Remove "bringup: true" from "Linux Fuchsia FEMU" (flutter/engine#39651) (flutter/flutter#120826)

* d6de6bc68 9f3b061b7 Roll buildroot to 64b0c3deecaff8e66c2deb74e2171e8297b2bfcd (flutter/engine#39653) (flutter/flutter#120830)

* da2508c9f bb1ff84b6 Add a white background to app anatomy diagram (flutter/engine#39638) (flutter/flutter#120832)

* 1f85497ef [flutter_tools] Add the NoProfile parameter to the PowerShell execution statement (flutter/flutter#120786)

* 4ad47fb47 Fix `StretchingOverscrollIndicator` not handling directional changes correctly (flutter/flutter#116548)

* 9a721c456 Update AndroidManifest.xml.tmpl (flutter/flutter#120527)

* c0b7d2ddd Roll Flutter Engine from bb1ff84b6c4f to 02a379db1d38 (4 revisions) (flutter/flutter#120845)

* a10e295a0 Added identical(a,b) short circuit to Material Library lerp methods (flutter/flutter#120829)

* efde35081 Roll Flutter Engine from 02a379db1d38 to a966cf878ffd (2 revisions) (flutter/flutter#120846)

* cc473e4f1 Roll Flutter Engine from a966cf878ffd to 3fc40ca5beb9 (3 revisions) (flutter/flutter#120850)

* d1252428c Roll Flutter Engine from 3fc40ca5beb9 to 9fa2a5c3cfbd (2 revisions) (flutter/flutter#120856)

* 22e17bb71 ea1d087c4 Roll Skia from b8b36146c7a0 to 7b3fb04bc3d4 (3 revisions) (flutter/engine#39673) (flutter/flutter#120860)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants