From d4f84b521bab13f57b355a979120455e34db0954 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 28 Jan 2024 19:23:42 -0500 Subject: [PATCH 1/3] AutoMerge: temporarily disable the "Require `[compat]` for stdlib dependencies" feature" --- src/AutoMerge/guidelines.jl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/AutoMerge/guidelines.jl b/src/AutoMerge/guidelines.jl index eda343bb..5b88baad 100644 --- a/src/AutoMerge/guidelines.jl +++ b/src/AutoMerge/guidelines.jl @@ -1,5 +1,9 @@ using HTTP: HTTP +# TODO: change this to `true` once Julia 1.6 is no longer +# the LTS. +const _AUTOMERGE_REQUIRE_STDLIB_COMPAT = false + const guideline_registry_consistency_tests_pass = Guideline(; info="Registy consistency tests", docs=nothing, @@ -91,8 +95,15 @@ function meets_compat_for_all_deps(working_directory::AbstractString, pkg, versi for version_range in keys(deps) if version in Pkg.Types.VersionRange(version_range) for name in keys(deps[version_range]) - if !is_jll_name(name) - @debug("Found a new (non-JLL) dependency: $(name)") + if _AUTOMERGE_REQUIRE_STDLIB_COMPAT + debug_msg = "Found a new (non-JLL) dependency: $(name)" + apply_compat_requirement = !is_jll_name(name) + else + debug_msg = "Found a new (non-stdlib non-JLL) dependency: $(name)" + apply_compat_requirement = !is_jll_name(name) && !is_julia_stdlib(name) + end + if apply_compat_requirement + @debug debug_msg dep_has_compat_with_upper_bound[name] = false end end From 9c2136db9d58ee7fd9a8447868521ec34dd9464a Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 28 Jan 2024 19:27:23 -0500 Subject: [PATCH 2/3] Add more detail to a comment --- src/AutoMerge/guidelines.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/AutoMerge/guidelines.jl b/src/AutoMerge/guidelines.jl index 5b88baad..d9276638 100644 --- a/src/AutoMerge/guidelines.jl +++ b/src/AutoMerge/guidelines.jl @@ -1,7 +1,10 @@ using HTTP: HTTP -# TODO: change this to `true` once Julia 1.6 is no longer -# the LTS. +# TODO: change this value to `true` once we are ready to re-enable the +# "Require `[compat]` for stdlib dependencies" feature. +# +# For example, we might consider changing this value to `true` +# once Julia 1.6 is no longer the LTS. const _AUTOMERGE_REQUIRE_STDLIB_COMPAT = false const guideline_registry_consistency_tests_pass = Guideline(; From 46b5d7069710a05e0ea2fd385918db23ab7f48ae Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Mon, 29 Jan 2024 11:12:03 -0500 Subject: [PATCH 3/3] Restore the `is_julia_stdlib` and `julia_stdlib_list` functions --- src/AutoMerge/util.jl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/AutoMerge/util.jl b/src/AutoMerge/util.jl index 5ac7b5c7..ba1c889b 100644 --- a/src/AutoMerge/util.jl +++ b/src/AutoMerge/util.jl @@ -239,6 +239,20 @@ function comment_text_merge_now() return result end +is_julia_stdlib(name) = name in julia_stdlib_list() + +function julia_stdlib_list() + stdlib_list = readdir(Pkg.Types.stdlib_dir()) + # Before Julia v1.6 Artifacts.jl isn't a standard library, but + # we want to include it because JLL packages depend on the empty + # placeholder https://github.com/JuliaPackaging/Artifacts.jl + # in older versions for compatibility. + if VERSION < v"1.6.0" + push!(stdlib_list, "Artifacts") + end + return stdlib_list +end + function now_utc() utc = TimeZones.tz"UTC" return Dates.now(utc)