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

Pkg reorders Project.toml with extensions in Julia 1.6 #3481

Open
gdalle opened this issue May 17, 2023 · 8 comments
Open

Pkg reorders Project.toml with extensions in Julia 1.6 #3481

gdalle opened this issue May 17, 2023 · 8 comments

Comments

@gdalle
Copy link
Contributor

gdalle commented May 17, 2023

I have a package with extensions. When I update or resolve the environment, it seems that different things happen depending on the Julia version.

  • In Julia 1.6, Pkg reorders the sections of the Project.toml file like so

    deps
    compat
    extensions
    extras
    targets
    weakdeps

  • In Julia 1.7 through 1.9, Pkg reorders the sections of the Project.toml file like so:

    deps
    weakdeps
    extensions
    compat
    extras
    targets

This causes issues for automated quality checking with Aqua.jl (JuliaTesting/Aqua.jl#105). Is there a rationale behind this behavior?

@KristofferC
Copy link
Sponsor Member

Is there a rationale behind this behavior?

1.6 doesn't know about extensions.

@gdalle
Copy link
Contributor Author

gdalle commented May 17, 2023

Of course, but the reordering itself causes CI failures when packages

  1. use extensions for 1.9 and above
  2. are still compatible with 1.6 and below
  3. run tests with Aqua in CI

which is an increasingly common combination

Example: https://github.com/gdalle/ImplicitDifferentiation.jl/actions/runs/5001651819

@KristofferC
Copy link
Sponsor Member

You asked about the rationale for the behavior. And that is because 1.6 does not know about extensions?

@gdalle
Copy link
Contributor Author

gdalle commented May 17, 2023

Ok that's fair :) Follow-ups then:

  • Why does it change starting at 1.7?
  • Is it an issue that can be solved at the Pkg level or that should be tackled only in Aqua?

@KristofferC
Copy link
Sponsor Member

In order for it to be fixed in Julia there needs to be a new 1.6 release, it seems easier if possible to add a workaround in Aqua.

Why it is different on 1.7 I don't know.

@gdalle
Copy link
Contributor Author

gdalle commented May 17, 2023

Ok cool, thanks for the answers! I'll try to fix it in Aqua, and at least the topic is out there in case someone else wonders

@jishnub
Copy link
Contributor

jishnub commented Jul 17, 2023

In general, is it expected that resolve may alter a Project.toml file, or is this a bug? My impression was that a Project.toml is entirely specified by the developer, and from the perspective of an end user who may resolve or instantiate the package, this is read-only.

@KristofferC
Copy link
Sponsor Member

I think it is fixed so that it is only written to if the content changed. But that might be after 1.6.

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

3 participants