Bug 277667 - print/ghostscript10: version 10.03.0 fails in build phase in poudriere
Summary: print/ghostscript10: version 10.03.0 fails in build phase in poudriere
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Osipov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-13 12:10 UTC by Guido Falsi
Modified: 2024-03-13 20:34 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (michael.osipov)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Falsi freebsd_committer freebsd_triage 2024-03-13 12:10:26 UTC
Hi,

In my poudriere machine the latest update to ghostscript fails to build with the  error at eh end of the message (full log available if needed).

I'm using the default options, and have observer failures on amd64, version 14.0-RELEASE and on recent head.


Looks like some incompatibility with the clang version being used.



cc  -DHAVE_MKSTEMP  -DHAVE_FSEEKO  -DHAVE_FONTCONFIG -DHAVE_LIBIDN -DHAVE_SETLOCALE -DHAVE_SSE2  -DHAVE_BSWAP32 -DHAVE_BYTESWAP_H -DHAVE_STRERROR -DHAVE_ISNAN -DHAVE_ISINF  -DHAVE_PREAD_PWRITE=1 -DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE -O2 -DNDEBUG -fPIC  -fvisibility=hidden -DGSDLLEXPORT="__attribute__((visibility(\"default\")))" -DLIBICONV_PLUG -isystem /usr/local/include  -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -fno-strict-aliasing -Werror=declaration-after-statement -fno-builtin -fno-common -Werror=return-type -Wno-unused-local-typedefs -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIBDL=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -D__USE_UNIX98=1 -DHAVE_SNPRINTF  -DBUILD_PDF=1 -I./pdf -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DHAVE_RESTRICT=1 -I/usr/local/include -DUSE_LIBPAPER -I/usr/local/include -fno-strict-aliasing -DHAVE_POPEN_PROTO=1   -DSHARE_JPX=1 -I/usr/local/include/openjpeg-2.5 -DUSE_OPENJPEG_JP2  -DPDF_INCLUDED -I./pdf -I./soobj -I./pcl/pl -I./base -Isrc/lib -I./jpegxr -Isrc -Isrc/src/lib/openjp2 -Isrc -c ./pdf/pdf_sec.c -o ./soobj/pdf_sec.o

./pdf/pdf_sec.c:186:25: warning: incompatible pointer types assigning to 'char **' from 'char *'; take the address with & [-Wincompatible-pointer-types]
            NewPassword = Password;
                        ^ ~~~~~~~~
                          &
./pdf/pdf_sec.c:187:20: error: incompatible integer to pointer conversion assigning to 'int *' from 'int'; take the address with & [-Wint-conversion]
            NewLen = Len;
                   ^ ~~~
                     &
1 warning and 1 error generated.
gmake[2]: *** [pdf/pdf.mak:169: soobj/pdf_sec.o] Error 1
Comment 1 Jordan Ostreff 2024-03-13 12:34:47 UTC
I have been hit by same bug too.

cc  -DHAVE_MKSTEMP  -DHAVE_FSEEKO  -DHAVE_FONTCONFIG -DHAVE_LIBIDN -DHAVE_SETLOCALE -DHAVE_SSE2  -DHAVE_BSWAP32 -DHAVE_BYTESWAP_H -DHAVE_STRERROR -DHAVE_ISNAN -DHAVE_ISINF  -DHAVE_PREAD_PWRITE=1 -DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE -O2 -DNDEBUG -fPIC  -fvisibility=hidden -DGSDLLEXPORT="__attribute__((visibility(\"default\")))" -DLIBICONV_PLUG -isystem /usr/local/include  -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -fno-strict-aliasing -Werror=declaration-after-statement -fno-builtin -fno-common -Werror=return-type -Wno-unused-local-typedefs -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIBDL=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -D__USE_UNIX98=1 -DHAVE_SNPRINTF  -DBUILD_PDF=1 -I./pdf -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DHAVE_RESTRICT=1 -I/usr/local/include -DUSE_LIBPAPER -I/usr/local/include -fno-strict-aliasing -DHAVE_POPEN_PROTO=1   -DSHARE_JPX=1 -I/usr/local/include/openjpeg-2.5 -DUSE_OPENJPEG_JP2  -DPDF_INCLUDED -I./pdf -I./soobj -I./pcl/pl -I./base -Isrc/lib -I./jpegxr -Isrc -Isrc/src/lib/openjp2 -Isrc -c ./pdf/pdf_obj.c -o ./soobj/pdf_obj.o
./pdf/pdf_sec.c:186:25: warning: incompatible pointer types assigning to 'char **' from 'char *'; take the address with & [-Wincompatible-pointer-types]
  186 |             NewPassword = Password;
      |                         ^ ~~~~~~~~
      |                           &
./pdf/pdf_sec.c:187:20: error: incompatible integer to pointer conversion assigning to 'int *' from 'int'; take the address with & [-Wint-conversion]
  187 |             NewLen = Len;
      |                    ^ ~~~
      |                      &
cc  -DHAVE_MKSTEMP  -DHAVE_FSEEKO  -DHAVE_FONTCONFIG -DHAVE_LIBIDN -DHAVE_SETLOCALE -DHAVE_SSE2  -DHAVE_BSWAP32 -DHAVE_BYTESWAP_H -DHAVE_STRERROR -DHAVE_ISNAN -DHAVE_ISINF  -DHAVE_PREAD_PWRITE=1 -DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE -O2 -DNDEBUG -fPIC  -fvisibility=hidden -DGSDLLEXPORT="__attribute__((visibility(\"default\")))" -DLIBICONV_PLUG -isystem /usr/local/include  -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -fno-strict-aliasing -Werror=declaration-after-statement -fno-builtin -fno-common -Werror=return-type -Wno-unused-local-typedefs -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIBDL=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -D__USE_UNIX98=1 -DHAVE_SNPRINTF  -DBUILD_PDF=1 -I./pdf -O2 -pipe  -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DHAVE_RESTRICT=1 -I/usr/local/include -DUSE_LIBPAPER -I/usr/local/include -fno-strict-aliasing -DHAVE_POPEN_PROTO=1   -DSHARE_JPX=1 -I/usr/local/include/openjpeg-2.5 -DUSE_OPENJPEG_JP2  -DPDF_INCLUDED -I./pdf -I./soobj -I./pcl/pl -I./base -Isrc/lib -I./jpegxr -Isrc -Isrc/src/lib/openjp2 -Isrc -c ./pdf/pdf_doc.c -o ./soobj/pdf_doc.o
1 warning and 1 error generated.
gmake[2]: *** [pdf/pdf.mak:169: soobj/pdf_sec.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/usr/ports/print/ghostscript10/work/ghostscript-10.03.0'
gmake[1]: *** [base/unix-dll.mak:321: so-only-subtarget] Error 2
gmake[1]: Leaving directory '/usr/ports/print/ghostscript10/work/ghostscript-10.03.0'
gmake: *** [base/unix-dll.mak:281: so] Error 2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/print/ghostscript10
*** Error code 1

Stop.
make: stopped in /usr/ports/print/ghostscript10

===>>> make build failed for print/ghostscript10
===>>> Aborting update

===>>> Update for print/ghostscript10 failed
===>>> Aborting update


===>>> You can restart from the point of failure with this command line:
       portmaster <flags> print/ghostscript10
Comment 2 Michael Osipov freebsd_committer freebsd_triage 2024-03-13 12:35:44 UTC
Let me try to reproduce as well, I think I will need to report this upstream.
Comment 3 Michael Osipov freebsd_committer freebsd_triage 2024-03-13 12:42:20 UTC
There is already an upstream one-off patch: https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=90cabe08422afdd16bac5dd9217602679d943045

Can you try to apply locally and confirm? If so, I will include the patch and bump the port revision.
Comment 4 Michael Osipov freebsd_committer freebsd_triage 2024-03-13 13:08:18 UTC
Working on a review.
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2024-03-13 13:13:21 UTC
(In reply to Michael Osipov from comment #3)
Build without errors for me on 13.3 amd64 with patch and fails without patch.
On 13.2 build without errors without patch too, but probably fail in runtime.
Comment 6 Michael Osipov freebsd_committer freebsd_triage 2024-03-13 13:37:20 UTC
Here is the review, guys: https://reviews.freebsd.org/D44339
Comment 7 Jordan Ostreff 2024-03-13 13:48:17 UTC
(In reply to Michael Osipov from comment #4)
on my machine it also works
Comment 8 Guido Falsi freebsd_committer freebsd_triage 2024-03-13 14:13:44 UTC
(In reply to Michael Osipov from comment #6)

The patch in the review build and packages fine.

Thank you a lot for the quick feedback!


I'll followup in the review too shortly.
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-03-13 20:32:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5e3da22d048fd24991444fc7039f9a851e7652b0

commit 5e3da22d048fd24991444fc7039f9a851e7652b0
Author:     Michael Osipov <michael.osipov@siemens.com>
AuthorDate: 2024-03-13 12:59:33 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2024-03-13 20:31:50 +0000

    print/ghostscript10: fix compilation issue with LLVM > 14

    This issue reported upstream with
    https://bugs.ghostscript.com/show_bug.cgi?id=707649 has been fixed and
    one-off patch backported to this port.

    PR:             277667
    Approved by:    jrm (mentor)
    Differential Revision:  https://reviews.freebsd.org/D44339

 print/ghostscript10/Makefile | 4 ++++
 print/ghostscript10/distinfo | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 10 Michael Osipov freebsd_committer freebsd_triage 2024-03-13 20:34:42 UTC
Upsteam fix has been backported.