Help debugging Copr build (... has shebang which doesn't start with '/')

Hi!

I’m new here. I have been a fedora user for many years and now I’m trying to learn how to make packages. I made a source package for taskopen based on a guide at developer.fedora.org and I got it to build on my laptop (I get both a rpm and a srpm) but when I upload the source package to Copr, the build fails with this error:

BUILDSTDERR: *** ERROR: ./usr/bin/taskopen has shebang which doesn't start with '/' (-w -CLASo)
RPM build errors:
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.Cn03wT (%install)
BUILDSTDERR:     Bad exit status from /var/tmp/rpm-tmp.Cn03wT (%install)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/util.py", line 700, in do
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed: 
 # /usr/bin/systemd-nspawn -q -M 4c56c0b9b896406384dfec0d3040d867 -D /var/lib/mock/884848-fedora-29-x86_64-1555593504.001815/root -a --capability=cap_ipc_lock --bind=/tmp/mock-resolv.wjb0vgwp:/etc/resolv.conf --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=en_US.UTF-8 -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/taskopen.spec

The shebang in the script acually looks like this:

#!/usr/bin/perl -w -CLASo

It does start with a /. Is that a bug in Copr?
Unless, since the message quotes the arguments explicitely (-w -CLASo), maybe you’re not allowed to pass argument to the interpreter?

Have you tested the build with mock? Local tests using rpmbuild often work because of our personal environments, so testing packages with mock is suggested, especially when debugging build issues.

https://fedoraproject.org/wiki/Using_Mock_to_test_package_builds

Thanks for the tip. I hadn’t done that indeed. Now I get the same error on my laptop than on Copr :tada: but I’m still not sure what to do with it :thinking:.
The error says:

*** ERROR: ./usr/bin/taskopen has shebang which doesn't start with '/' (-w -CLASo)

but the whole shebang line is #!/usr/bin/perl -w -CLASo which does start with a ‘/’.

Hrm, that’s weird. Could we have a look at the complete build.log file that mock generated?

Here are the logs:

Aren’t you destroying the shebang in this set of commands before installing taskopen?

sed -i'.bak' s',/usr/bin/perl,,' taskopen.pl
mkdir -p /builddir/build/BUILDROOT/taskopen-1.1.4-1.fc29.x86_64//usr/bin
install -m 0755 taskopen.pl /builddir/build/BUILDROOT/taskopen-1.1.4-1.fc29.x86_64//usr/bin/taskopen
2 Likes

Yes of course! I didn’t install perl in the build environment :man_facepalming:
(I never really had to install perl anywhere before, it’s usually just there…)
It works now, both locally and on Copr :partying_face:

1 Like

Ah, great—can you mark your reply as the solution then? (There should be a tick mark somewhere below the reply where the other post tools are)

I don’t see a tick mark. Here’s what I see when I expend the icons:


Maybe I haven’t unlocked this feature/badge yet (I created my account a few hours ago)?

1 Like

Ah, yeh, probably need to earn a little more karma :slight_smile: