troglobit / zoo

public domain zoo archive tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Great to have a new upstream version! But....

Rhialto opened this issue · comments

I've looked at the packaging of zoo in pkgsrc (see http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/archivers/zoo/?only_with_tag=MAIN ) and it seems that the server which we used for upstream sources (ftp://ftp.kiarchive.ru/pub/unix/arcers/zoo-2.10pl1.tar.gz) has disappeared.

I was considering to switch to your repo even though it contains different patches than pkgsrc does. However, it doesn't compile:

troglobit-zoo$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/pkg/bin/ggrep
checking for egrep... /usr/pkg/bin/ggrep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking X usability... no
checking X presence... no
checking for X... no
checking $CC usability... no
checking $CC presence... no
checking for $CC... no
checking -c usability... no
checking -c presence... no
checking for -c... no
checking $CFLAGS usability... no
checking $CFLAGS presence... no
checking for $CFLAGS... no
checking $CPPFLAGS usability... no
checking $CPPFLAGS presence... no
checking for $CPPFLAGS... no
checking conftest.$ac_ext usability... no
checking conftest.$ac_ext presence... no
checking for conftest.$ac_ext... no
checking >&5 usability... no
checking >&5 presence... no
checking for >&5... no
checking for nftw... yes
checking build system type... x86_64-unknown-netbsd9.1
checking host system type... x86_64-unknown-netbsd9.1
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating man/Makefile
config.status: creating src/Makefile
config.status: creating test/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands

------------------ Summary ------------------
 zoo version 2.11-beta1
  Prefix................: /usr/local
  Sysconfdir............: /usr/local/etc
  Localstatedir.........: /usr/local/var
  C Compiler............: gcc -g -O2

Optional features:
  fiz...................: no
  ooz...................: no
  unzoo.................: yes

------------- Compiler version --------------
gcc (nb4 20200810) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
---------------------------------------------

Check the above options and compile with:
 make

troglobit-zoo$ gmake
Making all in man
gmake[1]: Entering directory '/mnt/scratch/scratch/tmp/conversion/troglobit-zoo/man'
gmake[1]: Nothing to be done for 'all'.
gmake[1]: Leaving directory '/mnt/scratch/scratch/tmp/conversion/troglobit-zoo/man'
Making all in src
gmake[1]: Entering directory '/mnt/scratch/scratch/tmp/conversion/troglobit-zoo/src'
gmake  all-am
gmake[2]: Entering directory '/mnt/scratch/scratch/tmp/conversion/troglobit-zoo/src'
  CC       zoo-addbfcrc.o
  CC       zoo-addfname.o
addfname.c: In function 'addfname':
addfname.c:60:16: warning: passing argument 1 of 'erealloc' from incompatible pointer type [-Wincompatible-pointer-types]
       erealloc(fentry, sizeof(struct item *) * sz_fentry);
                ^~~~~~
In file included from addfname.c:17:0:
zoofns.h:24:9: note: expected 'char *' but argument is of type 'struct item **'
 VOIDPTR erealloc (VOIDPTR, unsigned int);
         ^~~~~~~~
  CC       zoo-basename.o
  CC       zoo-comment.o
comment.c: In function 'comment':
comment.c:130:14: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
    oldsignal = signal(SIGINT, SIG_IGN);
              ^
comment.c:134:19: warning: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types]
    signal(SIGINT, oldsignal);
                   ^~~~~~~~~
In file included from /usr/include/signal.h:45:0,
                 from comment.c:19:
/usr/include/sys/signal.h:239:8: note: expected 'void (*)(int)' but argument is of type 'int (*)()'
 void (*signal(int, void (*)(int)))(int);
        ^~~~~~
  CC       zoo-crcdefs.o
  CC       zoo-getfile.o
  CC       zoo-lzc.o
  CC       zoo-lzd.o
  CC       zoo-lzh.o
  CC       zoo-machine.o
  CC       zoo-makelist.o
  CC       zoo-misc.o
misc.c: In function 'writedir':
misc.c:206:12: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
  oldsignal = signal(SIGINT, SIG_IGN);
            ^
misc.c:211:17: warning: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types]
  signal(SIGINT, oldsignal);
                 ^~~~~~~~~
In file included from /usr/include/signal.h:45:0,
                 from misc.c:8:
/usr/include/sys/signal.h:239:8: note: expected 'void (*)(int)' but argument is of type 'int (*)(int)'
 void (*signal(int, void (*)(int)))(int);
        ^~~~~~
misc.c: In function 'writenull':
misc.c:354:12: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
  oldsignal = signal(SIGINT, SIG_IGN);
            ^
misc.c:359:17: warning: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types]
  signal(SIGINT, oldsignal);
                 ^~~~~~~~~
In file included from /usr/include/signal.h:45:0,
                 from misc.c:8:
/usr/include/sys/signal.h:239:8: note: expected 'void (*)(int)' but argument is of type 'int (*)()'
 void (*signal(int, void (*)(int)))(int);
        ^~~~~~
  CC       zoo-misc2.o
misc2.c: In function 'emalloc':
misc2.c:140:7: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
   arr = ptr;
       ^
  CC       zoo-nextfile.o
  CC       zoo-needed.o
  CC       zoo-options.o
  CC       zoo-parse.o
  CC       zoo-portable.o
  CC       zoo-prterror.o
prterror.c:71:12: fatal error: varargs.h: No such file or directory
 #  include <varargs.h>
            ^~~~~~~~~~~
compilation terminated.
gmake[2]: *** [Makefile:1260: zoo-prterror.o] Error 1
gmake[2]: Leaving directory '/mnt/scratch/scratch/tmp/conversion/troglobit-zoo/src'
gmake[1]: *** [Makefile:371: all] Error 2
gmake[1]: Leaving directory '/mnt/scratch/scratch/tmp/conversion/troglobit-zoo/src'
gmake: *** [Makefile:404: all-recursive] Error 1
troglobit-zoo$

I also noticed patch 3-fix-manage-archive-under-AMD64.patch (cd71ff8) which is a horrible way to fix this 64-bit issue. I did it like this in 2009: https://gitlab.com/Rhialto/zoo/-/commit/7b328789b603c23aa374b0e39ae93f83b717fabd#75e95b0babeec552ef29ad7d4ebf0b62e29a1402_226_226

I think some of the changes in 2.10pl1 (rather than 2.10) might make a difference here:
https://gitlab.com/Rhialto/zoo/-/commit/1ca9e2215ddf96a5d3ed41dc02336d293282ed65
in particular looking at __STDC__ in options.h and in particular setting STDARG and, I'm guessing, T_SIGNAL based on that. But those things (everything in options.h) are of course still better detected in the configure script.

Hi @Rhialto, I've just "recently" adopted zoo and only tested it on Linux so far. There's a LOT of changes and cleanup being made to the code base, and it's far from finished. I'll have a look at your pointers later, if I get some time over (as planned) over the winter holidays.

The 64-bit issue "solved" in the references Debian patch is already fixed in b63c543.

Thanks @troglobit that is great to hear. No rush. One should enjoy one's hobby :-)

@Rhialto there, took me few years to circle back, but it should build better now :-)

Ah yes, indeed it compiles! Great!

I plan to compare your set of patches with my set of patches, to see if there is something in my set that you can still use or need. It will be a bit annoying to do since we begin with slightly different baselines: you from 2.10 and I from 2.10 patchlevel 1. I suspect, for example, that your Debian 01-old-fixes.patch might be derived from this pl1 patch, but who knows :) Also I'm quite sure that both patch sets attack similar sort of issues but likely not in 100% the same way. So this puzzle won't be done tomorrow.

For now, at least, thanks!