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

fix: Flutter SDK is not available when use dart pub gloabl activate melos in new system #574

Closed
1 task done
jiechic opened this issue Aug 29, 2023 · 3 comments
Closed
1 task done
Labels
bug Something isn't working Needs: Triage The issue needs triaging

Comments

@jiechic
Copy link

jiechic commented Aug 29, 2023

Is there an existing issue for this?

  • I have searched the existing issues.

Version

3.1.1

Description

I install fvm and melos in the docker image,setting sdkPath in the melos.yaml ,when i run melos bs on gitlab runner,it's show the log error

$ echo y | fvm use && fvm flutter precache
Project now uses Flutter [3.10.6]
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Flutter assets will be downloaded from https://storage.flutter-io.cn/. Make sure you trust this source!
$ melos bootstrap
Resolving dependencies...
Because okmm depends on flutter_test from sdk which doesn't exist (the Flutter SDK is not available), version solving failed.
Flutter users should run `flutter pub get` instead of `dart pub get`.

Steps to reproduce

some setup is on the docker build

  1. install dart
RUN wget --quiet --output-document=dart.deb \
    "https://storage.googleapis.com/dart-archive/channels/stable/release/latest/linux_packages/dart_3.1.0-1_amd64.deb" && \
    dpkg -i dart.deb && \
    rm --force dart.deb

ENV PATH="$PATH:/usr/lib/dart/bin"
  1. install melos and fvm
RUN dart pub global activate fvm && \
    dart pub global activate melos && \
    dart pub global activate junitreport && \
    dart pub global activate full_coverage

ENV PATH="$PATH:/root/.pub-cache/bin"
  1. precache flutter version
ENV FLUTTER_VERSION=3.10.6
RUN fvm install $FLUTTER_VERSION && \
    fvm spawn $FLUTTER_VERSION precache

the follow setup is on gitlab runner

  1. echo y | fvm use && fvm flutter precache
  2. melos bootstrap

Expected behavior

when runner melos will success pub get packages

Screenshots

image

Additional context and comments

when i install melos and fvm on local clean system with mac

  1. brew install dart
  2. dart pub global activate fvm
  3. dart pub global activate melos
  4. git clone ...project.git
  5. cd project
  6. fvm use (create link for .fvm/flutter_sdk)
  7. melos bs (error on this setup like the log)
  8. fvm dart pub global run melos (error on this setup like the log)
  9. fvm flutter pub global run melos (success pub get for all packages)
  10. melos bs (now is success for all the next setup with any type run meols)

if i install melos with dart pub global on clean system ,it will be error.
if i run flutter pub global run melos or install with flutter pub global activate melos then run , i will be success for all time
next,when i deactivate melos and reactivate melos with dart pub global activate melos ,it's success but error on system reboot

@jiechic jiechic added bug Something isn't working Needs: Triage The issue needs triaging labels Aug 29, 2023
@okki-jk
Copy link

okki-jk commented Aug 29, 2023

I got the same problem

@jiechic
Copy link
Author

jiechic commented Dec 18, 2023

because root project use flutter but dart run melos have found it
i change root project to dir app,
then the root project is only dart project
it fix

@jiechic
Copy link
Author

jiechic commented Dec 18, 2023

it's the same problem #616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage The issue needs triaging
Projects
None yet
Development

No branches or pull requests

2 participants