Closed PhilterPaper closed 3 years ago
Could the .h files on 5.22 be the older versions that don't include the *_t declarations? I thought they had been around for a while.
Me too. I looked at tiff.h, where the new deprecation message was defined in 4.3.0 and couldn't see any significant difference from 4.0.3 to 4.2.0. My mistake. I only had machines with 4.0.10 up to 4.3.0 available to test.
What version of libtiff does 5.22 have?
There is only one non-pass in the testing matrix so far, and that is a problem with dmake, not libtiff.
Strawberry Perl 5.22 has libtiff 4.0.3. The build appears to fail because the *_t typedefs or declarations do not appear to have been defined. Possibly that is a matter of .h file include order?
I still can not test on 5.26 (libtiff 4.0.7) -- cpan insists that GT 13 is the current latest available. For some reason the local database won't update. Later today, if it hasn't improved, I'll try some means of forcing a GT 14 install.
The non-pass on CPANTS looks much like the problem I discussed earlier with the 5.22 build and no target in the Makefile. This might have something to do with using dmake instead of gmake. I wonder why the problem seemed to go away for a while and is now back?
There is also now a test failure due to libtiff 4.0.3 not having the *_t typedefs. I'm not clear at the moment how I can switch between the different typedefs according to the libtiff version. Send a message to the libtiff mailing list and see if they have some advice for me.
The dmake error is
dmake.exe: makefile: line 487: Error: -- Missing targets or attributes in rule
Which I think means that dmake doesn't support all of the features that MakeMaker is trying to use when creating the Makefile. If you can reproduce the dmake error, I'd be interested in the contents of the line it barfs at.
I discussed the dmake issue of creating empty targets in #2 and especially #3. Have you checked those? $(INST_DYNAMIC_LIB)
is not defined, but I couldn't chase it down much further. The code that defines it is documented in MakeMaker, but your setup is not calling the particular routine.
Regarding the missing *_t definitions, I think those are typedefs and not elementary C/C++ declarations. Perhaps swapping the order of .h includes, or adding a new one such as stdint.h, would work across all Perl levels?
Bad news. It finally tried installing on Perl 5.26 and it failed the same way. Some of the error messages were a little different, e.g., asking "did you mean uint16 when you said unit16_t"?
Running install for module 'Graphics::TIFF'
CPAN: LWP::UserAgent loaded ok (v6.54)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/R/RA/RATCLIFFE/Graphics-TIFF-14.tar.gz
CPAN: YAML::XS loaded ok (v0.83)
CPAN: Digest::SHA loaded ok (v6.02)
CPAN: Compress::Zlib loaded ok (v2.102)
Checksum for C:\STRAWB~1\cpan\sources\authors\id\R\RA\RATCLIFFE\Graphics-TIFF-14.tar.gz ok
CPAN: Archive::Tar loaded ok (v2.38)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20210521)
Configuring R/RA/RATCLIFFE/Graphics-TIFF-14.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for Graphics::TIFF
Writing MYMETA.yml and MYMETA.json
RATCLIFFE/Graphics-TIFF-14.tar.gz
C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for R/RA/RATCLIFFE/Graphics-TIFF-14.tar.gz
cp lib/Graphics/TIFF.pm blib\lib\Graphics\TIFF.pm
Running Mkbootstrap for TIFF ()
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "TIFF.bs"
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- TIFF.bs blib\arch\auto\Graphics\TIFF\TIFF.bs 644
"C:\Strawberry\perl\bin\perl.exe" "C:\Strawberry\perl\lib\ExtUtils/xsubpp" -typemap C:\STRAWB~1\perl\lib\ExtUtils\typemap -typemap C:\STRAWB~1\cpan\build\Graphics-TIFF-14-0\typemap TIFF.xs > TIFF.xsc
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- TIFF.xsc TIFF.c
gcc -c -I. -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"14\" -DXS_VERSION=\"14\" "-IC:\STRAWB~1\perl\lib\CORE" TIFF.c
TIFF.c: In function 'XS_Graphics__TIFF_IsCODECConfigured':
TIFF.c:189:2: error: unknown type name 'uint16_t'; did you mean 'uint16'?
uint16_t compression = (uint16_t)SvIV(ST(1))
^~~~~~~~
uint16
TIFF.c:189:26: error: 'uint16_t' undeclared (first use in this function); did you mean 'uint16'?
uint16_t compression = (uint16_t)SvIV(ST(1))
^~~~~~~~
uint16
TIFF.c:189:26: note: each undeclared identifier is reported only once for each function it appears in
TIFF.c: In function 'XS_Graphics__TIFF_SetDirectory':
TIFF.c:412:2: error: unknown type name 'uint16_t'; did you mean 'uint16'?
uint16_t dirnum = (uint16_t)SvIV(ST(1))
^~~~~~~~
uint16
TIFF.c:412:21: error: 'uint16_t' undeclared (first use in this function); did you mean 'uint16'?
uint16_t dirnum = (uint16_t)SvIV(ST(1))
^~~~~~~~
uint16
TIFF.c: In function 'XS_Graphics__TIFF_SetSubDirectory':
TIFF.c:443:2: error: unknown type name 'uint64_t'; did you mean 'uint64'?
uint64_t diroff = (uint64_t)SvIV(ST(1))
^~~~~~~~
uint64
TIFF.c:443:21: error: 'uint64_t' undeclared (first use in this function); did you mean 'uint64'?
uint64_t diroff = (uint64_t)SvIV(ST(1))
^~~~~~~~
uint64
TIFF.c: In function 'XS_Graphics__TIFF_GetField':
TIFF.c:474:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t tag = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:474:18: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t tag = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.xs:282:17: error: unknown type name 'uint16_t'; did you mean 'uint16'?
uint16_t ui16, ui16_2, *aui16, *aui16_2, *aui16_3;
^~~~~~~~
uint16
TIFF.xs:283:33: error: expected ';' before 'ui32'
uint32_t ui32;
^~~~
TIFF.xs:284:17: error: unknown type name 'uint64_t'; did you mean 'uint64'?
uint64_t *aui;
^~~~~~~~
uint64
TIFF.xs:342:42: error: 'uint16_t' undeclared (first use in this function); did you mean 'uint32_t'?
if ((aui16 != (uint16_t *) NULL)
^~~~~~~~
uint32_t
TIFF.xs:342:52: error: expected expression before ')' token
if ((aui16 != (uint16_t *) NULL)
^
TIFF.xs:395:54: error: 'ui32' undeclared (first use in this function); did you mean 'ui16'?
if (TIFFGetField (tif, tag, &ui32)) {
^~~~
ui16
TIFF.c: In function 'XS_Graphics__TIFF_GetFieldDefaulted':
TIFF.c:623:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t tag = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:623:18: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t tag = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.xs:406:17: error: unknown type name 'uint16_t'; did you mean 'uint16'?
uint16_t ui16, ui16_2, *aui16, *aui16_2, *aui16_3;
^~~~~~~~
uint16
TIFF.xs:407:33: error: expected ';' before 'ui32'
uint32_t ui32;
^~~~
TIFF.xs:408:17: error: unknown type name 'uint64_t'; did you mean 'uint64'?
uint64_t *aui;
^~~~~~~~
uint64
TIFF.xs:464:42: error: 'uint16_t' undeclared (first use in this function); did you mean 'uint32_t'?
if ((aui16 != (uint16_t *) NULL)
^~~~~~~~
uint32_t
TIFF.xs:464:52: error: expected expression before ')' token
if ((aui16 != (uint16_t *) NULL)
^
TIFF.xs:499:63: error: 'ui32' undeclared (first use in this function); did you mean 'ui16'?
if (TIFFGetFieldDefaulted (tif, tag, &ui32)) {
^~~~
ui16
TIFF.c: In function 'XS_Graphics__TIFF_SetField':
TIFF.c:752:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t tag = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:752:18: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t tag = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.xs:510:17: error: unknown type name 'uint16_t'; did you mean 'uint16'?
uint16_t ui16, ui16_2;
^~~~~~~~
uint16
TIFF.xs:511:33: error: expected ';' before 'ui32'
uint32_t ui32;
^~~~
TIFF.xs:532:25: error: 'ui32' undeclared (first use in this function); did you mean 'ui16'?
ui32 = SvIV(ST(2));
^~~~
ui16
TIFF.c: In function 'XS_Graphics__TIFF_ComputeStrip':
TIFF.c:983:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t row = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:983:18: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t row = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:985:2: error: unknown type name 'uint16_t'; did you mean 'uint16'?
uint16_t sample = (uint16_t)SvIV(ST(2))
^~~~~~~~
uint16
TIFF.c:985:21: error: 'uint16_t' undeclared (first use in this function); did you mean 'uint32_t'?
uint16_t sample = (uint16_t)SvIV(ST(2))
^~~~~~~~
uint32_t
TIFF.c: In function 'XS_Graphics__TIFF_ReadEncodedStrip':
TIFF.c:1016:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t strip = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:1016:20: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t strip = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c: In function 'XS_Graphics__TIFF_WriteEncodedStrip':
TIFF.c:1059:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t strip = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:1059:20: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t strip = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c: In function 'XS_Graphics__TIFF_ReadRawStrip':
TIFF.c:1098:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t strip = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:1098:20: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t strip = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c: In function 'XS_Graphics__TIFF_ReadTile':
TIFF.c:1141:2: error: unknown type name 'uint32_t'; did you mean 'uint32'?
uint32_t x = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:1141:16: error: 'uint32_t' undeclared (first use in this function); did you mean 'uint32'?
uint32_t x = (uint32_t)SvIV(ST(1))
^~~~~~~~
uint32
TIFF.c:1143:11: error: expected ';' before 'y'
uint32_t y = (uint32_t)SvIV(ST(2))
^
TIFF.c:1145:11: error: expected ';' before 'z'
uint32_t z = (uint32_t)SvIV(ST(3))
^
TIFF.c:1147:2: error: unknown type name 'uint16_t'; did you mean 'uint16'?
uint16_t s = (uint16_t)SvIV(ST(4))
^~~~~~~~
uint16
TIFF.c:1147:16: error: 'uint16_t' undeclared (first use in this function); did you mean 'uint32_t'?
uint16_t s = (uint16_t)SvIV(ST(4))
^~~~~~~~
uint32_t
TIFF.xs:640:53: error: 'y' undeclared (first use in this function)
bufsize = TIFFReadTile(tif, buf, x, y, z, s);
^
TIFF.xs:640:56: error: 'z' undeclared (first use in this function)
bufsize = TIFFReadTile(tif, buf, x, y, z, s);
^
gmake: *** [Makefile:340: TIFF.o] Error 1
RATCLIFFE/Graphics-TIFF-14.tar.gz
C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'Graphics::TIFF'.
Bad news. It finally tried installing on Perl 5.26 and it failed the same way. Some of the error messages were a little different, e.g., asking "did you mean uint16 when you said unit16_t"?
So it looks as though the new types were introduced somewhere between 4.0.7 and 4.0.10?
The slight difference in error message is probably due to a slightly different compiler version.
I had assumed the *_t types were from libtiff. They are not. They were introduced in the C standard in C99. i.e. Strawberry Perl 5.22 and 5.26 seem to be shipping with C89.
Would you mind testing this patch with those two older compilers, please?
If it fixes the problem, I'll release a new version ASAP.
I managed to get a Strawberry Perl 5.22 Windows CI runner working, which obviously failed without the patch, but passes with it (and by the way runs with dmake).
So I consider this fixed and will release a new version with the patch tomorrow.
See my comments on the patch commit. :-)
Everything looking good with GT-15 release. Strawberry Perl 5.22 (libtiff 4.0.3), 5.26 (libtiff 4.0.7), and 5.32 (libtiff 4.0.10) all build and install without problem, and the tests run fine. :-)
Thanks for the confirmation!
Something seems to have gone wrong with 5.22, possibly related to getting rid of the deprecated types:
Could the .h files on 5.22 be the older versions that don't include the *_t declarations? I thought they had been around for a while.
GT upgrades to 14 OK on Perl 5.32. I can't test 5.26 until the GT 13 in the cached database ages out tonight.