Skip to content

Solver refactoring#1739

Merged
mosteo merged 10 commits into
alire-project:masterfrom
mosteo:feat/solver-mk2
Nov 23, 2024
Merged

Solver refactoring#1739
mosteo merged 10 commits into
alire-project:masterfrom
mosteo:feat/solver-mk2

Conversation

@mosteo

@mosteo mosteo commented Aug 15, 2024

Copy link
Copy Markdown
Member

This reworks the recursive solver we have into an A*-like sequential one. The advantages are: cleaner implementation, better maintainability, no need to start the search several times to find a good incomplete solution (once we find an incomplete one, it will be decent enough and it means no complete one exists), simpler options for usage.

For users there should be no noticeable changes.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions Bot added the Stale label Nov 21, 2024
@mosteo mosteo removed the Stale label Nov 21, 2024
@mosteo mosteo marked this pull request as ready for review November 21, 2024 10:16

@Fabien-Chouteau Fabien-Chouteau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I fully understand the code but it looks well organized and documented.

I am a bit worried about the dependency on a growing number of very small libraries.

Comment thread .gitmodules Outdated
url = https://github.com/mosteo/dirty_booleans
[submodule "deps/compare_to_case"]
path = deps/compare_to_case
url = https://github.com/mosteo/compare_to_case

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not too fond of having a dependency project with only one function in it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the concern. I was operating from the idea of not having in Alire logic unrelated to its function, but what is the minimum reusable code that makes worthwhile moving it into a new crate is certainly debatable.

I will move that function for now into Alire.Utils.

-- a veeery long time when many crates/releases must be considered. TODO:
-- All these policies can go away once we move from a recursive solver to
-- a non-recursive priority-based one.
-- When looking for releases within a crate, which one to try first. The

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what is the strategy for Alire?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alire defaults to newest first, unless the global switch --prefer-oldest is used, which affects get, search and show. Notably, alr update (and automatic updates after manual manifest edition) don't honor it, so I've had for a time the idea of moving it to a setting, so the behavior is globally consistent.

@mosteo mosteo merged commit 20dc457 into alire-project:master Nov 23, 2024
@mosteo mosteo deleted the feat/solver-mk2 branch November 23, 2024 09:24
Comment thread src/alire/alire-meta.ads
Commit : constant String := "unknown";
Changes : constant String := "unknown";
Commit : constant String := "c3dade93403aaacec59097e450a22ce83e0ceb0f";
Changes : constant String := "dirty";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to include this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, thanks for the catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants