From 9433dd1b2462b494996e49d1946f8a8cdf2078e2 Mon Sep 17 00:00:00 2001 From: "Alejandro R. Mosteo" Date: Tue, 12 Sep 2023 20:57:20 +0200 Subject: [PATCH] Remove old release-sharing mechanism remnants --- src/alire/alire-dependencies-states.adb | 6 -- src/alire/alire-dependencies-states.ads | 21 +------ src/alire/alire-solutions-diffs.adb | 24 -------- src/alire/alire-solutions.adb | 14 ++--- src/alire/alire-solutions.ads | 3 +- src/alire/alire-solver.adb | 57 ++++--------------- src/alire/alire-solver.ads | 5 -- src/alire/alire-toolchains-solutions.adb | 3 +- src/alire/alire-toolchains.adb | 11 ++-- src/alire/alire-toolchains.ads | 6 +- .../tests/solver/compiler-installed/test.py | 14 ++--- .../tests/solver/compiler-mixing/test.py | 16 +++--- .../tests/solver/compiler-priorities/test.py | 14 ++--- .../tests/solver/compiler-selected/test.py | 8 +-- testsuite/tests/toolchain/directories/test.py | 6 +- 15 files changed, 58 insertions(+), 150 deletions(-) diff --git a/src/alire/alire-dependencies-states.adb b/src/alire/alire-dependencies-states.adb index 818db6a76..44e75ab18 100644 --- a/src/alire/alire-dependencies-states.adb +++ b/src/alire/alire-dependencies-states.adb @@ -58,7 +58,6 @@ package body Alire.Dependencies.States is Pinned : constant String := "pinned"; Reason : constant String := "reason"; Release : constant String := "release"; - Shared : constant String := "shared"; Transitivity : constant String := "transitivity"; Versions : constant String := "versions"; @@ -124,8 +123,6 @@ package body Alire.Dependencies.States is "release: " & (+Crate)), Manifest.Index, Strict => False)); -- because it may come from elsewhere - Data.Shared := - From.Checked_Pop (Keys.Shared, TOML_Boolean).As_Boolean; end case; return Data; @@ -194,9 +191,6 @@ package body Alire.Dependencies.States is (Keys.Release, This.Fulfilled.Release.Constant_Reference.To_TOML (Manifest.Index)); - Table.Set - (Keys.Shared, - Create_Boolean (This.Fulfilled.Shared)); end case; end To_TOML; diff --git a/src/alire/alire-dependencies-states.ads b/src/alire/alire-dependencies-states.ads index 597ae86c3..3b7b27427 100644 --- a/src/alire/alire-dependencies-states.ads +++ b/src/alire/alire-dependencies-states.ads @@ -68,8 +68,7 @@ package Alire.Dependencies.States is -- Modify transitivity in a copy of Base function Solving (Base : State; - Using : Releases.Release; - Shared : Boolean := False) + Using : Releases.Release) return State with Pre => Using.Provides (Base.Crate); -- Uses release to fulfill this dependency in a copy of Base @@ -108,8 +107,6 @@ package Alire.Dependencies.States is function Is_Provided (This : State) return Boolean; -- True when the release name is different from the dependency crate - function Is_Shared (This : State) return Boolean; - function Is_User_Pinned (This : State) return Boolean; -- From the POV of users, pinning to version or linking to dir is a pin @@ -227,7 +224,6 @@ private Opt_Rel : Stored_Release; -- This might not be filled-in when Solved => Release : Stored_Release; -- This is always valid - Shared : Boolean; -- The release is from shared install when Missed => Reason : Missed_Reasons := Skipped; -- Until solving is attempted when others => null; @@ -319,9 +315,6 @@ private & (if This.Has_Release then ",release" else "") - & (if This.Is_Shared - then ",installed" - else "") else "") & (if This.Pinning.Pinned then ",pin=" & This.Pinning.Version.Image @@ -353,9 +346,6 @@ private function Is_Provided (This : State) return Boolean is (This.Has_Release and then This.Release.Name /= This.Crate); - function Is_Shared (This : State) return Boolean - is (This.Fulfilled.Fulfillment = Solved and then This.Fulfilled.Shared); - function Is_Solved (This : State) return Boolean is (This.Fulfilled.Fulfillment = Solved); @@ -538,14 +528,12 @@ private ------------- function Solving (Base : State; - Using : Releases.Release; - Shared : Boolean := False) + Using : Releases.Release) return State is (Base.As_Dependency with Name_Len => Base.Name_Len, Fulfilled => (Fulfillment => Solved, - Release => To_Holder (Using), - Shared => Shared), + Release => To_Holder (Using)), Pinning => Base.Pinning, Transitivity => Base.Transitivity); @@ -582,9 +570,6 @@ private & (if This.Has_Release then "," & TTY.OK ("release") else "") - & (if This.Is_Shared - then "," & TTY.Emph ("installed") - else "") else "") & (if This.Pinning.Pinned then "," & TTY.Emph ("pin") diff --git a/src/alire/alire-solutions-diffs.adb b/src/alire/alire-solutions-diffs.adb index d102b5afd..ed854037e 100644 --- a/src/alire/alire-solutions-diffs.adb +++ b/src/alire/alire-solutions-diffs.adb @@ -22,7 +22,6 @@ package body Alire.Solutions.Diffs is Unpinned, -- A release being unpinned Unchanged, -- An unchanged dependency/release Missing, -- A missing dependency - Shared, -- A release used from the shared installed releases Binary -- A binary, system or external release ); @@ -42,7 +41,6 @@ package body Alire.Solutions.Diffs is when Unpinned => TTY.Emph (U ("🎈")), -- alts: π©’πŸŽˆ when Unchanged => TTY.OK (U ("=")), when Missing => TTY.Error (U ("❗")), -- alts: βš οΈβ—β€ΌοΈ - when Shared => TTY.Emph (U ("♻️ ")), -- alts: β™»β™»οΈβ™ΌπŸ«΄ when Binary => TTY.Warn (U ("πŸ“¦"))) else (case Change is @@ -55,7 +53,6 @@ package body Alire.Solutions.Diffs is when Unpinned => U ("o"), when Unchanged => U ("="), when Missing => U ("!"), - when Shared => U ("i"), when Binary => U ("b") )); @@ -179,25 +176,6 @@ package body Alire.Solutions.Diffs is end if; end Fulfil_Change; - -------------------- - -- Sharing_Change -- - -------------------- - - procedure Sharing_Change is - begin - if (not Has_Former or else not Former.Is_Shared) - and then Has_Latter and then Latter.Is_Shared - then - Add_Change (Chg, Icon (Shared), TTY.Emph ("installed")); - - elsif Has_Former and then Former.Is_Shared - and then Has_Latter and then not Latter.Is_Shared - then - Add_Change (Chg, "", TTY.Emph ("local")); - - end if; - end Sharing_Change; - -------------------------- -- transitivity_changed -- -------------------------- @@ -369,8 +347,6 @@ package body Alire.Solutions.Diffs is Fulfil_Change; - Sharing_Change; - Provider_Change; Transitivity_Changed; diff --git a/src/alire/alire-solutions.adb b/src/alire/alire-solutions.adb index 02797e698..ce1274cd3 100644 --- a/src/alire/alire-solutions.adb +++ b/src/alire/alire-solutions.adb @@ -429,8 +429,7 @@ package body Alire.Solutions is Release : Alire.Releases.Release; Env : Properties.Vector; For_Dependency : Optional.Crate_Name := Optional.Crate_Names.Empty; - Add_Dependency : Boolean := False; - Shared : Boolean := False) + Add_Dependency : Boolean := False) return Solution is Dep_Name : constant Crate_Name := (if Add_Dependency @@ -459,8 +458,7 @@ package body Alire.Solutions is Result.Dependencies := Result.Dependencies.Including (Result.State (Dep_Name).Solving - (Release.Whenever (Env), - Shared => Shared)); + (Release.Whenever (Env))); -- TODO: remove this Whenever once dynamic expr can be exported elsif Result.State (Dep_Name).Is_Hinted then Result := Result.Hinting (Result.State (Dep_Name).As_Dependency); @@ -484,7 +482,7 @@ package body Alire.Solutions is Result.Dependencies := Result.Dependencies.Including (This.State (Dep.Crate) - .Solving (Release.Whenever (Env), Shared => Shared)); + .Solving (Release.Whenever (Env))); end if; end loop; @@ -743,8 +741,6 @@ package body Alire.Solutions is else "") & (if Dep.Is_Pinned or else Dep.Is_Linked then TTY.Emph (" (pinned)") - elsif Dep.Is_Shared - then TTY.Emph (" (installed)") else "") & (if Detailed then " (origin: " @@ -1466,10 +1462,10 @@ package body Alire.Solutions is begin -- Visit first dependencies that do not have releases (and hence no - -- dependencies) or that are preinstalled. + -- dependencies). for Dep of This.Dependencies loop - if not Dep.Has_Release or else Dep.Is_Shared then + if not Dep.Has_Release then Visit (Dep); end if; end loop; diff --git a/src/alire/alire-solutions.ads b/src/alire/alire-solutions.ads index ca6a1e498..cacac1885 100644 --- a/src/alire/alire-solutions.ads +++ b/src/alire/alire-solutions.ads @@ -97,8 +97,7 @@ package Alire.Solutions is Release : Alire.Releases.Release; Env : Properties.Vector; For_Dependency : Optional.Crate_Name := Optional.Crate_Names.Empty; - Add_Dependency : Boolean := False; - Shared : Boolean := False) + Add_Dependency : Boolean := False) return Solution with Pre => Add_Dependency xor diff --git a/src/alire/alire-solver.adb b/src/alire/alire-solver.adb index fe6adab4e..867b82a40 100644 --- a/src/alire/alire-solver.adb +++ b/src/alire/alire-solver.adb @@ -257,7 +257,7 @@ package body Alire.Solver is -- to select the solver behavior (e.g. stop after the first complete -- solution is found). - Installed : constant Releases.Containers.Release_Set := + Tools : constant Releases.Containers.Release_Set := Toolchains.Available (Detect_Externals => Options.Detecting = Detect); @@ -396,8 +396,7 @@ package body Alire.Solver is ------------------ procedure Expand_Value (Dep : Dependencies.Dependency; - Raw_Dep : Dependencies.Dependency; - Allow_Shared : Boolean) is + Raw_Dep : Dependencies.Dependency) is -- Dep is the unique dependency in the solution that aglutinates -- all dependencies on the same crate that have been seen to date. -- Raw_Dep, instead, is the simple dependency that is being tested @@ -509,11 +508,11 @@ package body Alire.Solver is Trace.Debug ("SOLVER: gnat PASS " & Boolean' - (Installed.Contains (R))'Image + (Tools.Contains (R))'Image & " for " & R.Milestone.TTY_Image & " due to installed compiler availability."); - return Installed.Contains (R); + return Tools.Contains (R); else @@ -530,10 +529,8 @@ package body Alire.Solver is ----------- procedure Check (R : Release; - Is_Shared : Boolean; Is_Reused : Boolean) is - use all type Origins.Kinds; begin -- Special compiler checks are hardcoded when the dependency is @@ -614,7 +611,6 @@ package body Alire.Solver is ("SOLVER: dependency FROZEN: " & R.Milestone.Image & " to satisfy " & Dep.TTY_Image & (if Is_Reused then " with REUSED" else "") & - (if Is_Shared then " with INSTALLED" else "") & (if not R.Provides.Is_Empty then " also providing " & R.Provides.Image_One_Line else "") & @@ -632,10 +628,7 @@ package body Alire.Solver is Solution => Solution.Including (R, Props, For_Dependency => - Optional.Crate_Names.Unit (Dep.Crate), - Shared => - Is_Shared or else - R.Origin.Kind = Binary_Archive))); + Optional.Crate_Names.Unit (Dep.Crate)))); end; end if; end Check; @@ -741,7 +734,7 @@ package body Alire.Solver is Trace.Debug ("SOLVER short-cutting due to version pin" & " with valid release in index"); - Check (Release, Is_Shared => False, Is_Reused => False); + Check (Release, Is_Reused => False); end loop; -- There may be no satisfying releases, or even so the @@ -788,22 +781,6 @@ package body Alire.Solver is -- will have to), we should do this globally since this is -- information common to all search states. - ------------------ - -- Check_Shared -- - ------------------ - - procedure Check_Shared is - begin - - -- Solve with all installed dependencies that satisfy it - - for R of reverse Installed.Satisfying (Dep) loop - Satisfiable := True; - Check (R, Is_Shared => True, Is_Reused => False); - end loop; - - end Check_Shared; - use type Alire.Dependencies.Dependency; --------------------- @@ -893,8 +870,6 @@ package body Alire.Solver is for In_Sol of Solution.Dependencies_Providing (Dep.Crate) loop if In_Sol.Has_Release then Check (In_Sol.Release, - Is_Shared => - In_Sol.Is_Shared, Is_Reused => True); end if; end loop; @@ -903,17 +878,6 @@ package body Alire.Solver is end if; - if Allow_Shared then - - -- There is a shared release we can use for this dependency; we - -- prefer this option first. If more solutions than the first - -- complete one are sought, we can still try without the shared - -- release. - - Check_Shared; - - end if; - if Pins.Depends_On (Dep.Crate) and then Pins.State (Dep.Crate).Is_Pinned then @@ -959,9 +923,9 @@ package body Alire.Solver is (R.Satisfies (Dep) and then (Dep.Crate /= GNAT_Crate or else - Installed.Contains (R))); + Tools.Contains (R))); - Check (R, Is_Shared => False, Is_Reused => False); + Check (R, Is_Reused => False); end Consider; begin Trace.Debug ("SOLVER: considering" @@ -1191,10 +1155,10 @@ package body Alire.Solver is -- Add or merge dependency .Dependency (State.Target.Value.Crate), -- And use it in expansion - Raw_Dep => State.Target.Value, + Raw_Dep => State.Target.Value -- We also pass the plain dependency for the -- Seen collection inside the search state. - Allow_Shared => Options.Sharing = Allow_Shared); + ); elsif State.Target.Is_Vector then if State.Target.Conjunction = Anded then @@ -1362,7 +1326,6 @@ package body Alire.Solver is Exhaustive => Options.Exhaustive, Detecting => Options.Detecting, Hinting => Options.Hinting, - Sharing => Options.Sharing, Timeout => Options.Timeout, Timeout_More => Options.Timeout_More, Elapsed => Timer.Elapsed, diff --git a/src/alire/alire-solver.ads b/src/alire/alire-solver.ads index 238811388..7eb7d6c7d 100644 --- a/src/alire/alire-solver.ads +++ b/src/alire/alire-solver.ads @@ -57,10 +57,6 @@ package Alire.Solver is -- releases will be used normally; otherwise a crate with only externals -- will always cause failure. - type Sharing_Policies is (Allow_Shared, Only_Local); - -- * Allow_Shared: crates in the shared config can appear in solutions. - -- * Only_Local: only crates in the local workspace will be used. - type Timeout_Policies is (Ask, -- Normal interaction with user Stop, -- Abort at first timeout @@ -134,7 +130,6 @@ package Alire.Solver is -- only the given Completeness is used. Detecting : Detection_Policies := Detect; Hinting : Hinting_Policies := Hint; - Sharing : Sharing_Policies := Allow_Shared; On_Timeout : Timeout_Policies := Ask; Timeout : Duration := 5.0; diff --git a/src/alire/alire-toolchains-solutions.adb b/src/alire/alire-toolchains-solutions.adb index 11a53119c..288cf8ebc 100644 --- a/src/alire/alire-toolchains-solutions.adb +++ b/src/alire/alire-toolchains-solutions.adb @@ -58,8 +58,7 @@ package body Alire.Toolchains.Solutions is (Target => Tool_Milestone (Tool), Detect_Externals => Tool_Is_External (Tool)), Env => Root.Platform_Properties, - Add_Dependency => True, - Shared => True); + Add_Dependency => True); else Trace.Debug ("Toolchain environment: tool not in solution nor " & "defined by the user: " & Tool.TTY_Image); diff --git a/src/alire/alire-toolchains.adb b/src/alire/alire-toolchains.adb index a96abbe3a..5ba56ec9c 100644 --- a/src/alire/alire-toolchains.adb +++ b/src/alire/alire-toolchains.adb @@ -191,7 +191,7 @@ package body Alire.Toolchains is -- whole system. We only offer external compilers detected in the -- environment.) - -- Deploy as a shared install unless external + -- Deploy to toolchains location unless external if Release.Origin.Is_Index_Provided then Toolchains.Deploy (Release); @@ -503,7 +503,7 @@ package body Alire.Toolchains is Stop := False; if Kind (Item) = Directory then if Exists (Full_Name (Item) / Paths.Crate_File_Name) then - Trace.Debug ("Detected shared release at " + Trace.Debug ("Detected toolchain release at " & TTY.URL (Full_Name (Item))); Result.Include @@ -512,12 +512,13 @@ package body Alire.Toolchains is Source => Manifest.Index, Strict => True)); else - Warnings.Warn_Once ("Unexpected folder in shared crates path: " - & TTY.URL (Full_Name (Item))); + Warnings.Warn_Once + ("Unexpected folder in toolchain crates path: " + & TTY.URL (Full_Name (Item))); end if; else - Warnings.Warn_Once ("Unexpected file in shared crates path: " + Warnings.Warn_Once ("Unexpected file in toolchain crates path: " & TTY.URL (Full_Name (Item))); end if; end Detect; diff --git a/src/alire/alire-toolchains.ads b/src/alire/alire-toolchains.ads index 4b232b45e..d2848e071 100644 --- a/src/alire/alire-toolchains.ads +++ b/src/alire/alire-toolchains.ads @@ -125,8 +125,8 @@ package Alire.Toolchains is -- Constraint_Error if not among Available. function Path return Any_Path; - -- Returns the base folder in which all shared releases live, defaults to - -- /toolchains + -- Returns the base folder in which all toolchain releases live, defaults + -- to /toolchains procedure Deploy (Release : Releases.Release; Location : Any_Path := Path); @@ -139,7 +139,7 @@ package Alire.Toolchains is or else raise Checked_Error with Errors.Set ("Requested release is not installed: " & Release.Milestone.TTY_Image); - -- Remove a release from the shared location for the configuration + -- Remove a release from the toolchains location for the configuration procedure Remove (Target : Milestones.Milestone; diff --git a/testsuite/tests/solver/compiler-installed/test.py b/testsuite/tests/solver/compiler-installed/test.py index 25a59082d..2b2e95373 100644 --- a/testsuite/tests/solver/compiler-installed/test.py +++ b/testsuite/tests/solver/compiler-installed/test.py @@ -31,7 +31,7 @@ # Check that a generic dependency results in the external being used alr_with("gnat") -match_solution(f"gnat={version} (gnat_external) (installed)", escape=True) +match_solution(f"gnat={version} (gnat_external)", escape=True) # Check that requesting a version different to the one externally available # results in missing compiler, as Alire won't try to install one. @@ -44,34 +44,34 @@ run_alr("toolchain", "--install", "gnat_cross_2") run_alr("update") -match_solution("gnat=1.0.0 (gnat_cross_2) (installed)", escape=True) +match_solution("gnat=1.0.0 (gnat_cross_2)", escape=True) # Likewise, if we install a native compiler, it will be preferred to a # cross-compiler. run_alr("toolchain", "--install", "gnat_native") run_alr("update") -match_solution("gnat=8888.0.0 (gnat_native) (installed)", escape=True) +match_solution("gnat=8888.0.0 (gnat_native)", escape=True) # If we remove the version exclusion, the external compiler will still be # preferred as there is no selected compiler yet. alr_with("gnat", delete=True, manual=False) alr_with("gnat") -match_solution(f"gnat={version} (gnat_external) (installed)", escape=True) +match_solution(f"gnat={version} (gnat_external)", escape=True) # But, if the user selects a compiler as preferred, it will be used first run_alr("config", "--set", "toolchain.use.gnat", "gnat_cross_2=7777.0.0") run_alr("update") -match_solution("gnat=1.0.0 (gnat_cross_2) (installed)", escape=True) +match_solution("gnat=1.0.0 (gnat_cross_2)", escape=True) # Finally, if the crate requests explicitly an uninstalled compiler, it will be # downloaded, installed, and used before the rest of installed compilers. alr_with("gnat_cross_1") -match_solution("gnat=9999.0.0 (gnat_cross_1) (installed)", escape=True) -match_solution("gnat_cross_1=9999.0.0 (installed)", escape=True) +match_solution("gnat=9999.0.0 (gnat_cross_1)", escape=True) +match_solution("gnat_cross_1=9999.0.0", escape=True) # Verify it was actually installed p = run_alr("toolchain") assert_match(".*gnat_cross_1\s+9999.0.0\s+Available", p.out) diff --git a/testsuite/tests/solver/compiler-mixing/test.py b/testsuite/tests/solver/compiler-mixing/test.py index 8323a5b14..a8fd3fc3c 100644 --- a/testsuite/tests/solver/compiler-mixing/test.py +++ b/testsuite/tests/solver/compiler-mixing/test.py @@ -39,14 +39,14 @@ # gnat x gnat results in the external available compiler being used, preferred # over the native also available compiler (but not selected) -match_solution(f"gnat={version} (gnat_external) (installed)", +match_solution(f"gnat={version} (gnat_external)", escape=True) # If we add a precise dependency on e.g. the installed native compiler, this # should override the external compiler alr_with("gnat_native") -match_solution("gnat=8888.0.0 (gnat_native) (installed)", escape=True) -match_solution("gnat_native=8888.0.0 (installed)", escape=True) +match_solution("gnat=8888.0.0 (gnat_native)", escape=True) +match_solution("gnat_native=8888.0.0", escape=True) # Let us swap the generic dependency with a targeted dependency, starting from # scratch @@ -57,8 +57,8 @@ alr_with("gnat") # In this case the only possible solution is with the targeted compiler -match_solution("gnat=" + e("8888.0.0 (gnat_native) (installed)") + ".*" + - "gnat_native=" + e("8888.0.0 (installed)") + ".*") +match_solution("gnat=" + e("8888.0.0 (gnat_native)") + ".*" + + "gnat_native=" + e("8888.0.0") + ".*") # Second, we check a root targeted gnat with both dependencies @@ -69,8 +69,8 @@ # In this case the only possible solution is with the targeted compiler. The # Generic dependency also appears, coming from the dep_generic crate -match_solution("gnat=" + e("8888.0.0 (gnat_native) (installed)") + ".*" + - "gnat_native=" + e("8888.0.0 (installed)") + ".*") +match_solution("gnat=" + e("8888.0.0 (gnat_native)") + ".*" + + "gnat_native=" + e("8888.0.0") + ".*") # Last combination is targeted x targeted os.chdir("..") @@ -80,7 +80,7 @@ # In this case the only possible solution is with the targeted compiler. The # generic dependency no longer exists, as nobody requested a generic gnat. -match_solution("gnat_native=" + e("8888.0.0 (installed)") + ".*") +match_solution("gnat_native=" + e("8888.0.0") + ".*") p = run_alr("with", "--solve") assert "gnat=" not in p.out, "Unexpected output" diff --git a/testsuite/tests/solver/compiler-priorities/test.py b/testsuite/tests/solver/compiler-priorities/test.py index 82b69aa77..9b469d60e 100644 --- a/testsuite/tests/solver/compiler-priorities/test.py +++ b/testsuite/tests/solver/compiler-priorities/test.py @@ -37,13 +37,13 @@ # Check that a generic dependency results in the external being used alr_with("gnat") -match_solution(f"gnat={version} (gnat_external) (installed)", escape=True) +match_solution(f"gnat={version} (gnat_external)", escape=True) # Check that adding a second dependency on native packaged compiler is honored. # Both dependencies should appear in the solution. alr_with("gnat_native") -match_solution("gnat=8888.0.0 (gnat_native) (installed)", escape=True) -match_solution("gnat_native=8888.0.0 (installed)", escape=True) +match_solution("gnat=8888.0.0 (gnat_native)", escape=True) +match_solution("gnat_native=8888.0.0", escape=True) # The previous dependency also should have caused the installation of the # native compiler as an available compiler, which we will check: @@ -67,7 +67,7 @@ # Depend on any gnat. Since no default is selected, the external one is used, # even if other installed compilers are newer (cross_2=9999) alr_with("gnat") -match_solution(f"gnat={version} (gnat_external) (installed)", escape=True) +match_solution(f"gnat={version} (gnat_external)", escape=True) # Depend on any gnat but the externally available. Since we have gnat_native=8888 # and gnat_cross_1=9999, normal version comparison would select the cross @@ -95,7 +95,7 @@ run_alr("config", "--global", "--set", "toolchain.use.gnat", "gnat_cross_1=9999") run_alr("update") -match_solution("gnat=9999.0.0 (gnat_cross_1) (installed)", escape=True) +match_solution("gnat=9999.0.0 (gnat_cross_1)", escape=True) # Check that a targeted compiler is retrieved when needed. Note that another # cross-compiler is still selected as default, but since we need a different @@ -103,11 +103,11 @@ init_local_crate("zzz") alr_with("gnat") # Will be solved with the selected cross compiler 1 -match_solution("gnat=9999.0.0 (gnat_cross_1) (installed)", escape=True) +match_solution("gnat=9999.0.0 (gnat_cross_1)", escape=True) alr_with("gnat_cross_2") # Now, this compiler should appear in the solution and be available, as it # overrides the preferred compiler -match_solution("gnat_cross_2=1.0.0 (installed)", escape=True) +match_solution("gnat_cross_2=1.0.0", escape=True) print('SUCCESS') diff --git a/testsuite/tests/solver/compiler-selected/test.py b/testsuite/tests/solver/compiler-selected/test.py index 2c4006274..0b9072e37 100644 --- a/testsuite/tests/solver/compiler-selected/test.py +++ b/testsuite/tests/solver/compiler-selected/test.py @@ -18,19 +18,19 @@ alr_with("gnat*") # Will appear in the solution as generic fulfilled by the preferred compiler -match_solution("gnat=8888.0.0 (gnat_native) (installed)", escape=True) +match_solution("gnat=8888.0.0 (gnat_native)", escape=True) # Selecting another default will cause a corresponding change in the solution run_alr("config", "--set", "toolchain.use.gnat", "gnat_cross_2=1") run_alr("update") -match_solution("gnat=1.0.0 (gnat_cross_2) (installed)", escape=True) +match_solution("gnat=1.0.0 (gnat_cross_2)", escape=True) # Adding another incompatible compiler dependency should result in overriding # the configured one alr_with("gnat_cross_1") # Both dependencies will appear in the solution, matching the same crate -match_solution("gnat=9999.0.0 \(gnat_cross_1\) \(installed\).*" - "gnat_cross_1=9999.0.0 \(installed\)") +match_solution("gnat=9999.0.0 \(gnat_cross_1\).*" + "gnat_cross_1=9999.0.0") print('SUCCESS') diff --git a/testsuite/tests/toolchain/directories/test.py b/testsuite/tests/toolchain/directories/test.py index 34c98be25..808d97e20 100644 --- a/testsuite/tests/toolchain/directories/test.py +++ b/testsuite/tests/toolchain/directories/test.py @@ -1,5 +1,5 @@ """ -Check created folders are where expected when installing binary compiler crates +Check created folders are where expected when downloading binary compiler crates """ import os @@ -49,7 +49,7 @@ def check_content(crate): # nor in local folder init_local_crate("xxx") alr_with("gnat_external") -match_solution("gnat_external=.* \(installed\)") +match_solution("gnat_external=.*") paths = contents(cache_dir, "gnat_external") assert len(paths) == 0, "Unexpected contents: " + str(paths) paths = contents(".", "gnat_external") @@ -58,7 +58,7 @@ def check_content(crate): # Require a cross compiler and verify it is automatically installed alr_with("gnat_external", delete=True, manual=False) alr_with("gnat_cross_1") -match_solution("gnat_cross_1=.* \(installed\)") +match_solution("gnat_cross_1=.*") check_content("gnat_cross_1") print('SUCCESS')