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

Solver.lookup ignores solver versions #187

Open
informarte opened this issue Dec 11, 2024 · 1 comment
Open

Solver.lookup ignores solver versions #187

informarte opened this issue Dec 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@informarte
Copy link

The --solver option of minizinc supports solver versions (e.g. --solver [email protected]) by considering the version information provided by the solver definitions. Solver.lookup, however, ignores version information, i.e. it chooses a random version if several versions are installed. This lack of functionality makes it hard to compare different versions of a solver. The only way is to deinstall or disable (by removing solver definition files) all versions except for one, test it, then change the setup, and so on. It's a tedious and error-prone process.

@Dekker1 Dekker1 added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Dec 11, 2024
@Dekker1
Copy link
Member

Dekker1 commented Dec 11, 2024

It appears that the version addition is currently never added to the list of tags it uses to find the solver. However, I'm very surprised that the information would just be ignored. Looking at the code, I would expect that Solver.lookup("[email protected]") would always result in an exception: https://github.com/MiniZinc/minizinc-python/blob/develop/src/minizinc/solver.py#L139-L143

I think there are two things to be done here:

  1. To add tags that include the version: split at major, split at minor, or full version. This would allow the lookup for version annotated identifiers, e.g. [email protected], [email protected], and my-solver@1.
  2. To ensure that the tag maps for identifiers remain in sorted order. This would ensure that if multiple version of my-solver are present, then the newest version can be chosen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants