Bug 94360

Summary: Build failure in GNOME Continuous
Product: poppler Reporter: Emmanuele Bassi (:ebassi) <ebassi>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: ebassi
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Use correct includes for NSPR/NSS headers

Description Emmanuele Bassi (:ebassi) 2016-03-02 03:47:52 UTC
Poppler fails to build from Git in the GNOME Continuous automated build with this error:

In file included from ../../poppler/SignatureHandler.cc:16:0:
../../poppler/SignatureHandler.h:20:24: fatal error: nspr/prprf.h: No such file or directory
 #include <nspr/prprf.h>
                        ^
compilation terminated.
Makefile:1100: recipe for target 'libpoppler_la-SignatureHandler.lo' failed
make[3]: *** [libpoppler_la-SignatureHandler.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/libpoppler_la-FontEncodingTables.Tpo .deps/libpoppler_la-FontEncodingTables.Plo
In file included from ../../poppler/Form.cc:43:0:
../../poppler/SignatureHandler.h:20:24: fatal error: nspr/prprf.h: No such file or directory
 #include <nspr/prprf.h>
                        ^
compilation terminated.
mv -f .deps/libpoppler_la-BuiltinFont.Tpo .deps/libpoppler_la-BuiltinFont.Plo
Makefile:1233: recipe for target 'libpoppler_la-Form.lo' failed
make[3]: *** [libpoppler_la-Form.lo] Error 1

The include path is wrong. NSS support is detected via pkg-config, which adds:

  -I/usr/include/nss3 -I/usr/include/nspr4

to the inclusion paths. The prprf.h header is located under /usr/include/nspr4. Ideally, you should *not* include prprf.h directly, and instead include <nspr.h> instead, which includes the right headers.
Comment 1 Emmanuele Bassi (:ebassi) 2016-03-02 04:42:25 UTC
Created attachment 122072 [details] [review]
Use correct includes for NSPR/NSS headers

The header files provided by NSS3 are inside versioned directories,
`$includedir/nss3` and `$includedir/nspr4`, which are provided by the
nss3 pkg-config file as include directives for the compiler.

We can also use nspr.h as a single entry point, to avoid cherry picking
specific headers.
Comment 2 Albert Astals Cid 2016-03-02 21:21:43 UTC
Thanks, pushed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.