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

(micro)mamba does not respect full match spec: iqtree[build=h856ad77_2], part in square brackets is ignored #3379

Closed
corneliusroemer opened this issue Aug 1, 2024 · 8 comments

Comments

@corneliusroemer
Copy link
Contributor

corneliusroemer commented Aug 1, 2024

Describe your issue

mamba and micromamba appear to not obey the conda match spec fully.

What works with conda according to conda docs, works with neither mamba nor micromamba.

conda create -n matchspec 'iqtree[build=h856ad77_2]'
...
The following NEW packages will be INSTALLED:

  iqtree             bioconda/osx-arm64::iqtree-2.3.5-h856ad77_2 
  libcxx             conda-forge/osx-arm64::libcxx-18.1.8-h167917d_2 
  llvm-openmp        conda-forge/osx-arm64::llvm-openmp-18.1.8-hde57baf_0 

While conda correctly installs iqtree-2.3.5-h856ad77_2 as requested, this is not the case with mamba:

$ mamba create -n matchspec 'iqtree[build=h856ad77_2]'
...
  + libcxx        18.1.8  h167917d_2  conda-forge     Cached
  + llvm-openmp   18.1.8  hde57baf_0  conda-forge     Cached
  + iqtree         2.3.5  h856ad77_3  bioconda        Cached

nor with micromamba:

$ micromamba create -n matchspec 'iqtree[build=h856ad77_2]' 
...
  + libcxx        18.1.8  h167917d_2  conda-forge     Cached
  + llvm-openmp   18.1.8  hde57baf_0  conda-forge     Cached
  + iqtree         2.3.5  h856ad77_3  bioconda        Cached

This is another deviation from conda behavior that would be good to document exhaustively, see #3362

@corneliusroemer corneliusroemer changed the title (micro)mamba does not respect full match spec: iqtree[build=h856ad77_2] is wrongly treated like iqtree (micro)mamba does not respect full match spec: iqtree[build=h856ad77_2], part in square brackets is ignored Aug 1, 2024
@Hind-M
Copy link
Member

Hind-M commented Aug 1, 2024

Hi @corneliusroemer, thank you for reporting!
Can you please specify which (micro)mamba version it concerns? (1.x or main/2.0)

@corneliusroemer
Copy link
Contributor Author

Thanks @Hind-M! I'm using 1.5.8

@corneliusroemer
Copy link
Contributor Author

Oh, I see! I just installed micromamba v2 and it seems to be fixed there!

task micromamba -- create -n matchspec 'iqtree[build=h856ad77_2]' 
task: Task "_create-env" is up to date
task: Task "_copy-env" is up to date
task: Task "_configure" is up to date
task: [_build] micromamba run --prefix build/envs/dev cmake --build "build/cmake" --parallel 7 --target mamba
[  3%] Built target solv-cpp
[ 87%] Built target libmamba-dyn
[100%] Built target mamba
task: [micromamba] "/Users/corneliusromer/code/mamba/build/cmake/micromamba/mamba" create -n matchspec 'iqtree[build=h856ad77_2]'
bioconda/osx-arm64                                  ??.?MB @  ??.?MB/s  0.0s
conda-forge/osx-arm64                               10.9MB @  17.8MB/s  0.6s
conda-forge/noarch                                  15.8MB @  21.2MB/s  0.6s
bioconda/noarch                                      5.2MB @   4.1MB/s  1.2s


Transaction

  Prefix: /Users/corneliusromer/micromamba/envs/matchspec

  Updating specs:

   - iqtree=*=h856ad77_2


  Package        Version  Build       Channel           Size
──────────────────────────────────────────────────────────────
  Install:
──────────────────────────────────────────────────────────────

  + iqtree         2.3.5  h856ad77_2  bioconda        Cached
  + libcxx        18.1.8  h167917d_2  conda-forge     Cached
  + llvm-openmp   18.1.8  hde57baf_0  conda-forge     Cached

  Summary:

  Install: 3 packages

  Total download: 0 B

──────────────────────────────────────────────────────────────



Transaction starting
Linking libcxx-18.1.8-h167917d_2
Linking llvm-openmp-18.1.8-hde57baf_0
Linking iqtree-2.3.5-h856ad77_2

Transaction finished

To activate this environment, use:

    mamba activate matchspec

Or to execute a single command in this environment, use:

    mamba run -n matchspec mycommand

@corneliusroemer
Copy link
Contributor Author

corneliusroemer commented Aug 1, 2024

Congrats for supporting regexes in build strings properly by the way (in v2), conda still has bugs there, e.g. conda/conda#6965

But micromamba works as expected 🎉

 task micromamba -- create -n matchspec2 "iqtree[build='*_[^3]']" --dry-run
...
Transaction

  Prefix: /Users/corneliusromer/micromamba/envs/matchspec2

  Updating specs:

   - iqtree[build="*_[^3]"]


  Package        Version  Build       Channel           Size
──────────────────────────────────────────────────────────────
  Install:
──────────────────────────────────────────────────────────────

  + iqtree         2.3.5  h856ad77_2  bioconda        Cached
  + libcxx        18.1.8  h167917d_2  conda-forge     Cached
  + llvm-openmp   18.1.8  hde57baf_0  conda-forge     Cached

See Stackoverflow Q&A: https://stackoverflow.com/a/78820306/7483211

@Hind-M
Copy link
Member

Hind-M commented Aug 1, 2024

Nice! Glad to see that!
Kudos to @AntoinePrv for his great work on this :)

@corneliusroemer
Copy link
Contributor Author

Testing release candidates might be a bit easier if you made binaries available on GitHub releases. Building from source is super easy but it's never obvious before you try.

As the conda docs are not very explicit about the regex support, it would be super nice if you added two sentences to the docs (for v2).

@Hind-M
Copy link
Member

Hind-M commented Aug 1, 2024

You have some documentation here regarding the RegexSpec class, and a detailed explanation for how matching the specs is handled using MatchSpec here.

As for testing the release candidates, you can find the ones for micromamba here (there were some issues with this before but they are now fixed, so future RCs will be available there).

@corneliusroemer
Copy link
Contributor Author

Thanks for the doc pointers!

The RegexSpec API documentation is not really what I would be looking for as an end user, I didn't learn anything relevant there.

The usage docs are great! But they don't mention regex at all, even though it's supported. My suggestion would be to add some notes about the regex support there - it's a great feature, it's just not discoverable from your usage docs! Also, the match spec usage docs are useful beyond libmamba consumers - for mamba/micromamba users.

For example, I'd love to know how to use the more advanced match spec notation with yaml files, it might be worth including an example of something like - python[build_number=2] there: https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html#conda-yaml-spec-files

Thanks for the releases link, I totally missed that - might be worth pointing to it from the main repo releases: https://github.com/mamba-org/mamba/releases/tag/2024.03.25

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

No branches or pull requests

2 participants