conda / conda-lock

Lightweight lockfile for conda environments
https://conda.github.io/conda-lock/
Other
459 stars 102 forks source link

Simple reproducer for virtual PackageRecord error #408

Closed maresb closed 11 months ago

maresb commented 1 year ago

This is a lingering point of major breakage. Fails on both 1.4.0 and main.

Seems related to #202, #292, #381.

docker run --rm -it mambaorg/micromamba
micromamba install -y -c conda-forge mamba conda-lock git
mamba --version
# mamba 1.4.2
# conda 23.3.1
cat <<EOF > environment.yml
channels:
- conda-forge
dependencies:
- git
platforms:
- osx-64
EOF
conda-lock
pip install git+https://github.com/conda/conda-lock@4a667bd  # main, right after merging #290
conda-lock
STDERR: ```python PackageRecord(_hash=-2262511397987521167, name='__osx', version='0', build='0', build_number=0, channel=Channel("@"), subdir='osx-64', fn='__osx', md5='12345678901234567890123456789012', package_type='virtual_system') Traceback (most recent call last): File "/opt/conda/bin/conda-lock", line 10, in sys.exit(main()) ^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 1353, in lock lock_func( File "/opt/conda/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 1083, in run_lock make_lock_files( File "/opt/conda/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 408, in make_lock_files lock_content = lock_content | create_lockfile_from_spec( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 801, in create_lockfile_from_spec deps = _solve_for_arch( ^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/conda_lock/conda_lock.py", line 723, in _solve_for_arch conda_deps = solve_conda( ^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/conda_lock/conda_solver.py", line 168, in solve_conda dry_run_install = solve_specs_for_arch( ^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/conda_lock/conda_solver.py", line 355, in solve_specs_for_arch proc.check_returncode() File "/opt/conda/lib/python3.11/site-packages/conda_lock/_vendor/poetry/utils/_compat.py", line 168, in check_returncode raise CalledProcessError( conda_lock._vendor.poetry.utils._compat.CalledProcessError: Command '['/opt/conda/bin/mamba', 'create', '--prefix', '/tmp/tmpfeqdnq88/prefix', '--dry-run', '--json', '--override-channels', '--channel', 'conda-forge', '--channel', 'file:///tmp/tmpekcnto8c', 'git']' returned non-zero exit status 1. ```
maresb commented 1 year ago

Workaround: pin conda to 22.9

lesteve commented 1 year ago

I think the issue with the glibc virtual package has been fixed in https://github.com/conda/conda/pull/12293. There is a very similar one with the osx virtual package though, I have opened https://github.com/conda/conda/pull/12715 that hopefully will fix this.

maresb commented 1 year ago

Wonderful, thanks so much!!!

Once this is released, it seems to me like we should be checking the Conda version in use by Mamba, and warn if it's older.

maresb commented 11 months ago

Conda v23.7.0 just became available. I am hoping that this is now completely solved. Please try and report back.

maresb commented 11 months ago

This should be solved by using the latest version of Conda. Ref: https://github.com/sagemath/sage/pull/35986#issuecomment-1656713210

lesteve commented 11 months ago

Just seeing this now, very nice to see this fixed!

maresb commented 11 months ago

Agreed, thank you @lesteve for fixing it!!!