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
Fix shebang error on rpmbuild #695
Conversation
There is a problem and I think your patch will fix it for RH/Fedora and probably also other Linuxes. We will have to look into this a bit more. |
Hi Andreas, |
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.
Your changes make sense for Red Hat / Fedora, but they break portability. We can probably implement your changes in a system-specific way, but it will be a lot harder to do so.
@@ -1,4 +1,4 @@ | |||
#! /bin/sh | |||
#!/usr/bin/sh |
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.
As we dropped support for RHEL6, we should probably remove the old initscripts instead of maintaining them further.
Could you remove these files and see if the build still works? They shouldn't be installed when building with systemd anyway.
@@ -1,4 +1,4 @@ | |||
#! /bin/sh | |||
#!/usr/bin/sh |
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.
see above
@@ -1,4 +1,4 @@ | |||
#! /bin/sh | |||
#!/usr/bin/sh |
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.
see above
@@ -1,3 +1,4 @@ | |||
#!/usr/bin/sh |
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 resulting file should not be executable. So we shouldn't add a shebang, but remove exectuable permissions (this can be done somewhere in a CMakeLists.txt)
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/usr/bin/sh |
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.
Sorry, but /usr/bin/sh is Red Hat / Fedora specific. In POSIX the path to the standard shell is /bin/sh. This change would break everything, but Red Hat / Fedora.
You can provide a patch that applies this change for Fedora/Red Hat only or you can change the specfile to ignore silence the warning using __brp_mangle_shebangs_exclude
.
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/usr/bin/sh |
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.
see above
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/usr/bin/sh |
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.
see above
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/usr/bin/sh |
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.
see above
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/usr/bin/sh |
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.
see above
@@ -1,4 +1,4 @@ | |||
#!/usr/bin/env perl | |||
#!/usr/bin/perl |
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.
you're not wrong, but we will have to support systems that have perl in unusual places (i.e. FreeBSD has it in /usr/local/bin/perl).
So far /usr/bin/env has worked well. We could change this, but we would have to configure the path system specific and detect the path to perl in CMake and set it using a variable.
If you propose a patch, I'll test and implement it.
Having said that, we're trying to remove/replace all perl scripts anyways, so I'm not really sure it is worth the effort anymore.
It's been three months without reply now. I close the PR. |
When building the rpm package, many errors/warnings about an wrong shebang is shown.