-
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
build: do not hardcode paths outside of $prefix #16998
base: master
Are you sure you want to change the base?
Conversation
This fixes behavior of the build system when a prefix other than `/usr` is provided. Specifically, this change makes it possible to build ZFS utils with `--prefix=` set to a user-writable directory (such as `$HOME/...`) and successfully run `make install` without superuser privileges. Signed-off-by: Ivan Shapovalov <[email protected]>
@intelfx Linux builders are quite unhappy. |
Yes, I'll fix this. I'm just putting this out here as a PR to run CI on it because it's easier than setting up all those distros locally. |
OK. If it take longer, you could run CI in your own clone or mark the PR as draft. |
@intelfx - In case you're not aware, you can see the same tests running for each of your pushes in the GitHub Actions for your repository: https://github.com/intelfx/zfs/actions. |
Yes, I was not aware. I assumed that typically CI runs (especially heavyweight ones) are limited to the parent repository to avoid abuse, so this is unexpected. |
As I understand you would only abuse your own limits, unrelated to OpenZFS. You can control whether to run CI on pushes to your own clone in its settings. By default I think it is enabled. |
@intelfx superficial review looks great. Another thing I've wanted/hacked up/been getting around to for ages. I'll be happy to give it a more in-depth review once you're done! |
Motivation and Context
When making local builds of ZFS for debugging, it might be convenient to be able
to make several different builds of ZFS utils and install/run them side-by-side.
When doing so in process of debugging an unrelated change, I discovered that
even if configure is ran with
--prefix=
pointing to a user-writable directory,make install
always attempts to write some files to system-wide locations(and thus fails without superuser privileges, not to mention the fact that you
generally do not want to overwrite system files with a dev build regardless).
Description
This fixes behavior of the build system when a prefix other than
/usr
is provided.
Specifically, this change makes it possible to build ZFS utils with
--prefix=
set to a user-writable directory (such as$HOME/...
)and successfully run
make install
without superuser privileges.How Has This Been Tested?
prefix=/usr
andprefix!=/usr
(NOTE: CI failures seem relevant, something seems to go wrong with other distros, I'll fix the problems but still would like a superficial review to confirm this is acceptable/reasonable)
Types of changes
Checklist:
Signed-off-by
.