mamba icon indicating copy to clipboard operation
mamba copied to clipboard

Version Parsing Error for String Versions in Lockfiles

Open jchorl opened this issue 1 year ago • 1 comments

Troubleshooting docs

  • [X] My problem is not solved in the Troubleshooting docs

Anaconda default channels

  • [X] I do NOT use the Anaconda default channels (pkgs/* etc.)

How did you install Mamba?

Other (please describe)

Search tried in issue tracker

Found invalid version predicate

Latest version of Mamba

  • [X] My problem is not solved with the latest version

Tried in Conda?

I didn't try

Describe your issue

With the latest unreleased micromamba changes, some version parsing is broken for lockfiles.

Consider conda-locking cansnper. environment.yml:

channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - cansnper==1.0.10
platforms:
  - linux-64

I've attached a lockfile, but instructions to generate the lock below if relevant[0]. Note that I needed to rename .yml to .yml for github to accept it.

cansnper-conda-lock.yml.txt

(base) mambauser@cf2d91509d43:/work$ ./build/micromamba/micromamba create -y -n joshtest -f cansnper-conda-lock.yml 
Empty environment created at prefix: /opt/conda/envs/joshtest
critical libmamba Error while reading environment lockfile located at '/work/cansnper-conda-lock.yml': Found invalid version predicate in "snapshot_2015_02_13"

The issue seems to come from this segment of the lockfile:

- name: progressivemauve
  version: snapshot_2015_02_13
  manager: conda
  platform: linux-64
  dependencies: {}
  url: https://conda.anaconda.org/bioconda/linux-64/progressivemauve-snapshot_2015_02_13-h9ee0642_3.tar.bz2
  hash:
    md5: ce9aacf888162f053d6cf57be037ade1
    sha256: 7bb0a154d5de142dbf7f52b01106c984dc1a61ac7567f01c7b107f1b48849df3
  category: main
  optional: false

I'm not sure what changed with version parsing but I saw commits fly by.

0: Here is how I generated the lockfile:

docker run -it --rm \
    mambaorg/micromamba:1.5.6 \
    bash
(base) mambauser@9de7639dd8f9:/work$ micromamba install --channel=conda-forge --name=base conda-lock
(base) mambauser@9de7639dd8f9:/work$ conda-lock -f environment.yml

mamba info / micromamba info

(base) mambauser@cf2d91509d43:/work$ ./build/micromamba/micromamba info

       libmamba version : 2.0.0
     micromamba version : 2.0.0
           curl version : libcurl/8.5.0 OpenSSL/3.2.0 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
     libarchive version : libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5
       envs directories : /opt/conda/envs
          package cache : /opt/conda/pkgs
                          /home/mambauser/.mamba/pkgs
            environment : base (active)
           env location : /opt/conda
      user config files : /home/mambauser/.mambarc
 populated config files : 
       virtual packages : __unix=0=0
                          __linux=5.15.0=0
                          __glibc=2.36=0
                          __archspec=1=x86_64-v4
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
       base environment : /opt/conda
               platform : linux-64

Logs

Empty environment created at prefix: /opt/conda/envs/joshtest
critical libmamba Error while reading environment lockfile located at '/work/cansnper-conda-lock.yml': Found invalid version predicate in "snapshot_2015_02_13"

environment.yml

channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - cansnper==1.0.10
platforms:
  - linux-64

~/.condarc

No response

jchorl avatar Jan 07 '24 17:01 jchorl

I think this is because versions are required to start with a number. Maybe this used to work (or failed to fail) with Conda or libsolv.

1snapshot_2023_05_03 would be a valid version I think.

My preference would be not to fix this. Versions in conda are already too complex IMHO.

AntoinePrv avatar Jan 19 '24 14:01 AntoinePrv