Skip to content
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

Drop -s from the launch script shebangs #600

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

superm1
Copy link
Contributor

@superm1 superm1 commented Feb 9, 2024

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: #599

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: redhat-performance#599
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
@yarda
Copy link
Contributor

yarda commented Feb 9, 2024

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
Copy link
Contributor

yarda commented Feb 9, 2024

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.

@superm1
Copy link
Contributor Author

superm1 commented Feb 9, 2024

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).

@yarda
Copy link
Contributor

yarda commented Feb 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manually installing tuned from source doesn't work on Fedora 39
2 participants