Skip to content

feat(install): add specific options for packaging environments#138

Open
tulilirockz wants to merge 2 commits intoTamtamHero:mainfrom
tulilirockz:install-works-with-rpm
Open

feat(install): add specific options for packaging environments#138
tulilirockz wants to merge 2 commits intoTamtamHero:mainfrom
tulilirockz:install-works-with-rpm

Conversation

@tulilirockz
Copy link
Copy Markdown

@tulilirockz tulilirockz commented Apr 14, 2025

I wanted to use the install script so I didnt need to handle the config files and systemd units, but I ran into a few issues because the install script kept replacing the DEST_DIR with a location in %{buildroot} on the RPM build, this should add a few options to make this more seamless for weird enviroments like this.

  • no-pip-build: You'd build the wheel previously on a package
  • no-override-python-installation-location: This fixes a break on RPM builds cuz it finds %{BUILDROOT} on the script and it craps itself

I wanted to use the install script so I didnt need to handle the config files and systemd units, but I ran into a few issues because the install script kept replacing the DEST_DIR with a location in `%{buildroot}` on the RPM build, this should add a few options to make this more seamless for weird aah enviroments like this.

- `no-pip-build`: You'd build the wheel previously on a package
- `no-override-python-installation-location`: This breaks RPM builds cuz it finds %{BUILDROOT} on the script and it craps itself
@tulilirockz tulilirockz changed the title feat(install): add specific options for RPM buildroot-like environments feat(install): add specific options for packaging environments Apr 14, 2025
Copy link
Copy Markdown
Collaborator

@leopoldhub leopoldhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for your contribution!

I realized I did a mistake in a previous PR (more details in the review) causing you and others trouble which I will fix in a separate PR.

In the meantime, here is some feedback.

;;
'--no-pip-build')
NO_PIP_BUILD=true
NO_PIP_INSTALL=true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users should be able to install pre-built packages, so I don't think we should set NO_PIP_INSTALL=true

done

if ! python -h 1>/dev/null 2>&1; then
if ! python -h 1>/dev/null 2>&1 && [ "$NO_PIP_BUILD" = false ] ; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, python will be necessary when installing without building
if ! python -h 1>/dev/null 2>&1 && { [ "$NO_PIP_BUILD" = false ] || [ "$NO_PIP_INSTALL" = false ]; }

fi

if [ "$NO_PIP_INSTALL" = false ]; then
if [ "$NO_PIP_INSTALL" = false ] && [ "$NO_PIP_BUILD" != false ]; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too, we should be able to install if NO_PIP_INSTALL=false
if [ "$NO_PIP_INSTALL" = false ];

Comment on lines +248 to +253
if [ "$NO_OVERRIDE_PYTHON_INSTALLATION_PATH" = true ] ; then
OLD_SYSCONFDIR=$SYSCONFDIR
OLD_INSTALL_PATH="${PYTHON_SCRIPT_INSTALLATION_PATH}"
PYTHON_SCRIPT_INSTALLATION_PATH="/usr/bin/fw-fanctrl"
SYSCONF_DIR="/etc"
fi
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python script installation path deduction by default introduced in #116 was a mistake as it causes the issue you ran into, as well as #129.
I think the correct thing to do is remove the PYTHON_SCRIPT_INSTALLATION_PATH deduction for now and find a proper solution as a replacement (specify the path in an option? deduce only if an option is passed?...)
You can remove this PYTHON_SCRIPT_INSTALLATION_PATH and SYSCONF_DIR manual replacement for now and expect the PYTHON_SCRIPT_INSTALLATION_PATH deduction to be gone for now.

Comment on lines +284 to +289
if [ "$NO_OVERRIDE_PYTHON_INSTALLATION_PATH" = true ] ; then
OLD_SYSCONFDIR=$SYSCONFDIR
OLD_INSTALL_PATH="${PYTHON_SCRIPT_INSTALLATION_PATH}"
PYTHON_SCRIPT_INSTALLATION_PATH="/usr/bin/fw-fanctrl"
SYSCONF_DIR="/etc"
fi
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, expect the PYTHON_SCRIPT_INSTALLATION_PATH deduction to be gone

@leopoldhub
Copy link
Copy Markdown
Collaborator

Also, could you please document the no-pip-build option into the README.md?

@leopoldhub
Copy link
Copy Markdown
Collaborator

I believe #139 will fix the issue with the python script installation path override

@leopoldhub
Copy link
Copy Markdown
Collaborator

#139 merged, PYTHON_SCRIPT_INSTALLATION_PATH has been removed which should fix some of the problems here.

@tulilirockz
Copy link
Copy Markdown
Author

Heyo! Thank you for seeing this PR! I was just upstreaming some fixes I made for the Bazzite package. Ill update this one to fit the things you reviewed here, just a bit busy with other stuff right now!

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.

2 participants