gdraheim / zziplib

The ZZIPlib provides read access on ZIP-archives and unpacked data. It features an additional simplified API following the standard Posix API for file access
Other
63 stars 52 forks source link

$(MKZIP) is called for test0.zip even when not found #37

Open mojca opened 6 years ago

mojca commented 6 years ago

With a bunch of tests on msys2, the zip binary was not found during configuration:

checking for zip... no
checking for pkzip... no

this apparently prevents some tests to be run (there's a condition for that in configure.ac), but not in all cases:

cd tmp && : ../test0.zip README
rm -r tmp
test -s test0.zip && cp -v test0.zip ../../zziplib/test/test.zip
make[3]: *** [Makefile:686: test0.zip] Error 1

The first like should have been

cd tmp && $(MKZIP) ../test0.zip README

but $(MKZIP) has not been set.

The following part is equally problematic:

zzshowme$(EXEEXT) : zzipself$(EXEEXT) zzipsetstub$(EXEEXT)
    $(MKZIP) -0 -j $@ .libs/zzipself$(EXEEXT)
    $(MKZIP) -9 -j $@ $(README)
    - test -s $@ || cp test2.zip $@
    test ! -f $@.zip || mv $@.zip $@
    ./zzipsetstub $@ .libs/zzipself$(EXEEXT)
    - chmod +x $@

and results in

: -0 -j zzshowme.exe .libs/zzipself.exe
: -9 -j zzshowme.exe ../../zziplib/README
test -s zzshowme.exe || cp test2.zip zzshowme.exe
cp: cannot stat 'test2.zip': No such file or directory
make[2]: [Makefile:717: zzshowme.exe] Error 1 (ignored)
test ! -f zzshowme.exe.zip || mv zzshowme.exe.zip zzshowme.exe
./zzipsetstub zzshowme.exe .libs/zzipself.exe
zzshowme.exe: No such file or directory
gdraheim commented 6 years ago

well, a zip-program is a requirement for test, sorry about that.

mojca commented 6 years ago

That's fine. But in that case the fact should be communicated to the user. For example, I would expect make check to fail immediately with unable to find zip when MKZIP is undefined. I would then know immediately what to do. The way it is now it's not even clear what exactly is going on, just some weird inexplicable failures.