From cc4fa71922e263c7b4bb11bea25c08c45a68caf2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 13 Jul 2023 12:13:41 +0200 Subject: [PATCH] Ensure Ncurses_jll is new enough (#913) Since 6.4.1 it sets TERMINFO_DIRS automatically, so we can get rid of our workaround for setting it before loading GAP. That workaround was always incomplete anyway, because while it worked for GAP's builtin GNU readline support, it is also needed for the `Browse` packages. But for that it only works if `Browse` is loaded during GAP startup, which is not always the case: with a fresh GAP.jl installation, won't have been compiled yet. The user may now try to compile/install it via `GAP.Packages.install` resp. `GAP.Packages.load`. All kinds of things can go wrong at that point (including that it may end up linking against the "wrong"). Note that we do not even load `Ncurses_jll` directly; this is done indirectly via `GAP_jll`. So the only reason it now appears in `Project.toml` is to ensure a "new enough" version of it is used. At some point in the future this should probably instead be moved to `GAP_jll`. --- Project.toml | 2 ++ src/GAP.jl | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 32ace1c7..e855d7ce 100644 --- a/Project.toml +++ b/Project.toml @@ -13,6 +13,7 @@ GMP_jll = "781609d7-10c4-51f6-84f2-b8444358ff6d" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" +Ncurses_jll = "68e3532b-a499-55ff-9963-d1c0c0748b3a" Pidfile = "fa939f87-e72e-5be4-a000-7fc836dbe307" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" @@ -24,6 +25,7 @@ GAP_jll = "~400.1200.101" GAP_lib_jll = "~400.1201.100" GAP_pkg_juliainterface_jll = "=0.800.201, =0.800.202" MacroTools = "0.5" +Ncurses_jll = "6.4.1" Pidfile = "1.3" Scratch = "1.1" julia = "1.6" diff --git a/src/GAP.jl b/src/GAP.jl index 171ae69d..62e81ca1 100644 --- a/src/GAP.jl +++ b/src/GAP.jl @@ -286,13 +286,7 @@ function __init__() push!(cmdline_options, "-b") end - - # The following withenv is needed to get readline input to work right; see also - # https://github.com/JuliaPackaging/Yggdrasil/issues/455 and - # https://github.com/oscar-system/GAP.jl/issues/415 - withenv("TERMINFO_DIRS" => joinpath(GAP_jll.Readline_jll.Ncurses_jll.find_artifact_dir(), "share", "terminfo")) do - initialize(cmdline_options) - end + initialize(cmdline_options) if !show_banner # Leave it to GAP's `LoadPackage` whether package banners are shown.