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

Alien versionning through callbacks #523

Open
AntoinePrv opened this issue Feb 27, 2023 · 1 comment
Open

Alien versionning through callbacks #523

AntoinePrv opened this issue Feb 27, 2023 · 1 comment

Comments

@AntoinePrv
Copy link
Contributor

Hello,

Say users would like to use the libsolv but have an extremely complicated or private versioning and dependency scheme (unicode why not, or some database lookup). What functions would they need to provide to work with libsolv?

Taking inspiration from conda functions (I am actually investigating this in the context of Mamba), it seems that around six functions would be required:

// Compare two version as ` const char*`
int pool_evrcmp_alien(const Pool *pool, const char *evr1, const char *evr2, int mode);
// Check if a solvable matches a given version
int solvable_alien_matchversion(Solvable *s, const char *version);
// Add solvables satifying the version to whatprovides. Could it be derived from the solvable_alien_matchversion?
Id pool_addrelproviders_alien(Pool *pool, Id name, Id evr, Queue *plist);
// Split a reldep into name/evr
Id pool_alien_matchspec(Pool *pool, const char *name);
// Add negative exclusion rules between `n` and `dep`
void add_conda_constrains_rule(Solver *solv, Id n, Id dep, int dontfix);
// Some function to set solution priority (policy)
...

For repository specifications, the users could write their own repo_add_alien without requiring modification in libsolv.

Is that a reasonable view of how libsolv handles different format? Would you consider a PR that lets user define their own REL_ALIEN/DISTTYPE_ALIEN by providing function callbacks?

@mlschroe
Copy link
Member

Just a random remark: one of the really useful features is that the solver can write a testcase that can be analyzed later with the testsolv tool. That would no longer work with a custom version comparison.

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