I think I discovered a bug, but also have a possible quick solution. Although the flutter/install_sdk command appears to succeed, there is some flakiness in the install and some errors in doctor. This manifests itself with an error any time ruby is invoked. Some examples:
Running flutter doctor:
Running rbenv version
From there, cocoapods and anything gem related breaks down in all kinds of ways, but I think it will be more helpful to show the cause and solution than to exhaust all the side effect errors that occur.
Additional Information:
The easiest way to replicate this is with the following config file.
In here, the job basic-install is an integrated example which uses the orb and shows how the install breaks the bash command: rbenv version. The two jobs minimal-working and minimal-broken show where the root cause of this might be occurring. I suspect that ruby is doing something with the PATH variable, and the flutter sdk is overwriting this variable, rather than constructing it in $BASH_ENV.
Basic Install
Using the following steps, the first rbenv version succeeds but the second call fails just after installing:
steps:
- run: rbenv version
- flutter/install_sdk
- run: rbenv version
Broken
minimal-broken, performing the PATH overwrite with current code.
command: |
rbenv version
echo "export PATH=/Users/distiller/development/flutter/bin:$PATH" >> "$BASH_ENV"
rbenv version
Working
vs minimal-working, which adds an escaped character next to the $ sign in $PATH
command: |
rbenv version
echo "export PATH=/Users/distiller/development/flutter/bin:\$PATH" >> "$BASH_ENV"
rbenv version
Expected behavior:
rbenv version should not exit with an error after installing flutter sdk on xcode 14.2 executor.
Hi @ajamespro thank you so much for all the investigation you did into this issue, it was a massive help. I have just drafted up a PR to fix this and this should be fixed in the next release.
Orb version:
2.0.0
TLDR;
This should be the only thing that needs to change here:
What happened:
I think I discovered a bug, but also have a possible quick solution. Although the
flutter/install_sdk
command appears to succeed, there is some flakiness in the install and some errors indoctor
. This manifests itself with an error any time ruby is invoked. Some examples:Running
flutter doctor
:Running
rbenv version
From there, cocoapods and anything gem related breaks down in all kinds of ways, but I think it will be more helpful to show the cause and solution than to exhaust all the side effect errors that occur.
Additional Information:
The easiest way to replicate this is with the following config file.
config.yml
```yml version: 2.1 jobs: basic-install: macos: xcode: 14.2.0 steps: - run: rbenv version - flutter/install_sdk - run: rbenv version minimal-broken: macos: xcode: 14.2.0 steps: - run: name: '$PATH variable not escaped' command: | rbenv version echo "export PATH=/Users/distiller/development/flutter/bin:$PATH" >> "$BASH_ENV" rbenv version minimal-working: macos: xcode: 14.2.0 steps: - run: name: 'Escaped \$PATH variable' command: | rbenv version echo "export PATH=/Users/distiller/development/flutter/bin:\$PATH" >> "$BASH_ENV" rbenv version orbs: flutter: circleci/flutter@2.0.0 workflows: bug-report: jobs: - basic-install - minimal-broken - minimal-working ```In here, the job
basic-install
is an integrated example which uses the orb and shows how the install breaks the bash command:rbenv version
. The two jobsminimal-working
andminimal-broken
show where the root cause of this might be occurring. I suspect that ruby is doing something with thePATH
variable, and the flutter sdk is overwriting this variable, rather than constructing it in$BASH_ENV
.Basic Install
Using the following steps, the first
rbenv version
succeeds but the second call fails just after installing:Broken
minimal-broken
, performing the PATH overwrite with current code.Working
vs
minimal-working
, which adds an escaped character next to the $ sign in$PATH
Expected behavior:
rbenv version
should not exit with an error after installing flutter sdk on xcode 14.2 executor.