-
Notifications
You must be signed in to change notification settings - Fork 91
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
builder-module: Fix cmake libdir value #610
Conversation
Fixes 8c036e0 It is being set to `$prefix/lib` but CMAKE_INSTALL_LIBDIR is not an absolute path by convention [1]: > It should be a path relative to the installation prefix When it is set to `/app/lib`, it is causing issues in applications [2] [1]: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#result-variables [2]: flathub/io.github.martinrotter.rssguard#73 (comment)
@@ -1788,7 +1788,7 @@ builder_module_build_helper (BuilderModule *self, | |||
if (libdir) | |||
g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_LIBDIR:PATH='%s'", libdir)); |
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 libdir
can also be an absolute path.
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.
That's user input though, if they set wrong values they will get weird behaviour back.
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.
The docs say the default is /app/lib
. It was clearly intended to support absolute paths and it should be fine to accommodate both.
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.
So what to do? You should be able to already set that to an absolute path if required for some reason in the manifest.
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.
if (libdir && g_path_is_absolute (libdir))
g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_FULL_LIBDIR:PATH='%s'", libdir));
else if (libdir)
g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_LIBDIR:PATH='%s'", libdir));
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.
Note that setting CMAKE_INSTALL_FULL_LIBDIR, will have no effect on the build if it is not being used as a variable in cmakelists.txt/in other places. I've seen very few software use the FULL paths in pkgconfig or cmakelists.
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.
CMAKE_INSTALL_LIBDIR is more universally used, there is also stuff that uses it wrongly as an absolute path too.
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.
Hmm that is unfortunate.
Anyway this PR is fine, that was a pre-existing issue.
Fixes 8c036e0
It is being set to
$prefix/lib
but CMAKE_INSTALL_LIBDIR is not an absolute path by convention 1:When it is set to
/app/lib
, it is causing issues in applications 2