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

leoafarias/fvm:latest broken with latest FVM version #621

Open
1 of 4 tasks
AngeloAvv opened this issue Feb 15, 2024 · 7 comments
Open
1 of 4 tasks

leoafarias/fvm:latest broken with latest FVM version #621

AngeloAvv opened this issue Feb 15, 2024 · 7 comments
Assignees
Labels
bug Something isn't working docker Related to docker

Comments

@AngeloAvv
Copy link

Before creating a bug report please make check the following

  • 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
After upgrading to the latest fvm version (3.x) the tool changed the file config moving everything under .fvmrc. Since my CI is using leoafarias/fvm:latest, sounds like that image is not using the latest FVM version

To Reproduce
Steps to reproduce the behavior:

In the CI script:
$ fvm install
Please provide a channel or a version, or run this command in a Flutter project that has FVM configured.

Expected behavior
latest version of fvm should detect the new .fvmrc file

@AngeloAvv AngeloAvv added the bug Something isn't working label Feb 15, 2024
@leoafarias leoafarias self-assigned this Feb 15, 2024
@leoafarias
Copy link
Owner

@AngeloAvv This is related to #626

@leoafarias
Copy link
Owner

@AngeloAvv can you try again as this should have been resolved on 3.0.4 which was just released

@AngeloAvv
Copy link
Author

@leoafarias unfortunately nothing changed. This is part of my CI output log:

Using Docker executor with image leoafarias/fvm:latest ...
Pulling docker image leoafarias/fvm:latest ...
Using docker image sha256:5842ebf363d002bfe4bb93094674ece87d5a9958de3535b536c4a59f2a289b1c for leoafarias/fvm:latest with digest leoafarias/fvm@sha256:3696a70138d1444b353244446138bf0915b1884356bb443d7e100e9bf66e2d19 ...
Successfully extracted cache
Executing "step_script" stage of the job script
00:00
Using docker image sha256:5842ebf363d002bfe4bb93094674ece87d5a9958de3535b536c4a59f2a289b1c for leoafarias/fvm:latest with digest leoafarias/fvm@sha256:3696a70138d1444b353244446138bf0915b1884356bb443d7e100e9bf66e2d19 ...
$ fvm install
Please provide a channel or a version, or run this command in a Flutter project that has FVM configured.
Running after_script
00:01
Running after script...
$ echo $CI_PIPELINE_IID
450
$ date
Fri Feb 16 18:06:20 UTC 2024
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1

@leoafarias
Copy link
Owner

Based on the output, the command is not running on a project folder, and there is no fvm config found to install the version

@AngeloAvv
Copy link
Author

AngeloAvv commented Feb 17, 2024

I don't understand how this could be possible since I didn't change anything in my CI scripts. Every single Flutter project is failing if I forget to rollback the migration to .fvmrc.

The following script is one of the simplest ones that are failing. As you can see, I'm not going back and forth in the folders, I'm just running fvm instructions:

.android_image:
  image: fabernovel/android:api-33-v1.7.0

.flutter:
  image: leoafarias/fvm:latest
  before_script:
    - fvm install
    - fvm flutter doctor
    - fvm flutter pub get
  stage: test
  tags:
    - flutter
.test:
  extends: .flutter
  stage: test

analyze:
  extends: .test
  script:
    - fvm flutter analyze

tests:
  extends: .test
  script:
    - apt-get update && apt-get -y install lcov
    - pub global activate junitreport
    - fvm flutter test --machine --coverage
      | tojunit -o report.xml
    - lcov --summary coverage/lcov.info
    - genhtml coverage/lcov.info --output=coverage
  coverage: '/lines\.*: \d+\.\d+\%/'
  artifacts:
    name: coverage
    paths:
      - $CI_PROJECT_DIR/coverage
    expire_in: 7 days
    reports:
      junit: report.xml

I also tried running the script locally using gitlab-ci-local and is failing too, but if I use fvm install in my project, everything is working fine. It's a clear indication that something is wrong in the docker image.

EDIT: After taking a look at the fvm Dockerfile, I'm assuming you need to rebuild the image because five months ago (last time you built fvm:latest) you hadn't released fvm 3.x yet

@leoafarias
Copy link
Owner

@AngeloAvv I am not a rocket expert but the image should just install the latest.

I will take a look at what could be happening, maybe there is a directory issue on fvm.

@leoafarias leoafarias added the docker Related to docker label Feb 17, 2024
@AngeloAvv
Copy link
Author

I don't think so :) at least if you're using this file to create the fvm image.

As far as I can see, there's a param FVM_VERSION which has been used to define the version of fvm to be used at that time. This means that every time you release a newer version of fvm, you need to rerun the image creation process to update the fvm version in the fvm:latest image.

Also, it would be nice to tag previous versions for those people who don't want to use the latest version but a fixed version instead.

cc @andreadelfante who worked on the Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker Related to docker
Projects
None yet
Development

No branches or pull requests

2 participants