mamba icon indicating copy to clipboard operation
mamba copied to clipboard

micromamba 2.0 gives '!__mamba_name!' at a CI on Windows

Open certik opened this issue 1 year ago • 4 comments

https://github.com/lfortran/lfortran/issues/4919

I can reproduce it locally by installing micromamba and trying to activate it:

~$ cmd /c 'C:\Users\ondrejcertik\AppData\Roaming\mamba\Scripts\activate.bat'

C:\Users\ondrejcertik>set "__mamba_filename=micromamba.exe"

C:\Users\ondrejcertik>set "__mamba_filename=micromamba.exe"

C:\Users\ondrejcertik>!__mamba_name! activate
'!__mamba_name!' is not recognized as an internal or external command,
operable program or batch file.

For the above I was using:

~$ micromamba --version
2.0.0

This seems like a regression, since it wasn't doing it before at the CI. However, we have the micromamba setup pinned in GitHub actions:

https://github.com/lfortran/lfortran/blob/27c7a8284036d4d00bf3385c10cb0bb44809d515/.github/workflows/CI.yml#L30

So it should not be using micromamba 2.0, but 1.8. I don't understand the problem yet.

Either way, the above looks like a bug.

Update: so there are two bugs here. One bug is that micromamba was upgraded to 2.0 even though it is pinned at 1.8 at the CI (https://github.com/mamba-org/setup-micromamba/issues/226):

https://github.com/lfortran/lfortran/actions/runs/11048843229/job/30693104865?pr=4912

image

And the second bug is that micromamba 2.0 gives the '!__mamba_name!' is not recognized error, that's this issue.

As a quick workaround, is there a way to pin micromamba to version 1.8?

Update: to pin micromamba, one can just use micromamba-version: '1.5.10-0', I was pinning it incorrectly. So there is just one bug, that micromamba 2.0 gives '!__mamba_name!' and a workaround is to downgrade to micromamba 1.5.10-0.

certik avatar Sep 26 '24 20:09 certik

The versions of setup-micromamba and micromamba are orthogonal. setup-micromamba will always download the latest available release of micromamba except if you explicitly tell it to use a specific version of micromamba:

- uses: mamba-org/setup-micromamba@v1
  with:
    micromamba-version: '1.5.10-0'

The shell init command of micromamba 2 is indeed broken on Windows, we are currently investigating it.

JohanMabille avatar Sep 27 '24 17:09 JohanMabille

@JohanMabille yes, I figured this version thing out after I posted and updated my comments above yesterday. Sorry about that.

certik avatar Sep 27 '24 18:09 certik

No worries, I just wanted to be sure you had the workaround to fix your CI, I missed your edit. I should have answered faster, sorry for that.

JohanMabille avatar Sep 27 '24 19:09 JohanMabille

This has been fixed in micromamba 2.0.2.

Regarding the CI, setup-microamba@v1 has been updated to NOT pull micromamba 2 if you don't specify any version, it will pull the latest 1.x of micromamba.

setup-micromamba@v2 pulls the latest micromamba (i.e. 2.0.2 as of today), this should make the migration easier.

JohanMabille avatar Oct 04 '24 08:10 JohanMabille

This might have been fixed by 2.0.4 which is being released.

jjerphan avatar Nov 25 '24 08:11 jjerphan

This might have been fixed by 2.0.4 which is being released.

This is confirmed by the workflow of https://github.com/lfortran/lfortran/pull/5013.

jjerphan avatar Nov 26 '24 16:11 jjerphan