Closed Bug 1242132 Opened 4 years ago Closed 4 years ago

fatal error: 'nss.h' file not found with --with-system-nss

Categories

(Firefox Build System :: General, defect)

45 Branch
defect
Not set

Tracking

(firefox45 wontfix, firefox46 wontfix, firefox47 fixed, firefox-esr45 fixed)

RESOLVED FIXED
mozilla47
Tracking Status
firefox45 --- wontfix
firefox46 --- wontfix
firefox47 --- fixed
firefox-esr45 --- fixed

People

(Reporter: hectorz, Assigned: jbeich)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

It's similar to 1228463, but for NSS. build/autoconf/nss.m4 is already using AC_SUBST_LIST for NSS_CFLAGS, so I've no idea how to fix this one.

 1:50.38 /Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp:13:10: fatal error: 'nss.h' file not found
 1:50.38 #include "nss.h"
 1:50.38          ^
 1:50.53 1 error generated.
 1:50.53 
 1:50.53 In the directory  /Users/hectorz/Repos/gecko-dev/obj-x86_64-apple-darwin15.2.0/media/webrtc/signalingtest/signaling_ecc
 1:50.53 The following command failed to execute properly:
 1:50.54 /usr/bin/clang++ -o JsepSessionImpl.o -c -fvisibility=hidden -fvisibility-inlines-hidden -DCHROMIUM_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DENABLE_GPU=1 -DENABLE_EGLIMAGE=1 -DUSE_SKIA=1 -DENABLE_TASK_MANAGER=1 -DENABLE_WEB_INTENTS=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PROTECTOR_SERVICE=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_BACKGROUND=1 -DENABLE_AUTOMATION=1 -DENABLE_PRINTING=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DLOG4CXX_STATIC -D_NO_LOG4CXX -DUSE_SSLEAY -D_CPR_USE_EXTERNAL_LOGGER -DWEBRTC_RELATIVE_PATH -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_UINT8_T=1 -DHAVE_UINT16_T=1 -DHAVE_UINT32_T=1 -DHAVE_UINT64_T=1 -DNO_CHROMIUM_LOGGING -DUSE_FAKE_MEDIA_STREAMS -DUSE_FAKE_PCOBSERVER -DMOZILLA_EXTERNAL_LINKAGE -DWEBRTC_POSIX -DOS_MACOSX -DSIP_OS_OSX -DOSX -D_FORTIFY_SOURCE=2 -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling -I. -I/Users/hectorz/Repos/gecko-dev/media/webrtc -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/common -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/common/browser_logging -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/common/time_profiling -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/media -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/media-conduit -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/mediapipeline -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/peerconnection -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/sdp/sipcc -I/Users/hectorz/Repos/gecko-dev/dom/base -I/Users/hectorz/Repos/gecko-dev/dom/media -I/Users/hectorz/Repos/gecko-dev/media/mtransport -I/Users/hectorz/Repos/gecko-dev/media/webrtc/trunk -I/Users/hectorz/Repos/gecko-dev/media/libyuv/include -I/Users/hectorz/Repos/gecko-dev/media/mtransport/third_party/nrappkit/src/util/libekr -I/Users/hectorz/Repos/gecko-dev/netwerk/srtp/src/include -I/Users/hectorz/Repos/gecko-dev/netwerk/srtp/src/crypto/include -I/Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/test -I../../../../ipc/ipdl/_ipdlheaders -I/Users/hectorz/Repos/gecko-dev/ipc/chromium/src -I/Users/hectorz/Repos/gecko-dev/ipc/glue -I../../../../dist/include -fPIC -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -MD -MP -MF .deps/JsepSessionImpl.o.pp -Qunused-arguments -Qunused-arguments -Wno-unused-local-typedef -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-unused-local-typedef -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -DNO_X11 -pipe -DNDEBUG -DTRIMMED -g -O3 -fomit-frame-pointer -I/usr/local/opt/nspr/include/nspr -I/usr/local/Cellar/nspr/4.11/include/nspr -I/usr/local/Cellar/nss/3.21/include/nss -I/usr/local/Cellar/pixman/0.32.8/include/pixman-1 /Users/hectorz/Repos/gecko-dev/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
 1:50.54 make[5]: *** [JsepSessionImpl.o] Error 1
 1:50.54 make[5]: *** Waiting for unfinished jobs....
 1:52.92 make[4]: *** [media/webrtc/signalingtest/signaling_ecc/target] Error 2
 1:52.92 make[3]: *** [compile] Error 2
 1:52.92 make[2]: *** [default] Error 2
 1:52.92 make[1]: *** [realbuild] Error 2
 1:52.92 make: *** [build] Error 2
 1:52.95 257 compiler warnings present.

Note this command will actually succeed. Not sure why the single quote is not present in this build/unix/print-failed-commands.sh output. The single quotes can be seen in this diff of obj-x86_64-apple-darwin15.2.0/media/webrtc/signaling/signaling_ecc/backend.mk:

gecko-dev » diff ~/Downloads/backend-{good,bad}.mk -u
--- /Users/hectorz/Downloads/backend-good.mk	2016-01-23 09:41:20.000000000 +0800
+++ /Users/hectorz/Downloads/backend-bad.mk	2016-01-23 09:34:53.000000000 +0800
@@ -61,10 +61,10 @@
 DISABLE_STL_WRAPPING := 1
 IS_GYP_DIR := 1
 MOZBUILD_CFLAGS += -I/usr/local/opt/nspr/include/nspr
-MOZBUILD_CFLAGS += -I/usr/local/Cellar/nspr/4.11/include/nspr -I/usr/local/Cellar/nss/3.21/include/nss
+MOZBUILD_CFLAGS += '-I/usr/local/Cellar/nspr/4.11/include/nspr -I/usr/local/Cellar/nss/3.21/include/nss'
 MOZBUILD_CFLAGS += -I/usr/local/Cellar/pixman/0.32.8/include/pixman-1
 MOZBUILD_CXXFLAGS += -I/usr/local/opt/nspr/include/nspr
-MOZBUILD_CXXFLAGS += -I/usr/local/Cellar/nspr/4.11/include/nspr -I/usr/local/Cellar/nss/3.21/include/nss
+MOZBUILD_CXXFLAGS += '-I/usr/local/Cellar/nspr/4.11/include/nspr -I/usr/local/Cellar/nss/3.21/include/nss'
 MOZBUILD_CXXFLAGS += -I/usr/local/Cellar/pixman/0.32.8/include/pixman-1
 LIBRARY_NAME := ecc
 FORCE_STATIC_LIB := 1
Attached patch .split(' ') hack (obsolete) — Splinter Review
Happens on FreeBSD as well due to multiple space-separated -I in NSS_CFLAGS since https://hg.mozilla.org/releases/mozilla-beta/rev/eb94204b1c96 where expand_variables() calls .join(' ') which have to be quoted.

  c++ -o JsepSessionImpl.o -c ... -I/usr/local/include/nspr '-I/usr/local/include/nss -I/usr/local/include/nss/nss' ... media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
  In file included from media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp:14:
  obj/dist/system_wrappers/pk11pub.h:3:15: fatal error:
	'pk11pub.h' file not found
  #include_next <pk11pub.h>
		^
  1 error generated.

  $ fgrep NSS_CFLAGS obj/config/autoconf.mk
  NSS_CFLAGS = -I/usr/local/include/nss -I/usr/local/include/nss/nss

  $ diff backend.mk.{before,after}
  --- obj/media/webrtc/signaling/signaling_ecc/backend.mk.before
  +++ obj/media/webrtc/signaling/signaling_ecc/backend.mk.after
  @@ -61,12 +61,10 @@ LOCAL_INCLUDES += -I$(topsrcdir)/ipc/glu
   DISABLE_STL_WRAPPING := 1
   IS_GYP_DIR := 1
   MOZBUILD_CFLAGS += -I/usr/local/include/nspr
  -MOZBUILD_CFLAGS += -I/usr/local/include/nss
  -MOZBUILD_CFLAGS += -I/usr/local/include/nss/nss
  +MOZBUILD_CFLAGS += '-I/usr/local/include/nss -I/usr/local/include/nss/nss'
   MOZBUILD_CFLAGS += -I/usr/local/include/pixman-1
   MOZBUILD_CXXFLAGS += -I/usr/local/include/nspr
  -MOZBUILD_CXXFLAGS += -I/usr/local/include/nss
  -MOZBUILD_CXXFLAGS += -I/usr/local/include/nss/nss
  +MOZBUILD_CXXFLAGS += '-I/usr/local/include/nss -I/usr/local/include/nss/nss'
   MOZBUILD_CXXFLAGS += -I/usr/local/include/pixman-1
   LIBRARY_NAME := ecc
   FORCE_STATIC_LIB := 1
Attachment #8721805 - Flags: feedback?(mh+mozilla)
Comment on attachment 8721805 [details] [diff] [review]
.split(' ') hack

Review of attachment 8721805 [details] [diff] [review]:
-----------------------------------------------------------------

::: python/mozbuild/mozbuild/frontend/gyp_reader.py
@@ +216,5 @@
>                      for f in flags:
>                          # We may be getting make variable references out of the
>                          # gyp data, and we don't want those in emitted data, so
>                          # substitute them with their actual value.
> +                        f = expand_variables(f, config.substs).split(' ')

make it split()
Attachment #8721805 - Flags: feedback?(mh+mozilla) → feedback+
Hector, can you check the patch is enough to fix your build as well?

(In reply to Mike Hommey [:glandium] from comment #2)
> > +                        f = expand_variables(f, config.substs).split(' ')
> 
> make it split()

If that was all feedback then let's check Try and land.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=068e60c5083f
Attachment #8721805 - Attachment is obsolete: true
Attachment #8723076 - Flags: review?(mh+mozilla)
Attachment #8723076 - Flags: feedback?
Attachment #8723076 - Flags: feedback? → feedback?(bzhao)
Comment on attachment 8723076 [details] [diff] [review]
.split() hack, v2

(In reply to Jan Beich from comment #3)
> 
> Hector, can you check the patch is enough to fix your build as well?

Yes, thanks.
Attachment #8723076 - Flags: feedback?(bzhao) → feedback+
Attachment #8723076 - Flags: review?(mh+mozilla) → review+
Assignee: nobody → jbeich
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5e0cf0c0f8c3
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment on attachment 8723076 [details] [diff] [review]
.split() hack, v2

[Approval Request Comment]
ESR consideration: Easier debugging downstream
User impact if declined: Broken build with --with-system-nss
Fix Landed on Version: Firefox 47
Risk to taking this patch (and alternatives if risky): Low
String or UUID changes made by this patch: None
Attachment #8723076 - Flags: approval-mozilla-esr45?
Comment on attachment 8723076 [details] [diff] [review]
.split() hack, v2

Will help your work of porting, taking it to esr45.
Attachment #8723076 - Flags: approval-mozilla-esr45? → approval-mozilla-esr45+
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.