[LU-16242] Self-built lustre-client-dkms requires /usr/bin/python2 Created: 17/Oct/22  Updated: 01/Aug/23  Resolved: 01/Aug/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question/Request Priority: Minor
Reporter: Jesse Stroik Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Related
is related to LU-16626 Don't use or check for python2 for lu... Resolved
is related to LU-15874 RHEL 9.0 support Resolved
Epic/Theme: build
Rank (Obsolete): 9223372036854775807

 Description   

RHEL 9 and its derivatives are no longer distributed with python 2. Two scripts specify python2 as their interpreter:
contrib/scripts/gerrit_checkpatch.py
lustre/scripts/zfsobj2fid
I did attempt to create the distribution with tests and i/o kit disabled, but the lustre-client-dkms RPM still required /usr/bin/python2.
I modified the interpreter to python3 for those scripts and tested. The RPM will no longer requires /usr/bin/python2 and can then be installed on rocky9.

#!/usr/bin/env python2

becomes:

#!/usr/bin/env python3

When I looked for previous issues related to this, it appeared that 'python' was changed to 'python2' for debian builds. I didn't test these scripts with python3.



 Comments   
Comment by Jesse Stroik [ 17/Oct/22 ]

RHEL 9 and its derivatives are no longer distributed with python 2. Two scripts specify python2 as their interpreter:

contrib/scripts/gerrit_checkpatch.py

lustre/scripts/zfsobj2fid

I did attempt to create the distribution with tests and i/o kit disabled, but the lustre-client-dkms RPM still required /usr/bin/python2.

I modified the interpreter to python3 for those scripts and tested. The RPM will no longer requires /usr/bin/python2 and can then be installed on rocky9. 

#!/usr/bin/env python2

becomes:

#!/usr/bin/env python3

When I looked for previous issues related to this, it appeared that 'python' was changed to 'python2' for debian builds. I didn't test these scripts with python3.

Comment by Andreas Dilger [ 17/Oct/22 ]

Hi Jesse, could you please push a patch for changing these tools to use python3. Have you actually tried running them after changing the python version? I'm not much of a python person myself, but know that they may need minor updates to work with the new version.

Comment by James A Simmons [ 17/Oct/22 ]

Yes please push the patches. I would be great to drop python2.

Comment by Jesse Stroik [ 17/Oct/22 ]

I have not tested these scripts.

pylint suggests minor changes are needed lustre/scripts/zfsobj2fid.  It looks like someone might have already updated this script and added pout.decode() call that I would have missed. It's in the LLNL lustre-tools repo

The other script, contrib/scripts/gerrit_checkpatch.py, looks more involved. I'm not a python programmer so I don't think I'd be a good choice to cobble together changes to that

Comment by Andreas Dilger [ 01/Aug/23 ]

This was fixed on master via patch https://review.whamcloud.com/50241 "LU-16626 build: remove python2 dependencies".

Generated at Sat Feb 10 03:25:16 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.