-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
arc_summary: prefer python3 version and install when there is no python #8851
Conversation
This matches the behavior of other python scripts, such as arcstat and dbufstat, which are always installed but whose install-exec-hook actions will simply touch up the shebang if a python interpreter was configured *and* that interpreter is a python2 interpreter. Fixes installation in a minimal build chroot without python available. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Codecov Report
@@ Coverage Diff @@
## master #8851 +/- ##
==========================================
+ Coverage 78.81% 78.96% +0.14%
==========================================
Files 382 382
Lines 117771 117771
==========================================
+ Hits 92821 92997 +176
+ Misses 24950 24774 -176
Continue to review full report at Codecov.
|
@freqlabs would you mind reviewing this change related to #8731. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With #8731 merged, none of the Python scripts will be installed when ZFS is configured without Python, and you won't be able to fool the configure script anymore. I think the most straightforward solution is to have the desired version of Python installed when building ZFS if you intend to install the Python scripts.
Hmm, I missed that that makes SUBDIRS conditional. |
Actually, this works fine:
|
As I understand it the intent here is to default to installing the python3 version when a non-standard python version has be specified. That seems entirely reasonable to me since it's most likely to be correct version and won't cause any harm. |
@eli-schwartz I get this error with that command: |
That comes from the pyzfs code, though. (At least the error message is from AX_PYTHON_DEVEL which is part of config/always-pyzfs.m4) |
I ran exactly the command you gave. This comes from on line 72 in config/always-python.m4. Make sure you are testing with the commit that was merged for #8731 |
Without this change applied, and assuming the So while I think it would be best to build with Python installed in the environment, if a fake version is specified we do still want what's installed to be consistent. So this change makes sense to me. For example, with this change applied: $ touch $PWD/python3-fake
$ chmod 775 $PWD/python3-fake
$ ./configure --with-python=$PWD/python3-fake PYTHON=$PWD/python3-fake --enable-pyzfs=no
$ make
$ DESTDIR=/var/tmp/zfs-install make install
$ ls /var/tmp/zfs-install/usr/local/bin/
arcstat arc_summary dbufstat raidz_test zgenhostid |
I am working on a solution that removes the need to have Python at configure time when using I have no objection to this PR, if the idea was to have created a dummy python executable beforehand, which I had not done when I tested it. |
This matches the behavior of other python scripts, such as arcstat and dbufstat, which are always installed but whose install-exec-hook actions will simply touch up the shebang if a python interpreter was configured *and* that interpreter is a python2 interpreter. Fixes installation in a minimal build chroot without python available. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@freqlabs.com> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Closes #8851
Motivation and Context
Fixes installation in a minimal build chroot without python available.
Description
This matches the behavior of other python scripts, such as arcstat and dbufstat, which are always installed but whose install-exec-hook actions will simply touch up the shebang if a python interpreter was configured and that interpreter is a python2 interpreter.
How Has This Been Tested?
When configuring zfs with --enable-pyzfs=no, and with --with-python="$PWD/python3-fake" in order to fool the configure script into thinking python is available in order to work around #8731, the arc_summary script was not installed, while arcstat was installed (and used a python3 shebang). With this change, they are both installed, with a python3 shebang.
Tested in a minimal Arch Linux chroot without python available.
Types of changes
Checklist:
Signed-off-by
.