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

Implement [md5=...] package specifier #2053

Closed
jonashaag opened this issue Oct 26, 2022 · 9 comments · Fixed by #3233
Closed

Implement [md5=...] package specifier #2053

jonashaag opened this issue Oct 26, 2022 · 9 comments · Fixed by #3233
Assignees
Labels
type::feature-request New feature proposal
Projects

Comments

@jonashaag
Copy link
Collaborator

Mamba does not support specifying md5/sha256=:

$ mamba install 'pkg=...[md5=...]'
CondaValueError: invalid package specification: pkg=...[md5=...]

$ micromamba install 'pkg=...[md5=...]'
# Will just ignore the md5= restriction.
@jonashaag jonashaag added the type::feature-request New feature proposal label Oct 26, 2022
@jonashaag
Copy link
Collaborator Author

It's not obvious to me how to add this:

  • In libsolv? So far libsolv only understands name, version, and build.
  • As some sort of pre/post filter in libmamba?

@wolfv @AntoinePrv

@AntoinePrv
Copy link
Member

The way it is done for channel-specific jobs is a filtering done on Mamba side, because it is not supported directly by libsolv, one could do the same here.

I'm not a big fan of having the version/dependency specs in libsolv, exactly for this sort of reason. A goal of mine through this refactoring of the solver API is to get back those functions in Mamba, and somehow pass them to libsolv as a callback.
Then this can all be handled through the MatchSpec class, without custom solver logic everywhere.

@jonashaag what is your priority on this?

@jonashaag
Copy link
Collaborator Author

Thanks for the insights. I think we're fine with using the build string for now, but would definitely want to have a strict check in the future.

@AntoinePrv
Copy link
Member

If it is not too urgent, it could be done as part of the #2302 plan.

@wolfv
Copy link
Member

wolfv commented Feb 17, 2023

yeah this would be very nice. libsolv knows about the md5 / sha256 hashes (they are stored in the Solvable), but one would indeed have to add that as additional "SOLVABLE_ONE_OF" queue (although selecting might be easy).

The md5 hash is stored as SOLVABLE_PKGID (https://github.com/mamba-org/mamba/blob/b46dbbf1b167db78c11a6e6c5348ebc6c6304f1f/libmamba/src/core/package_info.cpp#LL141C43-L141C57) and the sha256 sum is stored as SOLVABLE_CHECKSUM.

I think it could be done with libsolv today but yeah, it would be much nicer to have the proper MatchSpec support that @AntoinePrv mentions.

@jonashaag jonashaag added this to To Do in QC Mar 24, 2023
@jonashaag
Copy link
Collaborator Author

With the lastest Mamba, [md5=...] is ignored for both Micromamba and Mamba

@jonashaag
Copy link
Collaborator Author

Works with Conda.

@AntoinePrv
Copy link
Member

With the lastest Mamba, [md5=...] is ignored for both Micromamba and Mamba

@jonashaag yes that is still the case.

As mention, my preference is to implement this as part of a fully-featured MatchSpec class (we'll have to see how we plug it into libsolv but I have an idea 🤞). Otherwise we keep accumulating hacks.

If this is high priority, we can totally implement Wolf's suggestion in the meantime.

@AntoinePrv AntoinePrv self-assigned this Jul 18, 2023
@jonashaag
Copy link
Collaborator Author

Not a high priority for us right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature-request New feature proposal
Projects
QC
To Do (by priority)
Development

Successfully merging a pull request may close this issue.

3 participants