Skip to content

Solver.lookup ignores solver versions #187

Open

Description

@informarte

The --solver option of minizinc supports solver versions (e.g. --solver my-solver@1.0) 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.

Activity

  1. added
    enhancementNew feature or request
    bugSomething isn't working
    and removed
    enhancementNew feature or request
    on Dec 11, 2024
  2. Dekker1 commented on Dec 11, 2024

    @Dekker1
    Member

    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("my-solver@1.0") 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. my-solver@1.0.0, my-solver@1.0, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions