Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Setup error on macOS-latest when adding conda path to PATH (received undefined) #432

Open
pauleve opened this issue May 7, 2024 · 6 comments

Comments

@pauleve
Copy link

pauleve commented May 7, 2024

Running s-weigand/setup-conda@v1 on macOS-latest with default options fails at the step "Adding conda path to PATH" with Error: The "path" argument must be of type string. Received undefined

Recipe is

jobs:
    build:
        runs-on: ${{ matrix.os }}
        strategy:
            matrix:
                os: [ubuntu-latest, macOS-latest, windows-latest]
        env:
            OLD_REF: ${{ github.event.before }}
            ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
        steps:
            - uses: s-weigand/setup-conda@v1
            - uses: actions/checkout@v3
              with:
                  fetch-depth: 0
            - run: bash auto-build-from-push.sh

(src: https://github.com/colomoto/colomoto-conda/blob/master/.github/workflows/push.yml)

Log is

Getting original pythonLocation
  /usr/bin/which python
  /Library/Frameworks/Python.framework/Versions/Current/bin/python
Adding conda path to PATH
  undefined
  Error: The "path" argument must be of type string. Received undefined

(src: https://github.com/colomoto/colomoto-conda/actions/runs/8986528695/job/24682859612)

Not sure what I'm doing wrong here, and it was working fine until recently..

@s-weigand
Copy link
Owner

Hi @pauleve thanks for the bug report.
I guess that recently macOS-latest changed which image it refers to (macos-13 -> macos-14) and the new image misses the CONDA env var (conda install root folder).
And those lines cause the error

const conda_base_path = process.env.CONDA as string
sane_add_path(conda_base_path)

I will have a closer look at the weekend if I manage to find the time.

@s-weigand
Copy link
Owner

@all-contributors please add @pauleve for bug

Copy link
Contributor

@s-weigand

I've put up a pull request to add @pauleve! 🎉

s-weigand pushed a commit that referenced this issue May 17, 2024
Adds @pauleve as a contributor for bug. #432 

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
@s-weigand s-weigand pinned this issue May 17, 2024
s-weigand added a commit that referenced this issue May 17, 2024
This action uses the preinstalled `miniconda` and determines its installation base path reading the `CONDA` environ variable.
Up until `macOS-12` this worked for all runner images, however `macOS-13` and `macOS-14` (current `macos-latest`) do not install `miniconda` and workflows fail with:

```
Error: The "path" argument must be of type string. Received undefined
```
See #432 

With this change, the error will be:
```
Error: Could not determine conda base path, it seams conda is not installed.
```
On any system without the `CONDA` environ variable set.
And for macos runner images > 12:
```
 Error: Could not determine conda base path, it seams conda is not installed.
  MacOS images newer than "macos-12" (i.e. "macOS-latest") are known to be incompatible with this action due to a missing miniconda installation.
  See: #432
```
@s-weigand
Copy link
Owner

s-weigand commented May 17, 2024

I did some digging + debugging and found that macos-12 was the previous macOS-latest after which macOS-latest jumped directly to macOS-14.
Both the macos-13 and macos-14 images do NOT have conda installed, so I will create an issue upstream and ask if they would accept a PR that adds it back.
For now, I just made a new release with better error handling pointing people at this issue.

As a workaround, I see 2 options:

@pauleve
Copy link
Author

pauleve commented May 18, 2024

Thank you so much for the investigation, and the workarounds.

@phdru
Copy link
Contributor

phdru commented Jun 15, 2024

So they decided there will be no Miniconda in future versions of macOS images. What next? Install Miniconda manually?

VaeterchenFrost added a commit to VaeterchenFrost/tdvisu that referenced this issue Jul 5, 2024
VaeterchenFrost added a commit to VaeterchenFrost/tdvisu that referenced this issue Jul 5, 2024
* Update python-app.yml 

- Replace conda install, see s-weigand/setup-conda#432
- Update https://github.com/actions/checkout

* Use ts-graphviz/setup-graphviz@v2

See https://github.com/marketplace/actions/setup-graphviz
Replaces `conda install -c anaconda graphviz` on MacOS

* Use psycopg2-binary 

Fixes
```
 Error: pg_config executable not found.
      
      pg_config is required to build psycopg2 from source.  Please add the directory
      containing pg_config to the $PATH or specify the full executable path with the
      option:
      
          python setup.py build_ext --pg-config /path/to/pg_config build ...
      
      or with the pg_config option in 'setup.cfg'.
      
      If you prefer to avoid building psycopg2 from source, please install the PyPI
      'psycopg2-binary' package instead.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
```

* Update setup.py
pauleve added a commit to colomoto/colomoto-conda that referenced this issue Aug 28, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants