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

package-moves: Allow moving back, and describe how to chain updates #326

Closed
wants to merge 1 commit into from

Conversation

mgorny
Copy link
Member

@mgorny mgorny commented Jan 21, 2024

Make the rule forbidding reusing old package names less strict. There is no real reason not to move packages back — we can safely assume that the package manager will handle that just fine. The only real restriction is that no other package must reuse any of the old names, i.e. effectively cause the package manager to attempt merging the packages together.

Add explicit rules for updating old package move entries. These match the logic used in pkgcheck, and therefore ensure both correct results and no warnings from pkgcheck.

@thesamesam
Copy link
Member

Does the relevant section of PMS need clarification?

It says:

Any name that has appeared as the origin of a move must not be reused in the future

I suppose it doesn't say "has ever".

@mgorny
Copy link
Member Author

mgorny commented Jan 21, 2024

Does the relevant section of PMS need clarification?

It says:

Any name that has appeared as the origin of a move must not be reused in the future

I suppose it doesn't say "has ever".

Probably yes. I suppose it's going to be hard to formally convey the right meaning.

Copy link
Member

@arthurzam arthurzam left a comment

Choose a reason for hiding this comment

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

Easy to read and understand (even for me), and then examples make it excellent.

I also want to request verification if the symbol is rendered correctly.

Copy link
Member

@ulm ulm left a comment

Choose a reason for hiding this comment

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

This would explicitly contradict what is (currently) specified by PMS.

Is this just a theoretical exercise, or a real problem we need to solve? Package moves are rare, and moving packages back to their previous name practically never happens.

ebuild-maintenance/package-moves/text.xml Outdated Show resolved Hide resolved
@mgorny
Copy link
Member Author

mgorny commented Jan 21, 2024

Is this just a theoretical exercise, or a real problem we need to solve? Package moves are rare, and moving packages back to their previous name practically never happens.

It does happen. And when it does, I think it makes sense to be explicit on how to make it work without stuff accidentally exploding in user's face.

@ulm
Copy link
Member

ulm commented Jan 21, 2024

We had a previous discussion in bug 296713, where the conclusion was that mistakes can be corrected before they hit the rsync mirrors. Apart from that case, moves are pretty much permanent and cannot be reverted.

Are we sure that this change won't open up possible undefined behaviour, especially when considering multiple repositories and binary packages?

Make the rule forbidding reusing old package names less strict.  There
is no real reason not to move packages back — we can safely assume
that the package manager will handle that just fine.  The only real
restriction is that no other package must reuse any of the old names,
i.e. effectively cause the package manager to attempt merging
the packages together.

Add explicit rules for updating old package move entries.  These match
the logic used in pkgcheck, and therefore ensure both correct results
and no warnings from pkgcheck.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
@mgorny
Copy link
Member Author

mgorny commented Jan 22, 2024

Are we sure that this change won't open up possible undefined behaviour, especially when considering multiple repositories and binary packages?

I can't think of anything worse than what we have right now. The worst mess would be if overlay copies our pkgmove entry so ::gentoo would specify 'B → A' and the overlay 'A → B'. However, there's really no reason why'd they do that, and we can't protect against them doing something like that anyway.

My understanding is that if you move package back, and remove the original move entry, then:

  • packages (installed or binary) that didn't have the original move applied won't have any changes done to them (which is fine)
  • packages that have the original move applied will be moved back

@ulm
Copy link
Member

ulm commented Jan 22, 2024

What do we do for PMS (which I'd rather not expand too much)? Would something like the following be sufficient?

-Any name that has appeared as the origin of a move must not be reused in the future.
+Any name that has ever appeared as the origin of a move must not be reused by another package in the future.

@thesamesam
Copy link
Member

What do we do for PMS (which I'd rather not expand too much)? Would something like the following be sufficient?

-Any name that has appeared as the origin of a move must not be reused in the future.
+Any name that has ever appeared as the origin of a move must not be reused by another package in the future.

Wouldn't this imply we can never cleanup updates/, or at least must have pkgcheck check git history or similar, to avoid accidental reuse by e.g. restoring a last-rited package, or adding a new package with an ancient name?

@mgorny
Copy link
Member Author

mgorny commented Jan 22, 2024

What do we do for PMS (which I'd rather not expand too much)? Would something like the following be sufficient?

-Any name that has appeared as the origin of a move must not be reused in the future.
+Any name that has ever appeared as the origin of a move must not be reused by another package in the future.

That would work for me. Though TBH I think PMS is stepping too much into the "policy" area here. Perhaps it would be cleaner to explain what the consequences would be.

@ulm
Copy link
Member

ulm commented Jan 22, 2024

Thinking about it, I'd also be happy to revert https://gitweb.gentoo.org/proj/pms.git/commit/?id=3ba90e4a4918cfe820bb7c627bef2fc0d5a9fed5 and leave the policy for the devmanual.

gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Jan 27, 2024
See gentoo/devmanual#326, oops.

Signed-off-by: Sam James <sam@gentoo.org>
Copy link
Member

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

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

OK with me.

wrt PMS: I feel like we still need to say something about not reusing names (we don't want conflicting updates entries?), just not about how long they are there for? Or do we have something for that already?

@ulm
Copy link
Member

ulm commented Jan 27, 2024

wrt PMS: I feel like we still need to say something about not reusing names (we don't want conflicting updates entries?), just not about how long they are there for? Or do we have something for that already?

How about this?
"At any given time, a name that appears as the origin of a move may not be used as a qualified package name in the repository. A slot that appears as the origin of a slot move may not be used by packages matching the spec of that slot move."

@thesamesam
Copy link
Member

perfect, thanks!

@mgorny
Copy link
Member Author

mgorny commented Jan 27, 2024

Yes, that sounds about right. Also clearly splits specification from policy.

Comment on lines +155 to +156
That is, rather than the chain: A:S₁ → A:S₂, A → B; we prefer to have
the chain: A → B, B:S₁ → B:S₂. All package and slot move entries must reside
Copy link
Member

@ulm ulm Jan 27, 2024

Choose a reason for hiding this comment

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

I think that Unicode superscript and subscript characters should be avoided. They are a workaround for plain text but have no place in a markup language like XML or HTML. (In other words, a 1 is a 1 regardless of its appearance in regular text or in a subscript.)

Edit: I suggest to change it to either A:X → A:Y or A:S1 → A:S2. Unless we would expect to see frequent future use of subscripts and superscripts, in which case <sub> and <sup> could be added to DevBook XML.

@ulm
Copy link
Member

ulm commented Feb 8, 2024

Merged (with the suggested markup change) in commit 5cb6b40.

@ulm ulm closed this Feb 8, 2024
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.

5 participants