Skip to content

Test lower compat bounds? #378

Closed
Closed

Description

@oschulz

The current DocStringExtensions = "0.9.3" makes DifferentiationInterface incompatible with some packages that are still stuck on DocStringExtensions v0.8. Would it be possible to relax the version bound?

Activity

  1. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    Oh yes definitely. I wonder why CompatHelper didn't pick it up. Care to open a PR?

  2. oschulz commented on Jul 25, 2024

    @oschulz
    ContributorAuthor

    I wonder why CompatHelper didn't pick it up

    Because I wanted to extend it downwards to DocStringExtensions = "0.8, 0.9", not upwards. :-) But I can't find the package anymore that caused the trouble, maybe my dependencies are all v0.9-compatible now. I'll close this for now ...

  3. oschulz commented on Jul 25, 2024

    @oschulz
    ContributorAuthor

    In any case, since DifferentiationInterface wil (hopefully) be wide used, maybe we could use https://github.com/julia-actions/julia-downgrade-compat to keep the dependency version bounds wide, but in a safe manner?

  4. changed the title [-]Relax DocStringExtensions version bound?[/-] [+]Use julia-downgrade-compat?[/+] on Jul 25, 2024
  5. adrhill commented on Jul 25, 2024

    @adrhill
    Collaborator

    Sounds like a great idea, thanks!

  6. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    While a good idea in principle, downgrade compat testing is more tricky than it looks because I perform Pkg operations inside the DI test suite. The DI test suite is split into one CI workflow per AD backend, and each of those workflows activates a custom environment like DI/test/Back/Diffractor/Project.toml. This is designed to avoid instantiating an environment with all backends at once, which is very tricky due to conflicts (especially on older versions of said backends).
    The trouble with this method is that compat bounds of the DI package are not enforced in the environment activated on top of the test environment, which is why I had to explicitly bound Diffractor for instance. So I'm not sure how the GitHub action you refer to will handle that.

  7. adrhill commented on Jul 25, 2024

    @adrhill
    Collaborator

    each of those workflows activates a custom environment like DI/test/Back/Diffractor/Project.toml.

    This could possibly be handled through the projects argument:
    https://github.com/julia-actions/julia-downgrade-compat?tab=readme-ov-file#usage

    # Comma-separated list of Julia projects to modify. The Project.toml files in all of
    # these directories will be modified.
    # Example: ., test, docs
    # Default: .
    projects: ''
  8. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    I don't think so because the individual Project.toml files don't store the compatibility bounds of AD backends for DI: that's stored in the main Project.toml file. So we would need a way to enforce these bounds in the stacked environment.

  9. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    Maybe we could add the packages of test/.../Project.toml to the current environment instead of activating a new one? Not sure if there is a command for that

  10. adrhill commented on Jul 25, 2024

    @adrhill
    Collaborator

    Could you point me to the location where the /test/Back environments get activated?

  11. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    And a separate mechanism is at work for adding

    because otherwise Pkg will try to grab it from the general registry

  12. adrhill commented on Jul 25, 2024

    @adrhill
    Collaborator

    To the best of my understanding, the way julia-downgrade-compat works is by simply rewriting the Project.toml files at the specified projects paths.

    If we first activate DI/Project.toml before activating Pkg.activate(joinpath(@__DIR__, category, folder)), wouldn't the downgraded compat entries be enforced in the /test/BACK environments as well?

  13. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    No because compat bounds of environments deeper in the LOAD_PATH stack are not necessarily enforced:

    Side note: activating one then the other is not enough, we need to push the former into the LOAD_PATH before activating the latter

  14. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    I thought it was cleaner to store this stuff in a Project.toml but maybe I can just write the list of packages explicitly. Let me open a quick PR.

  15. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    See #381, if tests pass on this one you can rebase #380 on it afterwards @adrhill

  16. adrhill commented on Jul 25, 2024

    @adrhill
    Collaborator

    #380 reveals some annoying properties of the julia-downgrade-compat action.
    It looks like it rewrites the Project.toml to only keep the lowest compat entry, which often can't be properly resolved.

    For example, the tests on #380 fail because SparseMatrixColorings has its DocStringExtensions compat entry set to v0.9:

    ERROR: LoadError: Unsatisfiable requirements detected for package SparseMatrixColorings [0a514795]:
     SparseMatrixColorings [0a514795] log:
     ├─possible versions are: 0.1.0-0.3.5 or uninstalled
     ├─restricted to versions 0.3.0 by DifferentiationInterface [a0c0ee7d], leaving only versions 0.3.0
     │ └─DifferentiationInterface [a0c0ee7d] log:
     │   ├─possible versions are: 0.5.9 or uninstalled
     │   └─DifferentiationInterface [a0c0ee7d] is fixed to version 0.5.9
     └─restricted by compatibility requirements with DocStringExtensions [ffbed154] to versions: 0.1.0 or uninstalled — no versions left
       └─DocStringExtensions [ffbed154] log:
         ├─possible versions are: 0.4.6-0.9.3 or uninstalled
         └─restricted to versions 0.8.0 by DifferentiationInterface [a0c0ee7d], leaving only versions 0.8.0
           └─DifferentiationInterface [a0c0ee7d] log: see above

    So these tests might be a headache in the future.

  17. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    Oh yeah I remember that discussion, essentially it tries to resolve all lower bounds at the same time.

    https://discourse.julialang.org/t/psa-add-downgrade-ci-to-better-check-version-compatibility/110063/15?u=gdalle

  18. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    @adrhill can you modify #380 by

  19. adrhill commented on Jul 25, 2024

    @adrhill
    Collaborator

    undoing https://github.com/gdalle/DifferentiationInterface.jl/pull/379 so that Pkg installs v0.9 of DocStringExtensions

    I bet that doing this will just reveal another dependency conflict.

    I suggest we keep #379 (which @oschulz needs) and don't use julia-downgrade-compat until there is a way to automatically resolve an environment with lower compat bounds. We can't be the ones the manually resolve all lower bounds. Quoting from discourse:

    trying to use [julia-downgrade-compat] on a big package with many deps just felt like a total waste of time. It needs to do something smarter than just pinning everything to the minimum versions.

  20. gdalle commented on Jul 25, 2024

    @gdalle
    Member

    I bet that doing this will just reveal another dependency conflict.

    Or maybe not, that's my hope.

    If that's the only problem, JuliaDiff/SparseMatrixColorings.jl#31 should be enough to fix it for good

  21. adrhill commented on Jul 25, 2024

    @adrhill
    Collaborator

    I bet that doing this will just reveal another dependency conflict.

    Or maybe not, that's my hope.

    If not, then that's pure luck.

    We'll encounter the same problem of having to manually resolve lower compat bounds every time we need to modify lower bounds. And that's going to happen every time we require a new feature from a new release of any dependency.

  22. added
    testRelated to the testing subpackage
    on Jul 29, 2024
  23. adrhill commented on Aug 1, 2024

    @adrhill
    Collaborator

    While we should test lower compat bounds, julia-downgrade-compat doesn't seem to be the answer for DI. We tried using it in #380, but it currently requires manual resolving of dependencies, which should ideally be handled by Pkg rather than a human. This problem was discussed on Discourse as well.

    A proposal to add down to Pkg can be found here: JuliaLang/Pkg.jl#1062
    Until this is added, this issue will probably have to be left open.

  24. changed the title [-]Use julia-downgrade-compat?[/-] [+]Test lower compat bounds?[/+] on Aug 1, 2024
  25. locked and limited conversation to collaborators on Jan 17, 2025
  26. converted this issue into a discussion #682 on Jan 17, 2025
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

    testRelated to the testing subpackagewontfixThis will not be worked on

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions