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

[JLLs] Cap JLLs to HDF5_jll v1.12 #84160

Merged
merged 1 commit into from
May 24, 2023

Conversation

mkitti
Copy link
Contributor

@mkitti mkitti commented May 24, 2023

Here is the Julia code that I helped to do to set the caps. After this, I did some manual edits while reviewing the diff.

julia> function find_hdf5_jll(; query="HDF5_jll")
                  compat_dict = Dict{String, Dict{String,Bool}}()
                  for(root, dirs, files) in walkdir(".")
                      for file in files
                          if file == "Deps.toml" || file == "Compat.toml"
                              fullfile = joinpath(root,file)
                              lines = filter(contains(query), readlines(fullfile))
                              if !isempty(lines)
                                  printstyled(fullfile, ": "; color=:green)
                                  println.(lines)
                                  compat_dict[root] = get(compat_dict, root, Dict{String,Bool}())
                                  if file == "Deps.toml"
                                      deps_toml = TOML.parsefile(fullfile)
                                      for v in keys(deps_toml)
                                          compat_dict[root][v] = haskey(deps_toml[v], query)
                                      end
                                  elseif file == "Compat.toml"
                                      compat_toml = TOML.parsefile(fullfile)
                                      for v in keys(compat_toml)
                                          compat_dict[root][v] = haskey(compat_toml[v], query)
                                      end
                                  end
                              end
                          end
                      end
                  end
                  return compat_dict
              end

julia> function process_compat_toml(d, deps_dict)
                  fullfile = joinpath(d, "Compat.toml")
                  toml_dict = TOML.parsefile(fullfile)
                  for (k, v) in deps_dict
                      if v
                          if !haskey(toml_dict, k)
                              toml_dict[k] = Dict{String, Any}()
                          end
                          toml_dict[k]["HDF5_jll"] = "1.12"
                      end
                  end
                  toml_dict
              end

# Different from the OpenSSL code is that I set sorted = true for TOML.print
julia> function edit_compat_tomls(compat_dict; do_not_write = false)
                  for d in keys(compat_dict)
                      toml_dict = process_compat_toml(d, compat_dict[d])
                      if !do_not_write
                          open(joinpath(d, "Compat.toml"), "w") do io
                              TOML.print(io, toml_dict; sorted = true)
                          end
                      end
                      TOML.print(toml_dict; sorted = true)
                  end
              end

@mkitti
Copy link
Contributor Author

mkitti commented May 24, 2023

Ping @giordano

@eschnett
Copy link

I believe that the version 1.12 is deemed compatible with 1.14, which we want to avoid. According to https://pkgdocs.julialang.org/v1/compatibility/, we need to use ~1.12 instead.

@mkitti
Copy link
Contributor Author

mkitti commented May 24, 2023

I believe that the version 1.12 is deemed compatible with 1.14, which we want to avoid. According to https://pkgdocs.julialang.org/v1/compatibility/, we need to use ~1.12 instead.

The ranges here are explict. They have already been "lowered" from semver. A semver compat declaration of ~1.12 translates to a range of just 1.12.

julia> Pkg.Types.semver_spec("~1.12") |> print
1.12
julia> Pkg.Types.semver_spec("~1.12.0") |> print
1.12
julia> Pkg.Types.semver_spec("~1.12.1") |> print
1.12.1-1.12
julia> Pkg.Types.semver_spec("~1.12.2") |> print
1.12.2-1.12
julia> Pkg.Types.semver_spec("1.12") |> print
1.12.0-1

@giordano
Copy link
Member

Yeah, the syntax of compat bounds we use in Package.toml is different from what's here in the registry.

@giordano giordano merged commit 5608824 into JuliaRegistries:master May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants