Skip to content

Commit

Permalink
Refactor Alire.Shared into Alire.Toolchains (#1423)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo authored Aug 8, 2023
1 parent 7ca2956 commit 2068f31
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 337 deletions.
5 changes: 2 additions & 3 deletions src/alire/alire-roots.adb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ with Alire.OS_Lib;
with Alire.Paths.Vault;
with Alire.Properties.Actions.Executor;
with Alire.Roots.Optional;
with Alire.Shared;
with Alire.Solutions.Diffs;
with Alire.Spawn;
with Alire.Toolchains;
Expand Down Expand Up @@ -695,7 +694,7 @@ package body Alire.Roots is
if Toolchains.Is_Tool (Rel) then

-- Toolchain crates are installed to their own place
Shared.Share (Rel);
Toolchains.Deploy (Rel);

else

Expand Down Expand Up @@ -1295,7 +1294,7 @@ package body Alire.Roots is
is
begin
if Toolchains.Is_Tool (Rel) then
return Shared.Path;
return Toolchains.Path;
elsif Builds.Sandboxed_Dependencies then
-- Note that, even for releases not requiring a build (e.g.
-- externals), in sandboxed mode we are creating a folder for them
Expand Down
267 changes: 0 additions & 267 deletions src/alire/alire-shared.adb

This file was deleted.

45 changes: 0 additions & 45 deletions src/alire/alire-shared.ads

This file was deleted.

3 changes: 1 addition & 2 deletions src/alire/alire-solver.adb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ with Alire.Milestones;
with Alire.Optional;
with Alire.Platforms.Current;
with Alire.Releases.Containers;
with Alire.Shared;
with Alire.Root;
with Alire.Toolchains;
with Alire.Utils.TTY;
Expand Down Expand Up @@ -259,7 +258,7 @@ package body Alire.Solver is
-- solution is found).

Installed : constant Releases.Containers.Release_Set :=
Shared.Available
Toolchains.Available
(Detect_Externals =>
Options.Detecting = Detect);
-- Installed releases do not change during resolution, we make a local
Expand Down
7 changes: 3 additions & 4 deletions src/alire/alire-toolchains-solutions.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ with AAA.Strings;

with Alire.Index;
with Alire.Root;
with Alire.Shared;

package body Alire.Toolchains.Solutions is

Expand All @@ -22,14 +21,14 @@ package body Alire.Toolchains.Solutions is
use type Milestones.Milestone;
begin
-- Check that is not already there
if (for some Rel of Shared.Available => Rel.Milestone = Mil) then
if (for some Rel of Toolchains.Available => Rel.Milestone = Mil) then
return;
end if;

-- It must be redeployed
Put_Warning ("Tool " & Mil.TTY_Image & " is missing, redeploying...");

Shared.Share (Index.Find (Mil.Crate, Mil.Version));
Toolchains.Deploy (Index.Find (Mil.Crate, Mil.Version));
end Redeploy_If_Needed;

Result : Alire.Solutions.Solution := Solution;
Expand All @@ -53,7 +52,7 @@ package body Alire.Toolchains.Solutions is

-- Add the configured tool release to the solution
Result := Result.Including
(Release => Shared.Release
(Release => Toolchains.Release
(Target => Tool_Milestone (Tool),
Detect_Externals => Tool_Is_External (Tool)),
Env => Root.Platform_Properties,
Expand Down
Loading

0 comments on commit 2068f31

Please sign in to comment.