Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load the index when dependencies are needed #1019

Merged
merged 2 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/alr/alr-commands-show.adb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ package body Alr.Commands.Show is
end if;

if Cmd.Graph or else Cmd.Solve or else Cmd.Tree then
Cmd.Requires_Full_Index (Force_Reload => True);

declare
Needed : constant Query.Solution :=
(if Current
Expand Down
23 changes: 23 additions & 0 deletions testsuite/tests/show/solve-remote/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Verify the proper solving of dependencies with `alr show --solve <crate>`
"""

import re

from drivers.alr import run_alr
from drivers.asserts import assert_eq, assert_match

p = run_alr("show", "hello", "--solve")

# Should not be missing dependencies
assert_match(".*" +
re.escape("""
Dependencies (solution):
libhello=1.0.0
Dependencies (graph):
hello=1.0.1 --> libhello=1.0.0 (^1.0)
""") +
".*",
p.out)

print('SUCCESS')
3 changes: 3 additions & 0 deletions testsuite/tests/show/solve-remote/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
driver: python-script
indexes:
basic_index: {}