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

[BUG] Custom Flutter Versions are not allowed anymore. #653

Closed
4 tasks done
Bassiuz opened this issue Feb 26, 2024 · 3 comments
Closed
4 tasks done

[BUG] Custom Flutter Versions are not allowed anymore. #653

Bassiuz opened this issue Feb 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Bassiuz
Copy link
Contributor

Bassiuz commented Feb 26, 2024

  • You have read our FAQ
  • If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
  • If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
  • Run fvm doctor if possible and add the output to the issue.

Describe the bug
Because of the changes of how Flutter renders images on different processor architectures, we want to toggle the FVM version used by our CI to x64_86. Before FVM 3 we were able to download a x86_64 version of flutter, place it in the versions folder for FVM named 3.19.0_x86_64 for example and run fvm use 3.19.0_x86_64. However since the upgrade to FVM 3, the name of the Flutter version gets checked to the actual flutter version and get the following options to resolve:


┌───────────────────────────────────────────────────────────────────────────────────┐
│ ⚠ Version mismatch detected: cache version is 3.19.0, but expected 3.19.0_x86_64. │
└───────────────────────────────────────────────────────────────────────────────────┘
This can occur if you manually run "flutter upgrade" on a cached SDK.

? How would you like to resolve this? ›                                                                                                                                                                                                                      
❯ Move 3.19.0 to the correct cache directory and reinstall 3.19.0_x86_64                                                                                                                                                                                     
  Remove incorrect version and reinstall 3.19.0_x86_64     

However; moving it to the 'correct' folder name or reinstalling isn't a option here, as I want the x86_64 version to be available separately.

To Reproduce
Steps to reproduce the behavior:

  1. Go to terminal..
  2. Run the provided x86_64 script to install a intel version of Flutter to the versions folder (Or manually download and install one to the folder)
  3. Run fvm use 3.19.0_x86_64
  4. See that there is no available option that suits this problem anymore.

Expected behavior
I expect that there would be a way to just use the flutter version in the provided folder without checking if the version is correct

Desktop (please complete the following information):

  • OS: MacOS Somona
  • FVM Version 3.0.9

Additional context

My install-x86_64.sh script

#!/bin/sh

echo "Checking x86_64 Flutter version: $1"

FVM_VERSION_DIR="$HOME/fvm/versions"
FVM_X86_64_VERSION="$FVM_VERSION_DIR/$1_x86_64"
FVM_DOWNLOAD="$FVM_VERSION_DIR/flutter_sdk_x86.zip"

# Check if FVM x86_64 is installed
if [ -d "$FVM_X86_64_VERSION" ]; then
    echo "Flutter version $1 is already installed for x86_64"
    exit 0
    else
      echo "Installing Flutter version $1 for x86_64"
      curl "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_$1-stable.zip" -o "$FVM_DOWNLOAD"
      if [ -f "$FVM_DOWNLOAD" ]; then
        unzip "$FVM_DOWNLOAD" "flutter/*" -d "$FVM_X86_64_VERSION"
        # shellcheck disable=SC2164
        if [ -d "$FVM_X86_64_VERSION/flutter" ]; then
          cd "$FVM_X86_64_VERSION/flutter"
          # shellcheck disable=SC2035
          mv * ../
          [ -d “${FVM_X86_64_VERSION}/flutter” ] && rm -rf “$FVM_X86_64_VERSION/flutter”
          [ -d “${FVM_DOWNLOAD}” ] && rm -rf “$FVM_DOWNLOAD”
          exit 0
        fi
      fi
fi

@Bassiuz Bassiuz added the bug Something isn't working label Feb 26, 2024
@Bassiuz
Copy link
Contributor Author

Bassiuz commented Feb 26, 2024

As an addition; prefixing it with custom_ to create a Custom Flutter version also does not skip the version checking

@Bassiuz
Copy link
Contributor Author

Bassiuz commented Feb 26, 2024

I provided a pull request with some additions to the use command. This supports using the force command to skip handling mismatches, as well skipping handling mismatches on custom versions.

@Bassiuz
Copy link
Contributor Author

Bassiuz commented Feb 27, 2024

Fixed by #654

@Bassiuz Bassiuz closed this as completed Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant