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

Wrap libsolv Transaction #2554

Merged
merged 10 commits into from
Jun 9, 2023
Merged

Conversation

AntoinePrv
Copy link
Member

No description provided.

@AntoinePrv AntoinePrv self-assigned this May 31, 2023
@AntoinePrv AntoinePrv marked this pull request as draft May 31, 2023 12:38
@AntoinePrv AntoinePrv force-pushed the solv-transaction branch 2 times, most recently from 8bd809e to 3fbbecb Compare June 1, 2023 14:01
@AntoinePrv AntoinePrv marked this pull request as ready for review June 1, 2023 15:34
}
}

auto ObjTransaction::from_solver(const ObjPool& pool, const ObjSolver& solver) -> ObjTransaction
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to force / be sure the user instantiated a pool before calling this method, and the pool he's using matches the one form the solver? Or is it just a sanity check?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's both? The libsolv type captures the pool by pointer so we make sure it cannot be used without the pool by asking to pass it as an argument (note the destructor does not need the pool).

Copy link
Member Author

Choose a reason for hiding this comment

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

You cannot create this type without a Pool, whatever constructor function would use the pool through a capture.

libmamba/src/solv-cpp/transaction.cpp Show resolved Hide resolved
*
* Negative solvable ids are use to mean that the solvable must be removed.
*/
[[nodiscard]] static auto from_solvables(const ObjPool& pool, const ObjQueue& solvables)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpicking: I think we should put the [[nodiscard]] static qualifiers on a dedicated line to keep methods alignment with trailing return syntax.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but this should be done in .clang-format (not sure we can), otherwise it will always be overwriten.

libmamba/src/solv-cpp/transaction.cpp Show resolved Hide resolved
@JohanMabille JohanMabille merged commit ad900f0 into mamba-org:main Jun 9, 2023
18 of 20 checks passed
@AntoinePrv AntoinePrv deleted the solv-transaction branch June 9, 2023 08:39
@Klaim
Copy link
Member

Klaim commented Jun 9, 2023

I was reviewing ^^; But no comment LGTM 👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants