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

'L' is not recognized as an internal or external command, operable program or batch file. #473

Closed
giumas opened this issue Oct 20, 2024 · 5 comments · Fixed by #475
Closed

Comments

@giumas
Copy link

giumas commented Oct 20, 2024

Describe the bug
On Windows using:

    - name: setup-conda
      uses: s-weigand/setup-conda@v1
      with:
        update-conda: true
        python-version: '3.11'
        conda-channels: 'conda-forge'

I get this error:

  D:\a\test\test>L "C:\Miniconda\condabin\..\Scripts\conda.exe"   update -y -n base -c defaults conda 
  'L' is not recognized as an internal or external command,
  operable program or batch file.
  Error: The process 'C:\Miniconda\Library\bin\conda.bat' failed with exit code 9009

Expected behavior
No error

Desktop:

  • OS: Windows

Additional context
A job with the issue: https://github.com/hydroffice/hyo2_abc2/actions/runs/11424333844/job/31784538534
The issue goes away by setting: update-conda: false -> https://github.com/hydroffice/hyo2_abc2/actions/runs/11424333842/job/31784538535

@s-weigand
Copy link
Owner

@giumas Thanks for the bug report.

I can reproduce the issue and it seems to caused by conda.bat daisy-chaining.
When the update command is called it uses C:\Miniconda\Library\bin\conda.bat (C:\Windows\system32\cmd.exe /D /S /C "C:\Miniconda\Library\bin\conda.bat update -y -n base -c defaults conda")

:: Copyright (C) 2012 Anaconda, Inc
:: SPDX-License-Identifier: BSD-3-Clause
@CALL "%~dp0..\..\condabin\conda.bat" %*

which in turn calls C:\Miniconda\condabin\conda.bat

:: Copyright (C) 2012 Anaconda, Inc
:: SPDX-License-Identifier: BSD-3-Clause

@IF NOT DEFINED _CE_CONDA @(
  @SET _CE_M=
  @SET "CONDA_EXE=%~dp0..\Scripts\conda.exe"
)
@IF [%1]==[activate]   "%~dp0_conda_activate" %*
@IF [%1]==[deactivate] "%~dp0_conda_activate" %*

@SET CONDA_EXES="%CONDA_EXE%" %_CE_M% %_CE_CONDA%
@CALL %CONDA_EXES% %*

@IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

@IF [%1]==[install]   "%~dp0_conda_activate" reactivate
@IF [%1]==[update]    "%~dp0_conda_activate" reactivate
@IF [%1]==[upgrade]   "%~dp0_conda_activate" reactivate
@IF [%1]==[remove]    "%~dp0_conda_activate" reactivate
@IF [%1]==[uninstall] "%~dp0_conda_activate" reactivate

@EXIT /B %ERRORLEVEL%

Which then ultimately calls C:\Miniconda\Scripts\conda.exe with the arguments.

For some reason, it seems that the @CALL isn't interpreted correctly and a rogue L ends up in the final call (L "C:\Miniconda\condabin\..\Scripts\conda.exe" update -y -n base -c defaults conda ), which causes the error.

@s-weigand
Copy link
Owner

@all-contributors please add @giumas for bug

Copy link
Contributor

@s-weigand

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

@s-weigand
Copy link
Owner

@giumas I just released a v1.2.3 and it should work again

@giumas
Copy link
Author

giumas commented Oct 20, 2024

@giumas I just released a v1.2.3 and it should work again

Yep, I can confirm it! https://github.com/hydroffice/hyo2_abc2/actions/runs/11425933602/job/31788220443

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants