Skip to content
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

flutter upgrade fails on Windows/ARM because of locked cache folder #114753

Open
timsneath opened this issue Nov 5, 2022 · 8 comments
Open

flutter upgrade fails on Windows/ARM because of locked cache folder #114753

timsneath opened this issue Nov 5, 2022 · 8 comments
Labels
c: regression It was better in the past than it is now P2 Important issues not at the top of the work list platform-host-arm Building on an ARM-based platform platform-windows Building on or for Windows specifically team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team

Comments

@timsneath
Copy link
Contributor

timsneath commented Nov 5, 2022

Steps to Reproduce

Running Flutter on Windows ARM, flutter upgrade on the master channel doesn't work because the cache directory gets locked during the install process.

Logs

This is from a freshly-rebooted machine which has not run VSCode, Flutter or Dart since the reboot.

Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 0886c7d0b169690a05d4c39f9d6ae59200081756...
Rename-Item: C:\src\flutter\bin\internal\update_dart_sdk.ps1:52
Line |
  52 |      Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Access to the path 'C:\src\flutter\bin\cache\dart-sdk' is denied.

Error: Unable to update Dart SDK. Retrying...
ERROR: Input redirection is not supported, exiting the process immediately.
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 0886c7d0b169690a05d4c39f9d6ae59200081756...
Terminate batch job (Y/N)? y

[C:\src\win32] rd /s \src\flutter\bin\cache
\src\flutter\bin\cache, Are you sure (Y/N)? y

[C:\src\win32] flutter upgrade
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine ...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...
... proceeds to complete successfully

Expected results

Flutter should obviously be able to delete the folder. For some reason, rename fails but delete succeeds. I wonder if we need a fallback option where if the rename fails, we just blow the cache away?

Further details

The machine I'm using is a MacBook Air M2 with Parallels Desktop 18, hosting a Windows 11 22H2 ARM-based VM. I've observed this for some months, so it's a recent regression. Flutter was installed originally with a git clone from the flutter/flutter repo. Process Explorer shows no exclusive handles held on files in the cache folder.

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Nov 7, 2022
@danagbemava-nc
Copy link
Member

Labeling this for further investigation as I'm unable to verify this locally at the moment.

@danagbemava-nc danagbemava-nc added c: regression It was better in the past than it is now tool Affects the "flutter" command-line tool. See also t: labels. platform-windows Building on or for Windows specifically platform-host-arm Building on an ARM-based platform and removed in triage Presently being triaged by the triage team labels Nov 7, 2022
@christopherfujino
Copy link
Member

@loic-sharma or @cbracken, can one of you verify this on a real WIndows ARM machine? I wonder if this is related to:

  1. The Windows ARM build
  2. Running in parallels' virtualized windows filesystem
  3. something else

@timsneath
Copy link
Contributor Author

timsneath commented Nov 8, 2022

FWIW, I'm able to reproduce it on a Volterra dev kit, which seems to rule out # 2 from the above.

C:\src\flutter>bin\flutter upgrade
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine ...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...
Upgrading Flutter to 3.5.0-12.0.pre.165 from 3.5.0-12.0.pre.101 in C:\src\flutter...
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 004a305166d57756cf7c5f6255dd09a5cf43479d...
Rename-Item: C:\src\flutter\bin\internal\update_dart_sdk.ps1:52
Line |
  52 |      Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Access to the path 'C:\src\flutter\bin\cache\dart-sdk' is denied.

Machine is left in this state; let me know if there are any diagnostics you'd like me to run?

@christopherfujino
Copy link
Member

FWIW, I'm able to reproduce it on a Volterra dev kit, which seems to rule out # 2 from the above.

C:\src\flutter>bin\flutter upgrade
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine ...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...
Upgrading Flutter to 3.5.0-12.0.pre.165 from 3.5.0-12.0.pre.101 in C:\src\flutter...
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 004a305166d57756cf7c5f6255dd09a5cf43479d...
Rename-Item: C:\src\flutter\bin\internal\update_dart_sdk.ps1:52
Line |
  52 |      Rename-Item $dartSdkPath "$oldDartSdkPrefix$oldDartSdkSuffix"
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Access to the path 'C:\src\flutter\bin\cache\dart-sdk' is denied.

Machine is left in this state; let me know if there are any diagnostics you'd like me to run?

Oh wow, very interesting. And I can't even think of any diagnostics to run.

@christopherfujino christopherfujino added the P2 Important issues not at the top of the work list label Nov 23, 2022
@ngaretou
Copy link

FWIW messing around with this a bit flutter doctor of all things somehow triggered the upgrade...

@RoarGronmo
Copy link

FYI: This happens on all flavors of flutter, master/main, beta and stable.

Since it is at least one year since someone commented here, are any working on it?

@roylan34
Copy link

roylan34 commented May 25, 2024

I encountered this issue. What i did is to disconnect the running app from emulator or device before executing flutter upgrade.

@RoarGronmo
Copy link

For now I never upgrade or changes channel when AS is started.

I upgrade/change channel from my flutter program folder in powershell. It doesn't fail when using this method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: regression It was better in the past than it is now P2 Important issues not at the top of the work list platform-host-arm Building on an ARM-based platform platform-windows Building on or for Windows specifically team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team
Projects
None yet
Development

No branches or pull requests

6 participants