Giter Site home page Giter Site logo

Comments (9)

JulianBissekkou avatar JulianBissekkou commented on June 9, 2024

Okay I assume that /home/developer/fvm/versions/3.19.3 is not cached which causes the issue.

Update:
I tired configuring the FVM_CACHE_PATH to be another path that i can cache.
export FVM_CACHE_PATH=$CI_PROJECT_DIR/fvm-version-cache

This made the gitclone fail without a readable error or stack:

Creating local mirror...
✓ Clone complete
Exception: Git clone failed
package:fvm/src/utils/parsers/git_clone_update_printer.dart 92:5        runGitCloneUpdate
package:fvm/src/services/flutter_service.dart 146:7                     FlutterService.updateLocalMirror
package:fvm/src/services/flutter_service.dart 30:7                      FlutterService._ensureCacheDir
package:fvm/src/services/flutter_service.dart 195:5                     FlutterService.getReference
package:fvm/src/services/flutter_service.dart 166:23                    FlutterService.isTag
package:fvm/src/workflows/ensure_cache.workflow.dart 193:9              validateFlutterVersion
package:fvm/src/workflows/ensure_cache.workflow.dart 25:24              ensureCacheWorkflow
package:fvm/src/commands/install_command.dart 58:28                     InstallCommand.run
package:args/command_runner.dart 212:13                                 CommandRunner.runCommand
package:fvm/src/runner.dart                                      FvmCommandRunner.runCommand
package:fvm/src/runner.dart 122:24                                      FvmCommandRunner.run
package:scope/src/scope.dart 151:12                                     Scope.run
/home/developer/.pub-cache/hosted/pub.dev/fvm-3.1.3/bin/main.dart 13:5  main

from fvm.

leoafarias avatar leoafarias commented on June 9, 2024

@JulianBissekkou could it be that you do not have permission in this directory?

from fvm.

JulianBissekkou avatar JulianBissekkou commented on June 9, 2024

@leoafarias
After some debugging the git clone failed because of proxy issues. This was an issue on my side.
Maybe we can improve error handling here and give more information on what actually went wrong?

The flutter version is now installed, however I still see that it creates the mirror which takes around 40 seconds.
Ouput of pipeline (slightly truncated):

$ time fvm install --skip-pub-get
Creating local mirror...
 Counting objects:    [██████████████████████████████████████████████████] 100%
 Receiving objects:   [█.................................................] 1%
 Receiving objects:   [█████████████████████████████████.................] 66%
 Receiving objects:   [███████████████████████████████████████████.......] 86%
 Receiving objects:   [█████████████████████████████████████████████.....] 90%
 Receiving objects:   [███████████████████████████████████████████████...] 94%
 Receiving objects:   [████████████████████████████████████████████████..] 96%
 Receiving objects:   [█████████████████████████████████████████████████.] 98%
 Receiving objects:   [██████████████████████████████████████████████████] 100%
 Receiving objects:   [██████████████████████████████████████████████████] 100%
 Resolving deltas:    [█████.............................................] 9%
[██████████████████████████████████████████████████] 99%
 Resolving deltas:    [██████████████████████████████████████████████████] 100%
✓ Clone complete
**✓ Flutter SDK: SDK Version : 3.19.3 is already installed.**
✓ Project now uses Flutter SDK : SDK Version : 3.19.3
real	0m47.423s
user	0m21.657s
sys	0m5.559s

Do you know why that is?

from fvm.

leoafarias avatar leoafarias commented on June 9, 2024

@JulianBissekkou The mirror is just the first clone, and the version installs from the mirror. So, it's a bit confusing but does not impact the installation speed or anything like that. However, I think it might make sense to disable the cache for the confusion when installing in a CI.

So if it's isCI true, it always returns false on gitCache,

bool get gitCache {

If you think this resolves the issue, you can do a quick PR and I will review, and deploy

from fvm.

JulianBissekkou avatar JulianBissekkou commented on June 9, 2024

I would like to do some testing first before we might accidently break anything.
In my described setup I did export FVM_GIT_CACHE=false and then fvm flutter install which I would expect to not create a mirror.

Instead I got:

FVM_GIT_CACHE environment variable is deprecated. 
Please use FVM_FLUTTER_URL
? Do you want to proceed? This might impact the expected behavior. (y/n) ›     

Am I confusing anything? I thought I can also set this variable to false by using this env variable.

from fvm.

leoafarias avatar leoafarias commented on June 9, 2024

@JulianBissekkou can you try using FVM_USE_GIT_CACHE instead?

from fvm.

JulianBissekkou avatar JulianBissekkou commented on June 9, 2024

I used the proposed parameter but I can't see any change in the output:

$ export FVM_USE_GIT_CACHE=false
$ export http_proxy="${PROXY}" && export https_proxy="${PROXY}"
$ export HTTP_PROXY="${PROXY}" && export HTTPS_PROXY="${PROXY}"
$ time fvm install --skip-pub-get
Creating local mirror...
 Counting objects:    [██████████████████████████████████████████████████] 100%
 Compressing objects: [██████████████████████████████████████████████████] 100%
 Receiving objects:   [..................................................] 0%
 Receiving objects:   [█.................................................] 1%
 Receiving objects:   [████..............................................] 8%
 Receiving objects:   [█████.............................................] 9%
 Receiving objects:   [█████.............................................] 10%
 Receiving objects:   [██████████████....................................] 28%
 Receiving objects:   [██████████████....................................] 29%
 Receiving objects:   [███████████████...................................] 30%
 Receiving objects:   [███████████████████████████████████████...........] 77%
 Receiving objects:   [██████████████████████████████████████████........] 84%
 Receiving objects:   [███████████████████████████████████████████.......] 86%
 Receiving objects:   [████████████████████████████████████████████......] 87%
 Receiving objects:   [██████████████████████████████████████████████....] 91%
 Receiving objects:   [███████████████████████████████████████████████...] 94%
 Receiving objects:   [████████████████████████████████████████████████..] 96%
 Receiving objects:   [█████████████████████████████████████████████████.] 97%
 Receiving objects:   [██████████████████████████████████████████████████] 99%
 Receiving objects:   [██████████████████████████████████████████████████] 100%
 Resolving deltas:    [..................................................] 0%
 Resolving deltas:    [██████............................................] 11%
 Resolving deltas:    [█████████.........................................] 18%
 Resolving deltas:    [█████████████.....................................] 26%
 Resolving deltas:    [█████████████████.................................] 34%
 Resolving deltas:    [██████████████████████████████████████████████████] 100%
✓ Clone complete
**✓ Flutter SDK: SDK Version : 3.19.3 is already installed.**
✓ Project now uses Flutter SDK : SDK Version : 3.19.3
**real	0m53.553s
user	0m21.786s
sys	0m3.859s**

You can see that the creation of the mirror takes quite some time, however, fvm sees tha the version was already installed.
Here is the dockerfile of the image, maybe you can see if there is a mistake:

RUN export http_proxy=${HTTP_PROXY} \
  && export https_proxy=${HTTPS_PROXY} \
  && dart pub global activate fvm ${FVM_VERSION} \
  && fvm --version

# Install flutter
RUN export http_proxy=${HTTP_PROXY} \
    && export https_proxy=${HTTPS_PROXY} \
    && fvm install ${FLUTTER_VERSION} --setup \
    && fvm global ${FLUTTER_VERSION} \
    && fvm flutter --version \
    && fvm flutter precache

Something that is strange is that the fvm install ${FLUTTER_VERSION} --setup finishes in just a few seconds.

from fvm.

leoafarias avatar leoafarias commented on June 9, 2024

@JulianBissekkou Just tested with the latest version and doing

export FVM_USE_GIT_CACHE=false

and then running the fvm install [version] does not generate the mirror. Can you confirm that this is what you are doing?

from fvm.

leoafarias avatar leoafarias commented on June 9, 2024

@JulianBissekkou also I have updated the docs which was incorrect from FVM_GIT_CACHE to FVM_USE_GIT_CACHE

from fvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.