pingbird / puro

A powerful tool for installing and upgrading Flutter versions.
https://puro.dev
Other
247 stars 12 forks source link

crashes in vscode project #6

Closed RandalSchwartz closed 7 months ago

RandalSchwartz commented 1 year ago

in response to puro use stable in a vscode project:

[E] Exception while installing IntelliJ config
[E] Unsupported operation: Cannot extract a non-Windows file path from a file URI with an authority
    #0      _Uri._toFilePath (dart:core/uri.dart:2859)
    #1      _Uri.toFilePath (dart:core/uri.dart:2854)
    #2      IntelliJConfig.load (package:puro/src/workspace/intellij.dart:288)
    #3      installIdeConfigs.<anonymous closure> (package:puro/src/workspace/install.dart:28)
    #4      runOptional (package:puro/src/logger.dart:139)
    #5      installIdeConfigs (package:puro/src/workspace/install.dart:24)
    #6      installWorkspaceEnvironment.<anonymous closure> (package:puro/src/workspace/install.dart:107)
    #7      runOptional (package:puro/src/logger.dart:139)
    #8      installWorkspaceEnvironment (package:puro/src/workspace/install.dart:104)
    <asynchronous suspension>
    #9      switchEnvironment (package:puro/src/workspace/install.dart:133)
    <asynchronous suspension>
    #10     EnvUseCommand.run (package:puro/src/commands/env_use.dart:69)
    <asynchronous suspension>
    #11     CommandRunner.runCommand (package:args/command_runner.dart:212)
    <asynchronous suspension>
    #12     main (package:puro/src/cli.dart:224)
    <asynchronous suspension>

[✓] Switched to environment `stable`
pingbird commented 1 year ago

Is this happening on 1.2.0? If so, post the result of the command with --log-level=4

RandalSchwartz commented 1 year ago

Haven't seen it since upgrade.

pingbird commented 1 year ago

It was probably fixed then, thanks!

Jethro87 commented 1 year ago

@pingbird I'm getting the same error in puro 1.3.5 in VS code.

[E] Exception while installing IntelliJ config
[E] Unsupported operation: Cannot extract a non-Windows file path from a file URI with an authority
    #0      _Uri._toFilePath (dart:core/uri.dart:2862)
    #1      _Uri.toFilePath (dart:core/uri.dart:2857)
    #2      IntelliJConfig.load (package:puro/src/workspace/intellij.dart:290)
    #3      installIdeConfigs.<anonymous closure> (package:puro/src/workspace/install.dart:28)
    #4      runOptional (package:puro/src/logger.dart:173)
    #5      installIdeConfigs (package:puro/src/workspace/install.dart:24)
    #6      installWorkspaceEnvironment.<anonymous closure> (package:puro/src/workspace/install.dart:107)
    #7      runOptional (package:puro/src/logger.dart:173)
    #8      installWorkspaceEnvironment (package:puro/src/workspace/install.dart:104)
    <asynchronous suspension>
    #9      switchEnvironment (package:puro/src/workspace/install.dart:133)
    <asynchronous suspension>
    #10     EnvUseCommand.run (package:puro/src/commands/env_use.dart:83)
    <asynchronous suspension>
    #11     CommandRunner.runCommand (package:args/command_runner.dart:212)
    <asynchronous suspension>
    #12     main (package:puro/src/cli.dart:234)
    <asynchronous suspension>

[✓] Switched to environment `stable`

It also didn't create the puro.json file.

pingbird commented 1 year ago

@Jethro87 please post the output of puro use stable --log-level=4

Jethro87 commented 1 year ago

@pingbird Looks like the puro.json file was written, but the error is still there.

[D] PURO_FLUTTER_BIN: null
[D] Config: PuroConfig(
      gitExecutable: LocalFile: 'git',
      puroRoot: LocalDirectory: '/Users/jeffreybunn/.puro',
      pubCacheDir: LocalDirectory: '/Users/jeffreybunn/.puro/shared/pub_cache',
      homeDir: LocalDirectory: '/Users/jeffreybunn',
      projectDir: LocalDirectory: '/Users/jeffreybunn/Documents/Code/clearful/mobile',
      parentProjectDir: LocalDirectory: '/Users/jeffreybunn/Documents/Code/clearful/mobile',
      flutterGitUrl: https://github.com/flutter/flutter.git,
      engineGitUrl: https://github.com/flutter/engine.git,
      releasesJsonUrl: https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json,
      flutterStorageBaseUrl: https://storage.googleapis.com,
      environmentOverride: null,
      puroBuildsUrl: https://puro.dev/builds,
      buildTarget: PuroBuildTarget.macosX64,
      enableShims: false,
    )
[D] > ps -o %P
    %c -p 58225
[D] ps finished in 17ms
[V] ps: %cpu %mem acflag acflg args blocked caught comm command cpu cputime etime f
    flags gid group ignored inblk inblock jobc ktrace ktracep lim login logname
    lstart majflt minflt msgrcv msgsnd ni nice nivcsw nsignals nsigs nswap nvcsw
    nwchan oublk oublock p_ru paddr pagein pcpu pending pgid pid pmem ppid pri
    prsna pstime putime re rgid rgroup rss ruid ruser sess sig sigmask sl start
    stat state stime svgid svuid tdev time tpgid tsess tsiz tt tty ucomm uid upr
    user usrpri utime vsize vsz wchan wq wqb wql wqr xstat

[V] ps: ps: %P: keyword not found
    ps: %c: keyword not found
    ps: no valid keywords; valid keywords:

[V] ps subprocess failed with exit code 1
[D] []
[D] Writing dotfile /Users/jeffreybunn/Documents/Code/clearful/mobile/.puro.json
    {
      "env": "stable",
      "previousFlutterSdk": ".fvm/flutter_sdk"
    }
[V] Updating gitignore...
[V] Installing IDE configs...
[D] vscode override: null
[D] intellij override: null
[V] Installing IntelliJ config...
[V] intellij workspaceDir: LocalDirectory: '/Users/jeffreybunn/Documents/Code/clearful/mobile'
[E] Exception while installing IntelliJ config
[E] Unsupported operation: Cannot extract a non-Windows file path from a file URI with an authority
    #0      _Uri._toFilePath (dart:core/uri.dart:2862)
    #1      _Uri.toFilePath (dart:core/uri.dart:2857)
    #2      IntelliJConfig.load (package:puro/src/workspace/intellij.dart:290)
    #3      installIdeConfigs.<anonymous closure> (package:puro/src/workspace/install.dart:28)
    #4      runOptional (package:puro/src/logger.dart:173)
    #5      installIdeConfigs (package:puro/src/workspace/install.dart:24)
    #6      installWorkspaceEnvironment.<anonymous closure> (package:puro/src/workspace/install.dart:107)
    #7      runOptional (package:puro/src/logger.dart:173)
    #8      installWorkspaceEnvironment (package:puro/src/workspace/install.dart:104)
    <asynchronous suspension>
    #9      switchEnvironment (package:puro/src/workspace/install.dart:133)
    <asynchronous suspension>
    #10     EnvUseCommand.run (package:puro/src/commands/env_use.dart:83)
    <asynchronous suspension>
    #11     CommandRunner.runCommand (package:args/command_runner.dart:212)
    <asynchronous suspension>
    #12     main (package:puro/src/cli.dart:234)
    <asynchronous suspension>

[V] Installing VSCode config...
[V] vscode workspaceDir: LocalDirectory: '/Users/jeffreybunn/Documents/Code/clearful/mobile'
[D] vscode exists: true
[V] Workspace path: `/Users/jeffreybunn/Documents/Code/clearful/mobile`
[V] stable already configured
[✓] Switched to environment `stable`
pingbird commented 1 year ago

Thanks! looking into it

johnwiese-ms commented 8 months ago

Looking for an update as I am now seeing it too. Happy to provide info if needed.

johnwiese-ms commented 8 months ago

Info in case it helps:

johnwiese@Johns-MacBook-Pro ios % puro use stable --log-level=4 [D] PURO_FLUTTER_BIN: null [V] Started waiting for lock on /Users/johnwiese/.puro/prefs.json [V] Waiting for lock on /Users/johnwiese/.puro/prefs.json took 1ms [D] target: PuroBuildTarget.macosX64 [D] Platform.executable: puro [D] Platform.resolvedExecutable: /Users/johnwiese/.puro/bin/puro [D] Platform.script: file:///Users/johnwiese/development/github/volleyball_parent/ios/puro [D] Platform.packageConfig: null [D] No package root: Platform.packageConfig is null [D] packageRoot: null [D] executablePath: /Users/johnwiese/.puro/bin/puro [D] scriptPath: /Users/johnwiese/.puro/bin/puro [D] scriptExtension: [D] installationType: PuroInstallationType.distribution [D] version: 1.4.4 [V] Checking if update is available [V] Started waiting for lock on /Users/johnwiese/.puro/latest_version [V] Waiting for lock on /Users/johnwiese/.puro/latest_version took 0ms [D] lastNotification: null [D] latestVersion: 1.4.4 [D] isOutOfDate: false [D] willNotify: false [D] shouldVersionCheck: false [D] lastVersionCheck: 2024-02-13 07:23:15.267686 [D] > ps -o %P %c -p 16221 [D] ps finished in 14ms [V] ps: %cpu %mem acflag acflg args blocked comm command cpu cputime etime f flags gid group inblk inblock jobc ktrace ktracep lim login logname lstart majflt minflt msgrcv msgsnd ni nice nivcsw nsignals nsigs nswap nvcsw nwchan oublk oublock p_ru paddr pagein pcpu pending pgid pid pmem ppid pri prsna pstime putime re rgid rgroup rss ruid ruser sess sig sigmask sl start stat state stime svgid svuid tdev time tpgid tsess tsiz tt tty ucomm uid upr user usrpri utime vsize vsz wchan wq wqb wql wqr xstat

[V] ps: ps: %P: keyword not found ps: %c: keyword not found ps: no valid keywords; valid keywords:

[V] ps subprocess failed with exit code 1 [D] [] [D] Writing dotfile /Users/johnwiese/development/github/volleyball_parent/.puro.json { "env": "stable" } [V] Updating gitignore... [V] Updating config at /Users/johnwiese/development/github/volleyball_parent/.git/info/exclude [V] Added ".puro.json" [V] Installing IDE configs... [D] vscode override: null [D] intellij override: null [V] Installing IntelliJ config... [V] intellij workspaceDir: LocalDirectory: '/Users/johnwiese/development/github/volleyball_parent' [E] Exception while installing IntelliJ config [E] Unsupported operation: Cannot extract a non-Windows file path from a file URI with an authority

0 _Uri._toFilePath (dart:core/uri.dart:2863)

#1      _Uri.toFilePath (dart:core/uri.dart:2858)
#2      IntelliJConfig.load (package:puro/src/workspace/intellij.dart:299)
#3      installIdeConfigs.<anonymous closure> (package:puro/src/workspace/install.dart:31)
#4      runOptional (package:puro/src/logger.dart:173)
#5      installIdeConfigs (package:puro/src/workspace/install.dart:27)
#6      installWorkspaceEnvironment.<anonymous closure> (package:puro/src/workspace/install.dart:122)
#7      runOptional (package:puro/src/logger.dart:173)
#8      installWorkspaceEnvironment (package:puro/src/workspace/install.dart:119)
<asynchronous suspension>
#9      switchEnvironment (package:puro/src/workspace/install.dart:154)
<asynchronous suspension>
#10     EnvUseCommand.run (package:puro/src/commands/env_use.dart:82)
<asynchronous suspension>
#11     CommandRunner.runCommand (package:args/command_runner.dart:212)
<asynchronous suspension>
#12     main (package:puro/src/cli.dart:256)
<asynchronous suspension>

[V] Installing VSCode config... [V] vscode workspaceDir: LocalDirectory: '/Users/johnwiese/development/github/volleyball_parent' [D] vscode exists: true [V] Workspace path: /Users/johnwiese/development/github/volleyball_parent [V] stable already configured [✓] Switched to environment stable

johnwiese@Johns-MacBook-Pro ios % flutter --version Flutter 3.16.9 • channel stable • https://github.com/flutter/flutter.git Framework • revision 41456452f2 (3 weeks ago) • 2024-01-25 10:06:23 -0800 Engine • revision f40e976bed Tools • Dart 3.2.6 • DevTools 2.28.5

johnwiese@Johns-MacBook-Pro ios % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.16.9, on macOS 14.3.1 23D60 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.2) [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Android Studio (version 2023.1) [✓] VS Code (version 1.86.1) [✓] Connected device (3 available) [✓] Network resources

! Doctor found issues in 1 category.

pingbird commented 8 months ago

Could you provide the contents of .idea/libraries/Dart_SDK.xml I have a theory as to what is causing this

johnwiese-ms commented 8 months ago

sure, here it is...

<component name="libraryTable">
  <library name="Dart SDK">
    <CLASSES>
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/async" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/cli" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/collection" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/convert" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/core" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/developer" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/ffi" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/html" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/indexed_db" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/io" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/isolate" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/js" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/js_util" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/math" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/mirrors" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/svg" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/typed_data" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/web_audio" />
      <root url="file://$PROJECT_DIR$/../../../SDKs/flutter/bin/cache/dart-sdk/lib/web_gl" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>
pingbird commented 7 months ago

This should be fixed in 1.4.5, sorry for the long wait!