tuned icon indicating copy to clipboard operation
tuned copied to clipboard

Drop `-s` from the launch script shebangs

Open superm1 opened this issue 1 year ago • 4 comments

Running make install as suggested by INSTALL will place all the python modules in /usr/local which won't be included in the search path when -s is used in the shebang.

Closes: https://github.com/redhat-performance/tuned/issues/599

superm1 avatar Feb 09 '24 16:02 superm1

This seems like python bug. According to the [1]:

-s Don’t add the user site-packages directory to sys.path.

From the [2]:

Default value is ~/.local/lib/pythonX.Y/site-packages

On my system (fedora 39):

import site

print(site.USER_SITE)

prints:

/home/yarda/.local/lib/python3.12/site-packages

I think we generally want the -s. I will probably open python bug to sort it out and if it's wanted behavior I will ask them to fix the python documentation.

[1] https://docs.python.org/3/using/cmdline.html#cmdoption-s [2] https://docs.python.org/3/library/site.html#site.USER_SITE

yarda avatar Feb 09 '24 18:02 yarda

You can workaround it by installation into system sitelib, e.g.:

# make install PYTHON_SITELIB=/usr/lib/python3.12/site-packages

Or whatever the system sitelib on your distro is.

yarda avatar Feb 09 '24 19:02 yarda

I think we generally want the -s. I will probably open python bug to sort it out and if it's wanted behavior I will ask them to fix the python documentation.

It's also a bit weird that make install has some stuff ignoring PREFIX entirely and putting things in /usr and /etc

You can workaround it by installation into system sitelib, e.g.:

Yeah that works (Fedora 39).

superm1 avatar Feb 09 '24 20:02 superm1

I think we generally want the -s. I will probably open python bug to sort it out and if it's wanted behavior I will ask them to fix the python documentation.

It's also a bit weird that make install has some stuff ignoring PREFIX entirely and putting things in /usr and /etc

For /usr it's probably bug, that should be fixed, for /etc it probably isn't. The default PREFIX for user builds is /usr/local for distro builds it's /usr. For prefix addition to /etc you need to use DESTDIR.

You can workaround it by installation into system sitelib, e.g.:

Yeah that works (Fedora 39).

rpmbuild/mock does some magic to set the prefix automatically to /usr when packages are built through it.

yarda avatar Feb 09 '24 20:02 yarda