You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On CI, we turn on melos using dart pub global activate melos. This has issues because if there are more than 1 job running on the system, and melos / dart / flutter versions differ, the second global activation also changes the command for the already running job, and melos commands may fail - this has just happened to me as a job for the main branch failed because another job for an 'upgrade everything' branch globally activated melos in another version (also dart and flutter were different).
So the idea is to not activate it globally on CI, and it makes problems. While calling
dart run melos --version
works, this doesn't:
$ dart run melos run --no-select pwd
melos run pwd
└> melos exec --concurrency 1 --order-dependents -- "pwd"
└> RUNNING
ERROR: /bin/sh: melos: command not found
melos run pwd
└> melos exec --concurrency 1 --order-dependents -- "pwd"
└> FAILED
ScriptException: The script pwd failed to execute.
This is likely because Melos is trying to shell out, and the new processes don't find the melos command.
Yes, melos is not on PATH, but that's the whole point, I want each job to have it own melos. How do I do that?
It seems to have something to do with using the exec block. If I remove it, it works, but only for the top-level package, which is not what I want:
$ dart run melos run --no-select pwd
melos run pwd
└>pwd
└> RUNNING
/Users/wujek/Development/melos_test
melos run pwd
└>pwd
└> SUCCESS
Steps to reproduce
Deactivate melos globally (if activated): dart pub global deactivate melos.
Try to call a script with dart run melos run ....
Expected behavior
The command works.
The text was updated successfully, but these errors were encountered:
wujek-srujek
changed the title
fix: Allow running melos without 'global activation'
fix: Melos doesn't work without 'global activation' if 'exec' is used
Apr 2, 2024
To make it work on CI we now set PUB_CACHE so that each GitHub Actions runner gets its own Pub cache and the global activation is scoped to jobs on that runner only, effectively fixing the issue for us.
There are other ways to make it work as well, like setting a different $HOME for each runner, which effectively also scopes dart/flutter/melos to that directory.
However, the underlying issue in Melos that it cannot be used without global activation persist. Others might not be able to use my approach so fixing this issue would be helpful.
Is there an existing issue for this?
Version
5.3.0
Description
I have the following
melos.yaml
:On CI, we turn on melos using
dart pub global activate melos
. This has issues because if there are more than 1 job running on the system, and melos / dart / flutter versions differ, the second global activation also changes the command for the already running job, and melos commands may fail - this has just happened to me as a job for the main branch failed because another job for an 'upgrade everything' branch globally activated melos in another version (also dart and flutter were different).So the idea is to not activate it globally on CI, and it makes problems. While calling
works, this doesn't:
This is likely because
Melos
is trying to shell out, and the new processes don't find themelos
command.Yes,
melos
is not onPATH
, but that's the whole point, I want each job to have it ownmelos
. How do I do that?It seems to have something to do with using the
exec
block. If I remove it, it works, but only for the top-level package, which is not what I want:Steps to reproduce
dart pub global deactivate melos
.dart run melos run ...
.Expected behavior
The command works.
The text was updated successfully, but these errors were encountered: