Skip to content

Adopt shebang lines because of build errors#570

Open
skriesch wants to merge 1 commit intoRRZE-HPC:masterfrom
skriesch:master
Open

Adopt shebang lines because of build errors#570
skriesch wants to merge 1 commit intoRRZE-HPC:masterfrom
skriesch:master

Conversation

@skriesch
Copy link
Copy Markdown

@skriesch skriesch commented Nov 1, 2023

The rpm runtime does not like the syntax of some shebang lines in the code. We are receiving error messages:

[   63s] likwid.x86_64: E: env-script-interpreter (Badness: 9) /usr/bin/feedGnuplot /usr/bin/env perl
[   63s] likwid.x86_64: E: env-script-interpreter (Badness: 9) /usr/share/likwid/filter/json /usr/bin/env python3
[   63s] likwid.x86_64: E: env-script-interpreter (Badness: 9) /usr/share/likwid/filter/template /usr/bin/env perl
[   63s] likwid.x86_64: E: env-script-interpreter (Badness: 9) /usr/share/likwid/filter/xml /usr/bin/env perl
[   63s] This script uses 'env' as an interpreter. For the rpm runtime dependency
[   63s] detection to work, the shebang #!/usr/bin/env <interpreter>  needs to be
[   63s] patched into #!/usr/bin/<interpreter>  otherwise the package dependency
[   63s] generator merely adds a dependency on /usr/bin/env rather than the actual
[   63s] interpreter /usr/bin/<interpreter>.  Alternatively, if the file should not be
[   63s] executed, then ensure that it is not marked as executable or don't install it
[   63s] in a path that is reserved for executables.

Therefore, I have adopted the referenced files as the rpm runtime (in the openSUSE Build Service) is suggesting for more successful builds in the future.

@TomTheBear
Copy link
Copy Markdown
Member

Thanks for PR. I'm not sure whether this should be "fixed" globally or applied separately as patch when creating RPMs.

On HPC systems with modules or spack env, there are often no fixed paths that can be used in the shebang. The /usr/bin/env <interpreter> approach takes the <interpreter> currently available in the environment. I admit, perl and python3 should be there by default.

Can you please put it in the likwid.spec file (with sed or something) and use the RPM macros like %{__python} instead of hardcoded paths?

@skriesch
Copy link
Copy Markdown
Author

skriesch commented Nov 1, 2023

I expect also, that Perl and Python should be available by default on such systems.
The method with /usr/bin/env does not let you pass arguments to the interpreter. I believe, that this is the problem by the rpm runtime.

I can use sed for fixing the problem with perl and try the python-rpm-macros packages for referencing the interpreter to Python3.

Signed-off-by: Sarah Julia Kriesch <sarah.j.kriesch@fau.de>
@TomTheBear
Copy link
Copy Markdown
Member

Thanks for fixing it in the spec file. There should be a macro for perl as well. It should be supported when perl is a build requirement which it should because LIKWID uses Perl scripts in the build phase.

You can pass arguments to the interpreter through env:

#!/usr/bin/env -S <interpreter> <arg1> <arg2>

For more info, see here

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