Skip to content

gh-127072: Remove outdated socket.NETLINK_* constants. #127256

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

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

rruuaanng
Copy link
Contributor

@rruuaanng rruuaanng commented Nov 25, 2024

They have been removed from the linux master branch, but I'm not sure we need to sync with master (this would be a problem for older systems that would not be able to use the removed constants when built from cpython master source).

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Do we still support Linux systems that can have these constants? If we do, then we need a deprecation period. Otherwise this is fine.

@rruuaanng
Copy link
Contributor Author

Personally, I believe that the main branch should support the latest features. If users need to use them, they can opt for previous releases rather than building from the main branch source code. Moreover, the feature support for operating systems should not be deprecated, as they may be removed at any time due to performance issues. WDYT?

@rruuaanng
Copy link
Contributor Author

I should summon another OS enthusiast, listen to his opinion.

cc @zooba

@ZeroIntensity
Copy link
Member

I'm not too sure what your point is. We're not supporting anything new--we're just removing support for some macros, which have very little maintenace burden anyway. I'm not opposed to removing them if they aren't available on any system that Python can be built for, because then we're just getting rid of code clutter, but I want to be absolutely sure before we do.

If users need to use them, they can opt for previous releases rather than building from the main branch source code.

Rant aside, that's not encouraging. Ideally, we want people to migrate to new versions, not brush people off with "download <3.14 instead if you need to use that."

Moreover, the feature support for operating systems should not be deprecated, as they may be removed at any time due to performance issues.

Sure, but we're a wrapper over OS features--we'd be deprecating our wrapper for a feature, not the feature itself.

@rruuaanng
Copy link
Contributor Author

rruuaanng commented Nov 26, 2024

I'm not too sure what your point is. We're not supporting anything new--we're just removing support for some macros, which have very little maintenace burden anyway. I'm not opposed to removing them if they aren't available on any system that Python can be built for, because then we're just getting rid of code clutter, but I want to be absolutely sure before we do.

I'm almost sure that it doesn't exist in the main branches of Linux and freeBSD.

So my current idea is to wait for zooba answer. I'm not sure whether there is a compatible system similar to netlink in windows.

Edit

So my point is that if there is a compatible system in Windows, then I will turn off this PR. If it does not exist, then this PR can be merged, because we don't need to maintain some macro packages that do not exist.

@ZeroIntensity
Copy link
Member

I'm almost sure that it doesn't exist in the main branches of Linux and freeBSD.

Great, but we support more than just their current main. I get that these macros aren't on modern systems, but what about the older versions that we support? Will we give a nasty surprise to them with 3.14?

I'll yield to Steve, but I doubt he'll be in favor of dropping support for things without checking to make sure that nobody is using them.

@rruuaanng
Copy link
Contributor Author

I get that these macros aren't on modern systems, but what about the older versions that we support? Will we give a nasty surprise to them with 3.14?

Yes, that's what I'm worried about, so the PR is a draft. I'm not sure if there is a cpython that migrates the old-system to the main branch.

@tungol
Copy link
Contributor

tungol commented Nov 26, 2024

I searched through Linux kernel sources for these. The most recent version of Linux that included any of these constants was 2.6.17, which was EOL in October 2006. I don't know how much of an afterlife Linux kernel versions have after EOL though.

Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

I searched through Linux kernel sources for these. The most recent version of Linux that included any of these constants was 2.6.17, which was EOL in October 2006. I don't know how much of an afterlife Linux kernel versions have after EOL though.

This is the way to approach this kind of change. Thanks.

It is fine for us to drop support for an 18 year old kernel. (anything that is still within the kernel SLTS/CIP window is worth continuing to support)

I confirmed your greps by spot checking 2.6.18 and a 4.20.17 kernel source. These constants are long gone.

In general though, this kind of change has little value. So rather than spend time doing this kind of sleuthing we just let the no-op ifdef'd things sit around. It is highly annoying if we ever get this wrong as people have to adapt by manually defining the constant in their code, at which point they trust us less.

@gpshead gpshead marked this pull request as ready for review November 27, 2024 06:35
@gpshead gpshead enabled auto-merge (squash) November 27, 2024 06:36
@gpshead gpshead merged commit 6d3b520 into python:main Nov 27, 2024
46 checks passed
@rruuaanng rruuaanng deleted the remove-netlink-const branch November 27, 2024 12:08
@rruuaanng
Copy link
Contributor Author

Thanks for the merge of @gpshead. Here, I know a new OS enthusiast :)

ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…nGH-127256)

Remove seriously outdated netlink constants.

Co-authored-by: Gregory P. Smith <[email protected]>
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.

4 participants