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

Replace XzLibLzmaDevelMigrator with MiniReplacement #3851

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Mar 10, 2025

Description:

Introduce a MiniReplacement migrator that is a minimigrator based on Replacement, and replace the XzLibLzmaDevelMigrator with it. Extend to v1 recipes while at it.

Checklist:

  • Pydantic model updated or no update needed

Cross-refs, links to issues, etc:

Discussed in #3360


@beckermr, could you do a quick initial review before I switch some more minimigrators over?

mgorny added 6 commits March 10, 2025 19:58
Introduce a `MiniReplacement` migrator that is a minimigrator based
on `Replacement`, and replace the `XzLibLzmaDevelMigrator` with it.
Extend to v1 recipes while at it.
Copy link
Contributor

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

Looking good! One comment on the host-only thing which we need.

Comment on lines 181 to 182
# TODO: do we want to limit to host requirements, like the split
# minimigrators did?
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make this an option and then turn it on as needed to match the current behavior. For ABI migrations, we only ever want to edit host.

*,
old_pkg: "PackageName",
new_pkg: "PackageName",
requirement_types: tuple[str] = ("host",),
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I am sorry I was mistaken. The old "xz" one did everything in the text file as long as it matched xz\n. So I think actually what we want is none of the above and something much more general. We should inspect the other migrators to see what they look like too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, yes and no. It replaced everything but filter()-ed on host requirements. In that sense, the new minimigrator does the same thing. Ofc, I'm open to changing the behavior to something "saner".

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. My concern is us missing things like ignored run exports in build/ignore_run_exports_from, etc. The current migrator would catch that and we need to replicate that kind of behavior. I don't have an exhaustive list of where say xz might appear, which is why something more generic would be better.

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.

2 participants