You are not logged in.

#1 2016-06-15 12:55:08

mis
Member
Registered: 2016-03-16
Posts: 234

[solved] namcap fails due to some binary data files in a package

Hi I maintain the sdlpop package in AUR, running namcap against the build package fails with this error

$ namcap sdlpop-1.16-2-x86_64.pkg.tar.xz 
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.5/site-packages/namcap.py", line 250, in <module>
    process_realpackage(package, active_modules)
  File "/usr/lib/python3.5/site-packages/namcap.py", line 103, in process_realpackage
    rule.analyze(pkginfo, pkgtar)
  File "/usr/lib/python3.5/site-packages/Namcap/rules/shebangdepends.py", line 109, in analyze
    pkglist, orphans = findowners(scriptlist)
  File "/usr/lib/python3.5/site-packages/Namcap/rules/shebangdepends.py", line 72, in findowners
    stdout = subprocess.PIPE, stderr = subprocess.PIPE)
  File "/usr/lib/python3.5/subprocess.py", line 950, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1483, in _execute_child
    restore_signals, start_new_session, preexec_fn)
ValueError: embedded null byte

The package contains a bash script (maybe that's of interest? ... shebangdepends.py)

#!/bin/bash
cd /usr/share/sdlpop
./prince "$@"

I looked into the python files and searched google, but since I'm not very familiar with python I was not able to figure out what exactly is going wrong.

I'm wondering if it's a probmlem with my package, namcap or python?

edit:
I tried to exclude the bash script from the package, but still same error.
So maybe there is a problem with some file from the sources?

edit:
changed thread title

Last edited by mis (2016-06-16 16:30:33)

Offline

#2 2016-06-15 15:22:53

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [solved] namcap fails due to some binary data files in a package

Update:

I figured out that some (don't know which exactly or all of them) of these files [1] are responsible for the error. (there were no changes to these files since the last release)
If I don't include them in the package there is no error running namcap.

Obviously the files contain the game's level data, in some binary format.
So I dont't know how to get rid of that error. sad

[1]
https://github.com/NagyD/SDLPoP/tree/ma … s-original
https://github.com/NagyD/SDLPoP/tree/ma … evels-test
https://github.com/NagyD/SDLPoP/tree/ma … LEVELS.DAT

Last edited by mis (2016-06-15 15:31:32)

Offline

#3 2016-06-15 22:23:19

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [solved] namcap fails due to some binary data files in a package

I think i've found the root of the problem. Some of the files start with #!
For example (opened with nano)

#!#^@^@^@^@##^K44^T^@

Looking into shebangdepends.py to me it looks like namcap think it has found a shebang and then fails because it actually isn't one.

I don't know if it's relevant, but when I open that file with kate, kate complains:

res2012.bin was opened with UTF-8 encoding but contained invalid characters.

I've written a PKGBUILD to reproduce the error with that file.

pkgname=trigger-namcap-error
pkgver=1
pkgrel=1
arch=('any')
source=("https://github.com/NagyD/SDLPoP/blob/master/data/LEVELS.DAT/res2012.bin?raw=true")
sha1sums=('0c581adfc7d728d30d78debf30ad15fc69e1e7ea')

package() {
  install -Dm644 "res2012.bin?raw=true" "$pkgdir/usr/share/$pkgname/res2012.bin"
}

Should I file a bugreport?

Last edited by mis (2016-06-16 16:33:17)

Offline

#4 2016-06-16 16:33:43

mis
Member
Registered: 2016-03-16
Posts: 234

Re: [solved] namcap fails due to some binary data files in a package

I filed a bugreport and sent a patch, so I will mark this as solved.

Offline

Board footer

Powered by FluxBB