Spec URL: https://coherentpdf.com/fedora/ocaml-camlpdf.spec SRPM URL: https://coherentpdf.com/fedora/ocaml-camlpdf-2.8.1-1.fc41.src.rpm Description: OCaml library for reading, writing and modifying PDFs. The basis of the Cpdf command line tools. Fedora Account System Username: johnwhitington Notes: 1. I have included an ExcludeArch for i686, but Koji seems to ignore it. 2. The %build/%install sections are not gated on ocaml_native_compiler because CamlPDF's build system already knows how to detect bytecode-only environments. 3. Lint errors: ocaml-camlpdf.x86_64: W: unstripped-binary-or-object/usr/lib64/ocaml/stublibs/dllcampdf_stubs.so ocaml-camlpdf-devel.x86_64: E: static-library-without-debuginfo/usr/lib64/ocaml/camlpdf/camlpdf.a ocaml-camlpdf-devel.x86_64: E: static-library-without-debuginfo/usr/lib64/ocaml/camlpdf/libcamlpdf_stubs.a These seem to be common with OCaml packages. ocaml-camlpdf-devel.x86_64: W: no-documentation Q: Where, if anywhere, should the HTML ocamldoc output be installed? Other packages don't seem to install it. ocaml-camlpdf.spec: W: no-%check-section ocaml-camlpdf.spec: W: no-%check-section Q: What if anything is appropriate here?
Copr build: https://copr.fedorainfracloud.org/coprs/build/8982518 (succeeded) Review template: https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2363088-ocaml-camlpdf/fedora-rawhide-x86_64/08982518-ocaml-camlpdf/fedora-review/review.txt Please take a look if any issues were found. --- This comment was created by the fedora-review-service https://github.com/FrostyX/fedora-review-service If you want to trigger a new Copr build, add a comment containing new Spec and SRPM URLs or [fedora-review-service-build] string.
Instead of the ExcludeArch, use: ExclusiveArch: %{ocaml_native_compiler} (assuming, as you probably do, you want to ignore bytecode arches). This macro is provided by this package and updated regularly: https://src.fedoraproject.org/rpms/ocaml-srpm-macros/commits/rawhide Unless there's a very good reason, you should drop this: %global debug_package %{nil} Your build system should be fixed to make sure that -g is passed to every compiler invocation (maybe with a configure-time switch to turn this on or off if you prefer). Also I'm confused about why you need to limit _smp_ncpus_max to 1, what is the reason for that?
Thanks Richard: 1. ExclusiveArch %{ocaml_native_compiler}. Thanks. Fixed. 2. %global debug_package %{nil}. Fails if removed. When compiling CamlPDF, the only invocations without -g are when ocamlc compiles .mli files. Is it really needed there? If so, I'll see if it can be fixed, though it may involve hackery. 3. _smp_ncpus_max to 1. This is because OCamlMakefile breaks under -j.
It shouldn't be needed to use -g for *.mli files (although I don't think it hurts). What's the error message?
Excerpt: + /usr/bin/find-debuginfo -j1 --strict-build-id -m -i --build-id-seed 2.8.1-1.fc41 --unique-debug-suffix -2.8.1-1.fc41.x86_64 --unique-debug-src-base ocaml-camlpdf-2.8.1-1.fc41.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/ocaml-camlpdf-2.8.1-build/camlpdf-2.8.1 find-debuginfo: starting Extracting debug info from 1 files Error while writing index for `/builddir/build/BUILD/ocaml-camlpdf-2.8.1-build/BUILDROOT/usr/lib64/ocaml/stublibs/dllcamlpdf_stubs.so': No debugging symbols gdb-add-index: No index was created for /builddir/build/BUILD/ocaml-camlpdf-2.8.1-build/BUILDROOT/usr/lib64/ocaml/stublibs/dllcamlpdf_stubs.so gdb-add-index: [Was there no debuginfo? Was there already an index?] DWARF-compressing 1 files sepdebugcrcfix: Updated 0 CRC32s, 1 CRC32s did match. Creating .debug symlinks for symlinks to ELF files find-debuginfo: done Full log: https://coherentpdf.com/fedora/build.log (Sidenote: I copied the %global debug_package %{nil} from here https://docs.fedoraproject.org/en-US/packaging-guidelines/OCaml/ so if that's wrong, it wants updating...)
It seems as if it's very specifically complaining about dllcamlpdf_stubs.so. Since that has the C bindings but you're not passing "-g" in the -ccopt list (ie. to the C compiler), maybe that's the problem?
Thanks. I have patched Makefile (and, in fact, OCamlMakefile too, since it wasn't passing -ccopts when building with -custom). There are now no complaints in the build log about debug information extraction. Fedpkg lint still fails with this, however: ocaml-camlpdf-devel.x86_64: E: static-library-without-debuginfo /usr/lib64/ocaml/camlpdf/camlpdf.a ocaml-camlpdf-devel.x86_64: E: static-library-without-debuginfo /usr/lib64/ocaml/camlpdf/libcamlpdf_stubs.a Koji builds ok. Here's the updated spec file, patch file, and srpm: https://www.coherentpdf.com/fedora/ocaml-camlpdf-2.zip And here's the build log: https://www.coherentpdf.com/fedora/build.log
Actually, that OCamlmakefile change may be wrong and/or unneeded. Let me take a look.
Right. It seems that the OCamlMakefile part of the patch (where we pass -ccopt "-o2 -g" even when building with -custom): a) Isn't required for the mockbuild debuginfo extraction to succeed. Just fixing Makefile alone fixes that. b) Means that when I build cpdf (which uses camlpdf) I get a cpdf.dSYM folder created, which was not previously the case. Is that good? c) -o2 here causes problems. So if we keep the OCamlMakefile part of the patch, we need to drop -o2. Which is fine. Here, for reference is the patch: --- Makefile.orig 2025-05-03 14:53:49.000000000 +0100 +++ Makefile 2025-05-03 14:53:30.000000000 +0100 @@ -10,7 +10,7 @@ RESULT = camlpdf -CFLAGS = -o2 +CFLAGS = -o2 -g OCAMLFLAGS = -bin-annot OCAMLNCFLAGS = -g -safe-string OCAMLBCFLAGS = -g -safe-string --- OCamlMakefile.orig 2025-05-03 16:07:01.000000000 +0100 +++ OCamlMakefile 2025-05-03 16:06:47.000000000 +0100 @@ -614,7 +614,7 @@ ifneq ($(strip $(OBJ_LINK)),) ifdef CREATE_LIB - OBJS_LIBS := -cclib -l$(CLIB_BASE) $(CLIBS_OPTS) $(MAYBE_IDL) + OBJS_LIBS := -ccopt "$(CFLAGS)" -cclib -l$(CLIB_BASE) $(CLIBS_OPTS) $(MAYBE_IDL) else OBJS_LIBS := $(OBJ_LINK) $(CLIBS_OPTS) $(MAYBE_IDL) endif
For clarity, I have prepared two srpm/spec/patch/build-log archives: 1. With the minimal patch, just to Makefile: https://www.coherentpdf.com/fedora/ocaml-camlpdf-minpatch.zip 2. With both that and the patch to OCamlMakefile: https://www.coherentpdf.com/fedora/ocaml-camlpdf-maxpatch.zip In both cases the Koji build works, and there are no debug extraction errors in the build log.