Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactoring to use ver command instead of systeminfo #119304

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 6 commits into from
Jan 30, 2023

Conversation

eliasyishak
Copy link
Contributor

@eliasyishak eliasyishak commented Jan 27, 2023

As discussed in #119284, this PR aims to do away with the systeminfo process call and use the name getter from the _WindowsUtils class and pattern match on that

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 27, 2023
@eliasyishak
Copy link
Contributor Author

@steniooliv if you have the time, can you check that this patch passes in your locale?

@eliasyishak eliasyishak self-assigned this Jan 27, 2023
@steniooliv
Copy link

steniooliv commented Jan 27, 2023

@steniooliv if you have the time, can you check that this patch passes in your locale?

here there was an error:

❯ flutter doctor -v
[!] Flutter (Channel master, 3.7.0-28.0.pre.69, on Microsoft Windows [versÆo
    10.0.22621.1105], locale pt-BR)
    • Flutter version 3.7.0-28.0.pre.69 on channel master at C:\www\flutter-test
    ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.
      Set environment variable "FLUTTER_GIT_URL" to
      https://github.com/eliasyishak/flutter.git to dismiss this error.
    • Framework revision d8d72018d2 (2 hours ago), 2023-01-26 18:08:21 -0500
    • Engine revision d17004dd96
    • Dart version 3.0.0 (build 3.0.0-170.0.dev)
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[✗] Windows Version (Unable to confirm if installed Windows version is 10 or
    greater)

when i run ver in windows prompt command:

Microsoft Windows [versão 10.0.22621.1105]

@diegobenincasa
Copy link

Please take a look at my solution at #117890 . I've made the adjustments to use verinstead of systeminfo. It's a lot faster than systeminfo and, most important, works (at least for me).

@eliasyishak
Copy link
Contributor Author

@steniooliv if you have the time, can you check that this patch passes in your locale?

here there was an error:

❯ flutter doctor -v
[!] Flutter (Channel master, 3.7.0-28.0.pre.69, on Microsoft Windows [versÆo
    10.0.22621.1105], locale pt-BR)
    • Flutter version 3.7.0-28.0.pre.69 on channel master at C:\www\flutter-test
    ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.
      Set environment variable "FLUTTER_GIT_URL" to
      https://github.com/eliasyishak/flutter.git to dismiss this error.
    • Framework revision d8d72018d2 (2 hours ago), 2023-01-26 18:08:21 -0500
    • Engine revision d17004dd96
    • Dart version 3.0.0 (build 3.0.0-170.0.dev)
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[✗] Windows Version (Unable to confirm if installed Windows version is 10 or
    greater)

when i run ver in windows prompt command:

Microsoft Windows [versão 10.0.22621.1105]

Did you make sure to delete the cache before? Or instead of running the flutter binary, you can run dart <path_to_flutter>/flutter/packages/flutter_tools/lib/executable.dart doctor. This will confirm you are running from the source. I did this and it worked when I changed my locale

@eliasyishak eliasyishak marked this pull request as ready for review January 27, 2023 13:03
@steniooliv
Copy link

steniooliv commented Jan 27, 2023

@steniooliv if you have the time, can you check that this patch passes in your locale?

here there was an error:

❯ flutter doctor -v
[!] Flutter (Channel master, 3.7.0-28.0.pre.69, on Microsoft Windows [versÆo
    10.0.22621.1105], locale pt-BR)
    • Flutter version 3.7.0-28.0.pre.69 on channel master at C:\www\flutter-test
    ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.
      Set environment variable "FLUTTER_GIT_URL" to
      https://github.com/eliasyishak/flutter.git to dismiss this error.
    • Framework revision d8d72018d2 (2 hours ago), 2023-01-26 18:08:21 -0500
    • Engine revision d17004dd96
    • Dart version 3.0.0 (build 3.0.0-170.0.dev)
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[✗] Windows Version (Unable to confirm if installed Windows version is 10 or
    greater)

when i run ver in windows prompt command:

Microsoft Windows [versão 10.0.22621.1105]

Did you make sure to delete the cache before? Or instead of running the flutter binary, you can run dart <path_to_flutter>/flutter/packages/flutter_tools/lib/executable.dart doctor. This will confirm you are running from the source. I did this and it worked when I changed my locale

Sorry for the delay in answering, I deleted my current flutter folder, downloaded your version, and set it as default, after that I ran flutter doctor end show this in console:

Stenio in ~
❯ flutter doctor
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine ...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...
Downloading Material fonts...                                      718ms
Downloading Gradle Wrapper...                                       40ms
Downloading package sky_engine...                                  384ms
Downloading flutter_patched_sdk tools...                           400ms
Downloading flutter_patched_sdk_product tools...                   334ms
Downloading windows-x64 tools...                                 1.860ms
Downloading windows-x64/font-subset tools...                       309ms
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel master, 3.7.0-28.0.pre.69, on Microsoft Windows [versÆo
    10.0.22621.1105], locale pt-BR)
    ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.
      Set environment variable "FLUTTER_GIT_URL" to
      https://github.com/eliasyishak/flutter.git to dismiss this error.
[✗] Windows Version (Unable to confirm if installed Windows version is 10 or
    greater)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)[✓] Chrome - develop for the web
[✗] Visual Studio - develop for Windows
    ✗ Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all
      of its default components
[✓] Android Studio (version 2020.3)
[✓] VS Code, 64-bit edition (version 1.74.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 3 categories.

I check, and your branch is update here

Stenio in flutter on   master
❯ git pull
Already up to date.
❯

@eliasyishak
Copy link
Contributor Author

@steniooliv have you also confirmed that you're on the right branch? If you're on the master branch on my fork, you won't have the updated code

@steniooliv
Copy link

@steniooliv have you also confirmed that you're on the right branch? If you're on the master branch on my fork, you won't have the updated code

Yes, in flutter doctor you can see your branch

@christopherfujino
Copy link
Contributor

Yes, in flutter doctor you can see your branch

I see master in the output you shared:

Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel master, 3.7.0-28.0.pre.69, on Microsoft Windows [versÆo
10.0.22621.1105], locale pt-BR)

@steniooliv
Copy link

steniooliv commented Jan 27, 2023

! Upstream repository https://github.com/eliasyishak/flutter.git is not a
standard remote.

right below

 ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.

I deleted cache folder, and try again (same error):

❯ flutter doctor
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine ...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...
Downloading Material fonts...                                      628ms
Downloading Gradle Wrapper...                                       33ms
Downloading package sky_engine...                                  151ms
Downloading flutter_patched_sdk tools...                           344ms
Downloading flutter_patched_sdk_product tools...                   240ms
Downloading windows-x64 tools...                                 1.984ms
Downloading windows-x64/font-subset tools...                        77ms
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel master, 3.7.0-28.0.pre.69, on Microsoft Windows [versÆo
    10.0.22621.1105], locale pt-BR)
    ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.
      Set environment variable "FLUTTER_GIT_URL" to
      https://github.com/eliasyishak/flutter.git to dismiss this error.
[✗] Windows Version (Unable to confirm if installed Windows version is 10 or
    greater)

@christopherfujino
Copy link
Contributor

! Upstream repository https://github.com/eliasyishak/flutter.git is not a
standard remote.

right below

 ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.

You have the correct remote, but not the correct branch.

@steniooliv
Copy link

! Upstream repository https://github.com/eliasyishak/flutter.git is not a
standard remote.

right below

 ! Upstream repository https://github.com/eliasyishak/flutter.git is not a
      standard remote.

You have the correct remote, but not the correct branch.

oh my, changes isn't in master fork, i change to issue-119284, it's ok

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel issue-119284, 3.7.0-28.0.pre.20, on Microsoft Windows
    [versÆo 10.0.22621.1105], locale pt-BR)
[✓] Windows Version (Installed version of Windows is version 10 or higher)

reason: 'There should be only two matches for the pattern provided',
);
expect(matches.length, 5,
reason: 'There should be only ${matches.length} matches for the pattern provided');
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this the other way, that we're checking for the constant number, not the actual?

Also, did the number change from 3 to 5 because our regex pattern should have been matching 5 of these lines all along?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, I made a mistake with the reason text by interpolating, it should be hard coded to be 5 matches. And the number changed from 3 to 5 because one, other contributors added lines that were valid with our previous regex pattern and two, we have a different regex pattern now that only looks for valid semvar formatting. And in the testStr, we have 5 valid semvar lines that match our pattern.

Previously, we used to look for OS Version: ... at the beginning of the line because that was how systeminfo stdout was formatted. With ver, it has become simpler.

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

@eliasyishak eliasyishak added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2023
@auto-submit auto-submit bot merged commit 458b298 into flutter:master Jan 30, 2023
@eliasyishak eliasyishak deleted the issue-119284 branch January 30, 2023 19:30
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 1, 2023
auto-submit bot pushed a commit to flutter/plugins that referenced this pull request Feb 1, 2023
* 472b887 0ec8e2802 Roll Fuchsia Mac SDK from 9y7C2oamTv6Py4JSC... to EAFnGijD0l5QxaPxF... (flutter/engine#39236) (flutter/flutter#119461)

* 15cd00f a7bb0e410 Roll Fuchsia Linux SDK from 1D63BqURfJdG4r3CK... to xTXbcsPr5GJvFSLha... (flutter/engine#39238) (flutter/flutter#119482)

* 530c3f2 [Re-land#2] Button padding M3 (flutter/flutter#119498)

* 17eb2e8 Ability to disable the browser's context menu on web (flutter/flutter#118194)

* df8ad3d roll packages (flutter/flutter#119370)

* b68cebd roll packages (flutter/flutter#119530)

* 59d80dc [Android] Add explicit exported tag to Linux_android flavors test (flutter/flutter#117542)

* 458b298 Refactoring to use `ver` command instead of `systeminfo` (flutter/flutter#119304)

* 54405bf fixes PointerEventConverter to handle malformed scrolling event (flutter/flutter#118124)

* e69ea6d Support flipping mouse scrolling axes through modifier keys (flutter/flutter#115610)

* 92df6b4 396c7fd0b Reland "Remove references to Observatory (#38919)" (flutter/engine#39139) (flutter/flutter#119546)

* 7477d7a Reland "Add --serve-observatory flag to run, attach, and test (#118402)" (flutter/flutter#119529)

* 6c12e39 Introduce ParagraphBoundary subclass for text editing (flutter/flutter#116549)

* b227df3 Hint text semantics to be excluded in a11y read out if hintText is not visible. (flutter/flutter#119198)

* 18c7f8a Fix typo in --machine help text (flutter/flutter#119563)

* 329f86a Make a few values non-nullable in cupertino (flutter/flutter#119478)

* c4520bc b2efe0175 [web] Expose felt flag for building CanvasKit Chromium (flutter/engine#39201) (flutter/flutter#119567)

* 8898f4f Marks Mac_android run_debug_test_android to be unflaky (flutter/flutter#117468)

* 1f0b6fb Remove deprecated AppBar/SliverAppBar/AppBarTheme.textTheme member (flutter/flutter#119253)

* edaeec8 Roll Flutter Engine from b2efe01754ef to 5011144c0b46 (3 revisions) (flutter/flutter#119578)

* 865dc5c Roll Flutter Engine from 5011144c0b46 to daa8eeb7fc0b (2 revisions) (flutter/flutter#119584)

* 1148a2a Migrate EditableTextState from addPostFrameCallbacks to compositionCallbacks (flutter/flutter#119359)

* 2340902 Roll Flutter Engine from daa8eeb7fc0b to 77218818138f (3 revisions) (flutter/flutter#119586)

* 65900b7 Remove deprecated AnimatedSize.vsync parameter (flutter/flutter#119186)

* 5b6572f Add debug diagnostics to channels integration test (flutter/flutter#119579)

* 504e565 Roll Flutter Engine from 77218818138f to 9448f2966c11 (3 revisions) (flutter/flutter#119592)

* 7ba4406 Revert "[Re-land#2] Button padding M3 (#119498)" (flutter/flutter#119597)

* 2c34a88 Roll Flutter Engine from 9448f2966c11 to 72abe0e4b828 (3 revisions) (flutter/flutter#119603)

* df0ab40 Roll Plugins from ff84c44 to 9da327c (15 revisions) (flutter/flutter#119629)

* 67d07a6 [flutter_tools] Fix parsing of existing DDS URIs from exceptions (flutter/flutter#119506)

* d272a3a Reland: [macos] add flavor options to tool commands (flutter/flutter#119564)

* a16d82c aa00da3c1 Roll Skia from fc31f43cc40a to 3c6eb76a683a (1 revision) (flutter/engine#39280) (flutter/flutter#119605)

* f6b0c6d Use first Dart VM Service found with mDNS if there are duplicates (flutter/flutter#119545)

* d4c7485 Make Decoration.padding non-nullable (flutter/flutter#119581)

* 2fccf4d Remove MediaQuery from WidgetsApp (flutter/flutter#119377)

* 9b3b9cf Roll Flutter Engine from aa00da3c1612 to cd2e8885e491 (6 revisions) (flutter/flutter#119639)

* 6a54059 Make MultiChildRenderObjectWidget const (flutter/flutter#119195)

* e2b3d89 Fix CupertinoNavigationBar should create a backward compatible Annota… (flutter/flutter#119515)

* 7bf95f4 1aaf3db31 Roll Dart SDK from 4fdbc7c28141 to 9bcc1773ebf0 (1 revision) (flutter/engine#39290) (flutter/flutter#119640)

* 0e22aca Add support for image insertion on Android (flutter/flutter#110052)

* ff22813 separatorBuilder can't return null (flutter/flutter#119566)

* 60c1f29 2471f430f Update buildroot to c02da5072d1bb2. (flutter/engine#39292) (flutter/flutter#119645)

* fbe9ff3 Disable an inaccurate test assertion that will be fixed by an engine roll (flutter/flutter#119653)

* 8f90e2a Roll Flutter Engine from 2471f430ff4b to bb7b7006f4a3 (2 revisions) (flutter/flutter#119655)

* 3884381 Make gen-l10n error handling independent of logger state (flutter/flutter#119644)

* 198a51a Migrate the Material Date pickers to M3 Reprise (flutter/flutter#119033)

* dc86565 Roll Flutter Engine from bb7b7006f4a3 to 521b975449ba (4 revisions) (flutter/flutter#119670)

* 82df235 Undo making Flex,Row,Column const (flutter/flutter#119669)

* 6f9a896 Roll Flutter Engine from 521b975449ba to 38913c5484cf (2 revisions) (flutter/flutter#119675)

* 8d0af36 🥅 Produce warning instead of error for storage base url overrides (flutter/flutter#119595)

* 3894d24 1703a3966 Roll Skia from c29211525dac to 654f4805e8b8 (21 revisions) (flutter/engine#39309) (flutter/flutter#119683)

* a752c2f Expose enableIMEPersonalizedLearning on CupertinoSearchTextField (flutter/flutter#119439)

* e1f0b1d d92e23cb5 Roll Skia from 654f4805e8b8 to da41cf18f651 (1 revision) (flutter/engine#39311) (flutter/flutter#119686)

* 97d273c CupertinoThemeData equality (flutter/flutter#119480)

* 4167835 5b549950f Roll Fuchsia Linux SDK from 71lEeibIyrq0V8jId... to TFcelQ5SwrzkcYK2d... (flutter/engine#39312) (flutter/flutter#119688)

* b4a6e34 0d87b1562 Roll Dart SDK from 8b57d23a7246 to de03e1f41b50 (1 revision) (flutter/engine#39313) (flutter/flutter#119695)

* 3af30ff Roll Flutter Engine from 0d87b156265c to c08a286d60e9 (3 revisions) (flutter/flutter#119706)

* d278808 [Re-land] Exposed tooltip longPress (flutter/flutter#118796)
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 tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FIXED IN MASTER CHANNEL] flutter doctor - [X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)
4 participants