[SERVER-75574] Stop using deprecated python distutils package Created: 02/Apr/23  Updated: 29/Oct/23  Resolved: 31/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Steve Gross
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-04-03
Participants:

 Description   

ptyhon distutils package has been deprecated (pep-0632).

Currently it seems we are using it only for the 'spawn' module and in particular for the find_executable function:

$ git grep -n 'distutils' -- ':!/src/third_party/'

buildscripts/ciconfig/evergreen.py:9:import distutils.spawn
buildscripts/ciconfig/evergreen.py:23:        if not distutils.spawn.find_executable(evergreen_binary):
buildscripts/resmokelib/configure_resmoke.py:8:import distutils.spawn
buildscripts/resmokelib/configure_resmoke.py:125:        resolved_path = distutils.spawn.find_executable(_config.UNDO_RECORDER_PATH)
buildscripts/resmokelib/hang_analyzer/dumper.py:11:from distutils import spawn
buildscripts/resmokelib/hang_analyzer/process.py:9:from distutils import spawn
buildscripts/resmokelib/powercycle/powercycle.py:6:import distutils.spawn
buildscripts/resmokelib/powercycle/powercycle.py:983:    if not distutils.spawn.find_executable("rsync"):
buildscripts/resmokelib/powercycle/powercycle.py:1374:    mongo_executable = distutils.spawn.find_executable(
site_scons/site_tools/distsrc.py:33:from distutils.spawn import find_executable

We should be able to easily replace distutils.spawn.find_executable with shutils.which.



 Comments   
Comment by Githook User [ 31/Aug/23 ]

Author:

{'name': 'Steve Gross', 'email': 'steve.gross@mongodb.com', 'username': 'stevegrossmongodb'}

Message: SERVER-75574 Fix remaining reference to `find_executable`
Branch: master
https://github.com/mongodb/mongo/commit/e08989d64820a300bd9589948871940cd757b2a4

Comment by Githook User [ 29/Aug/23 ]

Author:

{'name': 'Steve Gross', 'email': 'steve.gross@mongodb.com', 'username': 'stevegrossmongodb'}

Message: SERVER-75574 Migrate one of the remaining find_executable calls
Branch: master
https://github.com/mongodb/mongo/commit/2d5b457a784317ff71db5381df0bb03a73d9f57a

Comment by Steve Gross [ 04/Jul/23 ]

Testing out the PR, and fixing up small issues.

Comment by Steve Gross [ 03/Jul/23 ]

Note: The latest search results show we're down to 3 files:

  • buildscripts/ciconfig/evergreen.py
  • buildscripts/resmokelib/configure_resmoke.py
  • buildscripts/resmokelib/powercycle/powercycle.py
Comment by Steve Gross [ 03/Jul/23 ]

Starting to look into this today

Comment by Shane Harvey [ 25/Apr/23 ]

Note that distutils has been removed in Python 3.12 which will be released October 2023.

Generated at Thu Feb 08 06:30:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.