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

Handle registrying things that don't support the version of julia that the CI is running #430

Open
oxinabox opened this issue Aug 3, 2021 · 4 comments

Comments

@oxinabox
Copy link
Contributor

oxinabox commented Aug 3, 2021

Right now Automerge runs julika 1.6
If you register a package release that only supporst say 1.0 or 1.7
then it will fail with

* I was not able to install the package (i.e. `Pkg.add("TestEnv")` failed). See the CI logs for details.

* I was not able to load the package (i.e. `import TestEnv` failed). See the CI logs for details.

E.g JuliaRegistries/General#42120

The ideal thing to do would be to make sure the CI was running the right version.
Probably an OK thing to do would be to just auto-pass those tests.
It is unusual for someone not to support the current release of julia
and anyone who does probably knows what they are doing.

@oxinabox
Copy link
Contributor Author

oxinabox commented Aug 3, 2021

A extra challenging case is if a package says it supports say julia ^1.0
but it depends on some package that only supports ~1.3
then that really should be tested on 1.3.
but can't work that out without actually resolving the dependencies

@DilumAluthge
Copy link
Member

I don't think we should auto-pass, necessarily. Probably the best thing to do is to figure out what Julia version is needed, and run Pkg.add and import checks against that.

@oxinabox
Copy link
Contributor Author

oxinabox commented Aug 3, 2021

I don't think we should auto-pass, necessarily. Probably the best thing to do is to figure out what Julia version is needed, and run Pkg.add and import checks against that.

I agree that is the best thing.
But it sounds hard, and may be harder than it is worth.
but otoh maybe it is easier than i think

@oxinabox
Copy link
Contributor Author

Sadly, Pkg does not throw a rich exception type that we can just read the information from


julia> try
       Pkg.add("Diffractor")
       catch e
       global err
       err=e
       end
   Resolving package versions...
Pkg.Resolve.ResolverError("Unsatisfiable requirements detected for package \e[38;5;75mDiffractor [9f5e2b26]\e[39m:\n \e[38;5;75mDiffractor [9f5e2b26]\e[39m log:\n ├─possible versions are: \e[38;5;75m0.2.0-0.2.1\e[39m or uninstalled\n ├─restricted to versions \e[38;5;75m*\e[39m by an explicit requirement, leaving only versions: \e[38;5;75m0.2.0-0.2.1\e[39m\n └─restricted by julia compatibility requirements to versions: uninstalled — no versions left", nothing)

julia> err
Pkg.Resolve.ResolverError("Unsatisfiable requirements detected for package \e[38;5;75mDiffractor [9f5e2b26]\e[39m:\n \e[38;5;75mDiffractor [9f5e2b26]\e[39m log:\n ├─possible versions are: \e[38;5;75m0.2.0-0.2.1\e[39m or uninstalled\n ├─restricted to versions \e[38;5;75m*\e[39m by an explicit requirement, leaving only versions: \e[38;5;75m0.2.0-0.2.1\e[39m\n └─restricted by julia compatibility requirements to versions: uninstalled — no versions left", nothing)

julia> err.
ex   msg
julia> err.ex

julia> err.msg
"Unsatisfiable requirements detected for package \e[38;5;75mDiffractor [9f5e2b26]\e[39m:\n \e[38;5;75mDiffractor [9f5e2b26]\e[39m log:\n ├─possible versions are: \e[38;5;75m0.2.0-0.2.1\e[39m or uninstalled\n ├─restricted to versions \e[38;5;75m*\e[39m by an explicit requirement, leaving only versions: \e[38;5;75m0.2.0-0.2.1\e[39m\n └─restricted by julia compatibility requirements to versions: uninstalled — no versions left"

Maybe as a basic good enough approach we could just check err isa ResolverError && contains(err.msg, "restricted by julia compatibility requirements")

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