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

Don't mutate project.deps during project write #3591

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Aug 17, 2023

Fixes #3327

Fixes parts of Pkg that weren't aware of the way that weakdeps can be listed in both [weakdeps] and [deps].
Actually was just an unwanted mutation of project.deps during writing the project out.

The mwe here now works #3327 (comment)

shell> cd foo
/Users/ian/Documents/GitHub/julia/foo

shell> git clone http://github.com/BioJulia/BioSymbols.jl
...

shell> cd BioSymbols.jl
/Users/ian/Documents/GitHub/julia/foo/BioSymbols.jl

shell> git clone http://github.com/BioJulia/FASTX.jl
...

(Pkg) pkg> activate FASTX.jl
  Activating project at `~/Documents/GitHub/julia/foo/BioSymbols.jl/FASTX.jl`

(FASTX) pkg> add .
    Updating git-repo `/Users/ian/Documents/GitHub/julia/foo/BioSymbols.jl`
   Resolving package versions...
    Updating `~/Documents/GitHub/julia/foo/BioSymbols.jl/FASTX.jl/Project.toml`
  [67c07d97] + Automa v1.0.0
  [47718e42] + BioGenerics v0.1.2
  [3c28c6f8] + BioSymbols v5.1.3 `..#master`
  [aea7be01] + PrecompileTools v1.1.2
  [354b36f9] + StringViews v1.3.3
  [3bb67fe8] + TranscodingStreams v0.9.13
    Updating `~/Documents/GitHub/julia/foo/BioSymbols.jl/FASTX.jl/Manifest.toml`
  [67c07d97] + Automa v1.0.0
  [47718e42] + BioGenerics v0.1.2
  [3c28c6f8] + BioSymbols v5.1.3 `..#master`
  [aea7be01] + PrecompileTools v1.1.2
  [21216c6a] + Preferences v1.4.0
  [354b36f9] + StringViews v1.3.3
  [3bb67fe8] + TranscodingStreams v0.9.13
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [b77e0a4c] + InteractiveUtils
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [fa267f1f] + TOML v1.0.3
  [8dfed614] + Test
  [4ec0a83e] + Unicode
     Warning The project dependencies or compat requirements have changed since the manifest was last resolved. It is recommended to `Pkg.resolve()` or consider `Pkg.update()` if necessary.
┌ Warning: The project dependencies or compat requirements have changed since the manifest was last resolved.
│ It is recommended to `Pkg.resolve()` or consider `Pkg.update()` if necessary.
└ @ Pkg.API ~/Documents/GitHub/Pkg.jl/src/API.jl:1761
Precompiling project...
  1 dependency successfully precompiled in 2 seconds. 8 already precompiled.

(FASTX) pkg> 

@KristofferC
Copy link
Member

If a dep is listed in both [deps] and [weakdeps] then (AFAIU) it should be ignored from deps. The code here is meant to take care of that:

filter!(p->!haskey(project._deps_weak, p.first), project.deps)

Is there an issue with that approach?

@IanButterworth IanButterworth force-pushed the ib/fix_stat_rep branch 2 times, most recently from 8ddcc27 to 04411a2 Compare August 18, 2023 16:07
@IanButterworth IanButterworth changed the title fix handling of weakdeps that are also deps Don't mutate project.deps during project write Aug 18, 2023
@IanButterworth
Copy link
Member Author

Kristoffer suggested this latest fix so should be good to go

@IanButterworth IanButterworth merged commit 051ab5b into JuliaLang:master Aug 18, 2023
@IanButterworth IanButterworth deleted the ib/fix_stat_rep branch August 18, 2023 17:10
IanButterworth added a commit that referenced this pull request Aug 18, 2023
IanButterworth added a commit that referenced this pull request Aug 18, 2023
@IanButterworth IanButterworth mentioned this pull request Aug 18, 2023
10 tasks
IanButterworth added a commit that referenced this pull request Aug 18, 2023
@IanButterworth IanButterworth mentioned this pull request Aug 18, 2023
14 tasks
IanButterworth added a commit that referenced this pull request Aug 18, 2023
@jishnub
Copy link
Contributor

jishnub commented Aug 30, 2023

Has this been included in Julia v1.9.3? I see the stat_rep issue on Julia v1.9.3 in https://github.com/JuliaArrays/OffsetArrays.jl/actions/runs/6022728726/job/16338079285?pr=331

@IanButterworth
Copy link
Member Author

No it will be in 1.9.4

@pkofod
Copy link
Contributor

pkofod commented Oct 14, 2023

No it will be in 1.9.4

much appreciated, this is quite annoying when developing extensions (though they are very useful, so I can live with it :) )

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

Successfully merging this pull request may close these issues.

MethodError in diff print: no method matching stat_rep(::Nothing)
4 participants