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

Python CLI Tools Installing Inside Python Framework on macOS-12 #6507

Closed
2 of 11 tasks
aetherealtech opened this issue Nov 2, 2022 · 7 comments
Closed
2 of 11 tasks
Assignees
Labels
awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS

Comments

@aetherealtech
Copy link

Description

We have a GitHub Action that installs codemagic-cli-tools using the following shell command:

pip3 install codemagic-cli-tools

This is supposed to add several CLI programs to the path (installing them to usr/local/bin). We use one of them, app-store-connect, later in the action.

This script broke somewhere between 6 and 1 days ago (the last successful run was on 10/27, around 23:30 UTC, first failed run was yesterday), with the failure:

app-store-connect: command not found

After running some tests, we determined that none of the CLI tools that are supposed to be added are present in usr/local/bin. There was an update to codemagic-cli-tools on the first failed run, so we tried using the exact same version, and the error persisted.

After some more investigation, we noticed that on the last successful run, the python CLI was referenced as simply python3.10, but on the failing runs, it is referenced by the full path:

/Library/Frameworks/Python.framework/Versions/3.11/bin/python

So then we looked into the following directory:

/Library/Frameworks/Python.framework/Versions/3.11/bin

And we found the CLI tools installed there.

We tried running them from there, and got a bunch of Python errors, but that may be a problem with those tools.

However, it seems like the latest macos runner that upgraded Python from 3.10.8 to 3.11 resulted in something about the paths getting messed up for Python.

Last successful run: https://github.com/movehq/hq-driver-ios/actions/runs/3341642377/jobs/5533052139
First failing run: https://github.com/movehq/hq-driver-ios/actions/runs/3370254410/jobs/5590925123

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 10.15
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

https://github.com/actions/runner-images/blob/macOS-12/20221027.1/images/macos/macos-12-Readme.md

Is it regression?

https://github.com/actions/runner-images/blob/macOS-12/20221018.2/images/macos/macos-12-Readme.md

Expected behavior

CLI tools installed by this Python library should be in usr/local/bin, so they are in the shell path.

Actual behavior

CLI tools are installed to /Library/Frameworks/Python.framework/Versions/3.11/bin, and not in the shell path.

Repro steps

Run the following script in a GitHub Action:

pip3 install codemagic-cli-tools
which app-store-connect
@ssrobins
Copy link

ssrobins commented Nov 3, 2022

I'm seeing the same thing with pip3 install conan. I can work around it by setting the following step prior to any steps that use it:

- name: Add Python bin to PATH
  run: echo "/Library/Frameworks/Python.framework/Versions/Current/bin" >> $GITHUB_PATH

One of my CI jobs is scheduled to run every day. Last time it worked, the runner image was 20221018.2. First failure had runner image 20221027.1.

@ssrobins
Copy link

ssrobins commented Nov 3, 2022

I bet this will fix the image:
c7958d7

I held off on a PR since the Contribution guide said macOS external contributions aren't supported, but let me know if you want me to make one.

@igorboskovic3 igorboskovic3 added OS: macOS investigate Collect additional information, like space on disk, other tool incompatibilities etc. and removed needs triage labels Nov 3, 2022
@igorboskovic3
Copy link
Contributor

igorboskovic3 commented Nov 3, 2022

Hi @aetherealtech and @ssrobins thank you for reporting and contributing, we will check it and get back to you.

LeStarch added a commit to nasa/fprime that referenced this issue Nov 3, 2022
* lestarch: bumping zmq and GDS versions

* lestarch: adding `wheel` to setup

* lestarch: checking tools before leaving action

* lestarch: reverting to mac11 runners

See: actions/runner-images#6507
@andreujuanc
Copy link

Please give top priority to this, we need to issue a patch on iOS ASAP

@al-cheb
Copy link
Contributor

al-cheb commented Nov 4, 2022

Please give top priority to this, we need to issue a patch on iOS ASAP

Our recommendation is to use setup-python action - https://github.com/actions/setup-python

@andreujuanc
Copy link

Thanks @al-cheb team sends you a hug!
To the github team: I opened a ticket because we spent some minutes figuring this out and we would like us and everyone else on the platform to get reimbursed for this. Specially because MacOS minutes have a 10x multiplier.

@igorboskovic3 igorboskovic3 mentioned this issue Nov 4, 2022
4 tasks
@igorboskovic3 igorboskovic3 self-assigned this Nov 4, 2022
@al-cheb al-cheb added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Nov 9, 2022
FranzPoize added a commit to ShredEagle/reusable-workflows that referenced this issue Nov 9, 2022
FranzPoize added a commit to ShredEagle/reusable-workflows that referenced this issue Nov 9, 2022
FranzPoize added a commit to ShredEagle/reusable-workflows that referenced this issue Nov 9, 2022
jeeb added a commit to jeeb/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
jeeb added a commit to mpv-player/mpv that referenced this issue Nov 11, 2022
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
imphil added a commit to imphil/cocotb that referenced this issue Nov 13, 2022
We currently use any system-installed Python version to invoke the wheel
building process (which then happens inside a container). The exact
Python version does not matter, but it must be a working Python version
-- and that's currently not the case for the macos11 builds: Python and
the Python installation directory are not inside PATH, hence we install
nox, but it's not found in the next step.

actions/runner-images#6518 fixes the problem,
but is not yet rolled out universally. It seems like using setup-python
even for this case is recommended
(actions/runner-images#6507 (comment)),
so let's do that.
imphil added a commit to cocotb/cocotb that referenced this issue Nov 15, 2022
We currently use any system-installed Python version to invoke the wheel
building process (which then happens inside a container). The exact
Python version does not matter, but it must be a working Python version
-- and that's currently not the case for the macos11 builds: Python and
the Python installation directory are not inside PATH, hence we install
nox, but it's not found in the next step.

actions/runner-images#6518 fixes the problem,
but is not yet rolled out universally. It seems like using setup-python
even for this case is recommended
(actions/runner-images#6507 (comment)),
so let's do that.
imphil added a commit to cocotb/cocotb that referenced this issue Nov 15, 2022
We currently use any system-installed Python version to invoke the wheel
building process (which then happens inside a container). The exact
Python version does not matter, but it must be a working Python version
-- and that's currently not the case for the macos11 builds: Python and
the Python installation directory are not inside PATH, hence we install
nox, but it's not found in the next step.

actions/runner-images#6518 fixes the problem,
but is not yet rolled out universally. It seems like using setup-python
even for this case is recommended
(actions/runner-images#6507 (comment)),
so let's do that.
Guillaumebeuzeboc added a commit to ubuntu-robotics/nodl that referenced this issue Nov 16, 2022
Because of
actions/runner-images#6507 (comment)
Installing and running Python packages is no longer straightforward
Even with a temporary fix, rclpy was no longer building on MacOS
giusebar pushed a commit to ubuntu-robotics/nodl that referenced this issue Nov 17, 2022
Because of
actions/runner-images#6507 (comment)
Installing and running Python packages is no longer straightforward
Even with a temporary fix, rclpy was no longer building on MacOS
@mikhailkoliada
Copy link
Contributor

Deployed

fedepad added a commit to fedepad/minio-py that referenced this issue Jan 3, 2023
Related:
* macos-latest can currently be associated with either macos-11 or macos-12, so pinned it for the moment --> https://github.blog/changelog/2022-10-03-github-actions-jobs-running-on-macos-latest-are-now-running-on-macos-12/
* Update checkout actions and setup python actions versions
* Tools not installed in PATH locations: actions/runner-images#6507
* Explicit export workaround for the only case that seems to fail (for PATH not found reasons): add PATH missing to PATH if os is macos-12 (the one pinned) and running Python 3.11
q3aiml added a commit to q3aiml/ledger that referenced this issue Jan 8, 2023
The github mac runner images added python 3.11 but, unlike 3.10, not via
brew. This causes brew install to fail with link conflict errors now
that boost-python3 switched over to 3.11. Workaround this, and future
python brew link errors, by ovewriting all links for python packages.

Homebrew/homebrew-core@8c79089
https://github.com/orgs/Homebrew/discussions/3895
actions/setup-python#577
actions/runner-images#6459
actions/runner-images#6507
actions/runner-images#2322
q3aiml added a commit to q3aiml/ledger that referenced this issue Jan 8, 2023
The github mac runner images added python 3.11 but, unlike 3.10, not via
brew. This causes brew install to fail with link conflict errors now
that boost-python3 switched over to 3.11. Workaround this, and future
python brew link errors, by overwriting all links for python packages.

Homebrew/homebrew-core@8c79089
https://github.com/orgs/Homebrew/discussions/3895
actions/setup-python#577
actions/runner-images#6459
actions/runner-images#6507
actions/runner-images#2322
tbm pushed a commit to ledger/ledger that referenced this issue Jan 9, 2023
The github mac runner images added python 3.11 but, unlike 3.10, not via
brew. This causes brew install to fail with link conflict errors now
that boost-python3 switched over to 3.11. Workaround this, and future
python brew link errors, by overwriting all links for python packages.

Homebrew/homebrew-core@8c79089
https://github.com/orgs/Homebrew/discussions/3895
actions/setup-python#577
actions/runner-images#6459
actions/runner-images#6507
actions/runner-images#2322
Adnn pushed a commit to ShredEagle/reusable-workflows that referenced this issue Jan 18, 2023
dyphire pushed a commit to dyphire/mpv that referenced this issue Feb 22, 2023
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
dyphire pushed a commit to dyphire/mpv that referenced this issue Feb 22, 2023
… on macOS

This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS
Projects
None yet
Development

No branches or pull requests

6 participants