Open Bug 1743785 Opened 3 years ago Updated 2 years ago

[meta] distutils is deprecated, refactor usages

Categories

(Firefox Build System :: Mach Core, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: saschanaz, Unassigned)

References

Details

(Keywords: good-first-bug, meta)

./mach build shows a warning when running on Python 3.10, and per searchfox I believe it's not only mach build. See also https://www.python.org/dev/peps/pep-0632/.

Priority: -- → P3

The severity field is not set for this bug.
:mhentges, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mhentges)
Severity: -- → N/A
Flags: needinfo?(mhentges)

The severity field is not set for this bug.
:mhentges, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mhentges)
Severity: N/A → S4
Flags: needinfo?(mhentges)
Priority: P3 → P2

Those who need to parse the output of Mach output can hide Python warning output with the PYTHONWARNINGS environment variable.
E.g.:

PYTHONWARNINGS=ignore ./mach <command>
Keywords: good-first-bug
Summary: Warning: distutils is deprecated in Python 3.10 → [meta] distutils is deprecated, refactor usages

This is a great bug for future contributors!
We need to adjust all usages of distutils to be ported to something that's still maintained.
A couple notes:

  • We don't need to port anything in third_party/python, or testing/web-platform/tests/tools/third_party
  • There's some helpful distutils porting docs here
  • Let's break down work here by component (mozbuild, mozrelease, mozperftest, etc), creating "sub-bugs" of this meta bug for each one.
  • It looks like the majority of changes will be from distutils.version.LooseVersion to packaging.version.Version, and from distutils.spawn.find_executable to shutil.which

testing/web-platform/tests/tools/third_party

Still will be good to have 😉 (but https://github.com/web-platform-tests/wpt is the better place to do it I guess)

Still will be good to have 😉

True, but those will be solved by updating those vendored dependencies - we shouldn't patch distutils out of them, because then we're soft-forking the 3rd-party code, which I don't think we want :)

Things in WPT should be automatically synced back to the upstream by wpt-sync bot, so I think that shouldn't be problematic.

Oh actually scratch that, it's third_party in WPT!

Depends on: 1777414
Depends on: 1766085
You need to log in before you can comment on or make changes to this bug.