Closed dalcinl closed 1 year ago
This seems like a https://github.com/mamba-org/mamba bug.
Have you tried running the action in debug mode to see if you get more informative error messages?
(Or set log-level: trace
for even more debug messages)
Another alternative is to use https://github.com/mxschmitt/action-tmate to debug your failing CI.
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
- uses: mxschmitt/action-tmate@v3
With this, you can try to execute micromamba create -n test python=3.7 pypy pip
manually in CI.
This is the raw log after setting log-level: trace
.
The log ends with the following not much informative (for me) output:
2023-08-24T16:36:20.8074446Z trace libmamba linking 'site-packages/wheel/wheelfile.py'
2023-08-24T16:36:20.8075119Z trace libmamba hard-linked 'C:\Users\runneradmin\micromamba\pkgs\wheel-0.41.2-pyhd8ed1ab_0\site-packages\wheel\wheelfile.py'
2023-08-24T16:36:20.8075706Z --> 'C:\Users\runneradmin\micromamba\envs\test\Lib\site-packages\wheel\wheelfile.py'
2023-08-24T16:36:20.8075966Z debug libmamba 33 files linked
2023-08-24T16:36:20.8076692Z info libmamba Running wrapped python compilation command C:\Users\runneradmin\micromamba\envs\test\python.exe -Wi -u C:\Users\RUNNER~1\AppData\Local\Temp\mambaf4zCMDaaHrp
2023-08-24T16:36:20.8124392Z info libmamba Compiling 27 files to pyc
2023-08-24T16:36:20.8125201Z trace libmamba entry point path: "Scripts\\wheel"
2023-08-24T16:36:20.8125447Z
2023-08-24T16:36:20.8126326Z error libmamba Error opening for writing "C:\\Users\\runneradmin\\micromamba\\envs\\test\\Scripts\\wheel-script.py": No such file or directory
2023-08-24T16:36:20.8126815Z error libmamba Error opening for writing "C:\\Users\\runneradmin\\micromamba\\envs\\test\\Scripts\\wheel.exe": No such file or directory
2023-08-24T16:36:20.8127276Z debug libmamba Unlocking 'C:\Users\runneradmin\micromamba\envs\test\conda-meta'
2023-08-24T16:36:20.8127810Z trace libmamba Removing lock on 'C:\Users\runneradmin\micromamba\envs\test\conda-meta\conda-meta.lock'
2023-08-24T16:36:20.8128733Z trace libmamba Removing file 'C:\Users\runneradmin\micromamba\envs\test\conda-meta\conda-meta.lock'
2023-08-24T16:36:22.0308310Z critical libmamba permissions: The system cannot find the path specified.: "C:\Users\runneradmin\micromamba\envs\test\Scripts\wheel.exe"
2023-08-24T16:36:22.0534584Z D:\a\_actions\mamba-org\setup-micromamba\v1\dist\index.js:4447
2023-08-24T16:36:22.0535729Z error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
2023-08-24T16:36:22.0551624Z ^
2023-08-24T16:36:22.0555242Z
2023-08-24T16:36:22.0561802Z Error: The process 'C:\Users\runneradmin\micromamba-bin\micromamba.exe' failed with exit code 1
2023-08-24T16:36:22.0564263Z at ExecState._setResult (D:\a\_actions\mamba-org\setup-micromamba\v1\dist\index.js:4447:21)
2023-08-24T16:36:22.0565545Z at ExecState.CheckComplete (D:\a\_actions\mamba-org\setup-micromamba\v1\dist\index.js:4433:16)
2023-08-24T16:36:22.0566355Z at ChildProcess.<anonymous> (D:\a\_actions\mamba-org\setup-micromamba\v1\dist\index.js:4336:21)
2023-08-24T16:36:22.0566874Z at ChildProcess.emit (node:events:513:28)
2023-08-24T16:36:22.0568454Z at maybeClose (node:internal/child_process:1100:16)
2023-08-24T16:36:22.0568932Z at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
I can try the tmate route, too. Any extra tips at what should I look at?
Unfortunately not, I'm also not that experienced in Windows with conda environments :( Maybe you could also try to open an issue at https://github.com/mamba-org/mamba with your reproducer?
@jonashaag I believe I've found the issue. libmamba is not ensuring that the output folder <prefix>\envs\{envname}\Scripts
exists before creating *-script.py
and *.exe
entry points.
A possible and easy fix is to add a few lines of code somewere before this line:
if (!fs::exists(script_path.parent_path()))
{
fs::create_directories(script_path.parent_path());
}
Cool, would you be interested in sending a PR?
Is there any way to reproduce this issue reliable? Would be great if we were able to write a test for it
Submitting PR to fix the issue is trivial. However, testing is another story, I have very little Windows experience, not even as a user. I believe the issue can be reliably reproduced just by trying to create a new environment with spec python=3.7 pypy
and the conda-forge
channel. If you can point me to the right place to add such a test, I could try to draft a PR someday next week.
I think you should be able to add some code to https://github.com/mamba-org/mamba/blob/main/micromamba/tests/test_linking.py or https://github.com/mamba-org/mamba/blob/main/micromamba/tests/test_install.py.
Minimal reproducer
Error output
Additional information
Using
python=3.8/3.9 pypy
works just fine. I'm not a Windows expert, and I do not have ready access to a physical machine or VM to debug things further manually. However, I can help trying any suggestions you may have on GHA.