s-weigand / setup-conda

This action adds the `conda` command from the on the worker preinstalled miniconda version to the known shell commands.
Apache License 2.0
61 stars 7 forks source link

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

Open pauleve opened 5 months ago

pauleve commented 5 months ago

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 commented 5 months ago

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 https://github.com/s-weigand/setup-conda/blob/2a87cac8fc661ce424d5a8123733e5cc376ef318/src/conda_actions.ts#L62-L63 I will have a closer look at the weekend if I manage to find the time.

s-weigand commented 5 months ago

@all-contributors please add @pauleve for bug

allcontributors[bot] commented 5 months ago

@s-weigand

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

s-weigand commented 5 months ago

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 commented 5 months ago

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

phdru commented 4 months ago

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