Open wujek-srujek opened 8 months ago
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.
Also struggling with it, thanks for the temporary solution
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.