From 3c40c303ecba0c4e02697dd61f6adefa2749be98 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Wed, 31 May 2023 12:01:44 +0200 Subject: [PATCH] Fixes for compilation with gcc 13.1 (#1381) --- alire.toml | 2 +- deps/gnatcoll-slim | 2 +- src/alire/alire-crate_configuration.adb | 1 + src/alire/alire-index_on_disk-loading.adb | 1 - src/alire/alire-solutions.ads | 11 +++++++++++ src/alire/alire-solver.adb | 5 +---- src/alr/alr-commands-search.adb | 1 - 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/alire.toml b/alire.toml index cda0dcd2..ec059b8c 100644 --- a/alire.toml +++ b/alire.toml @@ -48,7 +48,7 @@ windows = { ALIRE_OS = "windows" } aaa = { url = "https://github.com/mosteo/aaa", commit = "906d9eaf4fb8efabfbc3d8cfb34d04ceec340e13" } ada_toml = { url = "https://github.com/mosteo/ada-toml", commit = "da4e59c382ceb0de6733d571ecbab7ea4919b33d" } clic = { url = "https://github.com/alire-project/clic", commit = "8d26222de71014554999e48c821906fca0e3dc41" } -gnatcoll = { url = "https://github.com/alire-project/gnatcoll-core.git", commit = "92bb91130a9ec628b4c48b7ef9fe7f24d9dc25fa" } +gnatcoll = { url = "https://github.com/alire-project/gnatcoll-core.git", commit = "403efe11405113cf12ae3d014df474cf7a046176" } semantic_versioning = { url = "https://github.com/alire-project/semantic_versioning", commit = "2f23fc5f6b4855b836b599adf292fed9c0ed4144" } simple_logging = { url = "https://github.com/alire-project/simple_logging", commit = "3505dc645f3eef6799a486aae223d37e88cfc4d5" } stopwatch = { url = "https://github.com/mosteo/stopwatch", commit = "f607a63b714f09bbf6126de9851cbc21cf8666c9" } diff --git a/deps/gnatcoll-slim b/deps/gnatcoll-slim index 92bb9113..403efe11 160000 --- a/deps/gnatcoll-slim +++ b/deps/gnatcoll-slim @@ -1 +1 @@ -Subproject commit 92bb91130a9ec628b4c48b7ef9fe7f24d9dc25fa +Subproject commit 403efe11405113cf12ae3d014df474cf7a046176 diff --git a/src/alire/alire-crate_configuration.adb b/src/alire/alire-crate_configuration.adb index 5434f0e6..d1c376f4 100644 --- a/src/alire/alire-crate_configuration.adb +++ b/src/alire/alire-crate_configuration.adb @@ -937,6 +937,7 @@ package body Alire.Crate_Configuration is else Raise_Checked_Error ("Invalid profile value: " & TTY.Error (Img) & " in profile list: " & Parse_Profiles.Img); + pragma Warnings (Off, "unreachable code"); raise Program_Error; -- Unreachable end if; end To_Profile; diff --git a/src/alire/alire-index_on_disk-loading.adb b/src/alire/alire-index_on_disk-loading.adb index 289cf7ea..8ef736c7 100644 --- a/src/alire/alire-index_on_disk-loading.adb +++ b/src/alire/alire-index_on_disk-loading.adb @@ -279,7 +279,6 @@ package body Alire.Index_On_Disk.Loading is if not Outcome.Success then Raise_Checked_Error ("Could not add community index: " & Message (Outcome)); - return; end if; end; end if; diff --git a/src/alire/alire-solutions.ads b/src/alire/alire-solutions.ads index 19149c4f..285a6496 100644 --- a/src/alire/alire-solutions.ads +++ b/src/alire/alire-solutions.ads @@ -430,6 +430,17 @@ package Alire.Solutions is -- a safe-order traversal of a solution. This procedure is currently -- sequential but it could be parallelized in the future. + function Pin_Dependencies (This : Solution; + Crate : Crate_Name; + Props : Alire.Properties.Vector) + return Conditional.Dependencies + is (if This.State (Crate).Has_Release + then This.State (Crate).Release.Dependencies (Props) + else Conditional.No_Dependencies); + -- If Crate is pinned in This and it has a release, return its + -- dependencies; otherwise return Empty. WORKAROUND FOR VISIBILITY BUG + -- IN GCC 13.1 + private type Solution is new Interfaces.Tomifiable with record diff --git a/src/alire/alire-solver.adb b/src/alire/alire-solver.adb index b4660153..96977d18 100644 --- a/src/alire/alire-solver.adb +++ b/src/alire/alire-solver.adb @@ -871,10 +871,7 @@ package body Alire.Solver is Seen => State.Seen.Union (To_Set (Raw_Dep)), Expanded => State.Expanded and Dep, Target => State.Remaining and - (if Pins.State (Dep.Crate).Has_Release - then Pins.State (Dep.Crate) - .Release.Dependencies (Props) - else Empty), + Pins.Pin_Dependencies (Dep.Crate, Props), Remaining => Empty, Solution => Solution.Linking (Dep.Crate, diff --git a/src/alr/alr-commands-search.adb b/src/alr/alr-commands-search.adb index d35cda91..4332cbb6 100644 --- a/src/alr/alr-commands-search.adb +++ b/src/alr/alr-commands-search.adb @@ -92,7 +92,6 @@ package body Alr.Commands.Search is Tab.Append (Ext.Image); end List_Undetected; - use Alire.Releases.Containers.Release_Sets; begin -- First, simpler case of search into crates -- 2.39.5