-
-
Notifications
You must be signed in to change notification settings - Fork 95
Use /etc as sysconfdir for install prefix /usr #1856
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
Conversation
@@ -60,6 +60,8 @@ std::filesystem::path install_datadir() { | |||
std::filesystem::path install_configdir() { | |||
#if VAST_ENABLE_RELOCATABLE_INSTALLATIONS | |||
const auto [prefix, _] = install_prefix_and_suffix(); | |||
if (prefix == "/usr") | |||
return "/@CMAKE_INSTALL_SYSCONFDIR@/vast"; |
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.
Usually this is solved at the configury-level (ie. debian packages are usually built with --prefix=/usr --sysconfdir=/etc
)
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.
This is for relocatable binaries, which do not have build-time configured paths.
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.
It seems strange to use configuration time install paths in a relocatable binary, do we even set them?
return "/@CMAKE_INSTALL_SYSCONFDIR@/vast"; | |
return "/etc/vast"; |
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.
We use them as relocatable paths, e.g., on some systems lib64 is used over lib and we want to support relocatable binaries for those systems as well.
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.
Do we actually want this special case if the user has specified a custom SYSCONFDIR? The logic from the PR title (prefix /usr
-> sysconfdir /etc
) is now subtly different than whats implemented (prefix /usr
-> prefix is ignored for sysconfdir)
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.
Good point. So probably hardcoded /usr -> /etc it is.
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.
I don't think it's possible to know whether to use lib
or lib64
at configuration time either. We explicitly support "relocating" the binary to other systems after all.
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.
I don't think it's possible to know whether to use
lib
orlib64
at configuration time either. We explicitly support "relocating" the binary to other systems after all.
You're misunderstanding. I was saying that we do this relative dir magic in order not to hardcode libdir etc, because they may be relative paths that are not the defaults.
Co-authored-by: tobim <tobim@fastmail.fm>
I guess you can undraft this now. |
📔 Description
Per the recommendation at
https://cmake.org/cmake/help/v3.21/module/GNUInstallDirs.html#special-cases
📝 Checklist
🎯 Review Instructions
Install static binary to /usr/bin/vast and test locally whether /etc/vast/vast.yaml is getting picked up.