mozilla/release-services

staticanalysis/bot: gecko-env fails to build correctly 'export' from sa-unified

Closed this issue · 1 comments

Trying to build firefox using our gecko-env I've noticed that the build was failing with the following message:

 0:03.90 /nix/store/rncr3ac1qqqbcgk65d0zghc7f9bf415l-clang-wrapper-7.0.0/bin/clang++ -o Unified_cpp_dom_animation0.o -c  -I/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include /app/tmp/sa-unified/config/gcc_hidden.h -DDEBUG=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/app/tmp/sa-unified/dom/animation -I/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dom/animation -I/app/tmp/sa-unified/dom/base -I/app/tmp/sa-unified/layout/base -I/app/tmp/sa-unified/layout/style -I/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include -I/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/mozilla-config.h -Qunused-arguments -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++1z-compat -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-sized-deallocation -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -Os -fno-omit-frame-pointer -funwind-tables -Werror  -MD -MP -MF .deps/Unified_cpp_dom_animation0.o.pp  -fcolor-diagnostics  /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dom/animation/Unified_cpp_dom_animation0.cpp
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dom/animation/Unified_cpp_dom_animation0.cpp:2:
 0:04.03 In file included from /app/tmp/sa-unified/dom/animation/Animation.cpp:7:
 0:04.03 In file included from /app/tmp/sa-unified/dom/animation/Animation.h:10:
 0:04.03 In file included from /app/tmp/sa-unified/dom/base/nsWrapperCache.h:10:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/nsCycleCollectionParticipant.h:12:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/nsCycleCollectionNoteChild.h:14:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/nsCycleCollectionTraversalCallback.h:10:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/jspubtd.h:14:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/jstypes.h:25:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Casting.h:12:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:23:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/nsTraceRefcnt.h:10:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/nscore.h:20:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/mozilla/mozalloc.h:16:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/stl_wrappers/new:44:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/system_wrappers/new:3:
 0:04.03 In file included from /nix/store/6qmfmricr58bjivgr16y9sjisakdykag-gcc-7.3.0/include/c++/7.3.0/new:40:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/system_wrappers/exception:3:
 0:04.03 In file included from /nix/store/6qmfmricr58bjivgr16y9sjisakdykag-gcc-7.3.0/include/c++/7.3.0/exception:143:
 0:04.03 In file included from /nix/store/6qmfmricr58bjivgr16y9sjisakdykag-gcc-7.3.0/include/c++/7.3.0/bits/nested_exception.h:40:
 0:04.03 In file included from /nix/store/6qmfmricr58bjivgr16y9sjisakdykag-gcc-7.3.0/include/c++/7.3.0/bits/move.h:54:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/stl_wrappers/type_traits:64:
 0:04.03 In file included from /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/include/mozilla/throw_gcc.h:14:
 0:04.03 /app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dist/system_wrappers/string.h:3:15: fatal error: 'String.h' file not found
 0:04.03 #include_next <String.h>
 0:04.03               ^~~~~~~~~~
 0:04.07 1 error generated.
 0:04.08 make[1]: *** [/app/tmp/sa-unified/config/rules.mk:1108: Unified_cpp_dom_animation0.o] Error 1
 0:04.08 make[1]: Leaving directory '/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dom/animation'
 0:04.08 make: *** [/app/tmp/sa-unified/config/rules.mk:415: default] Error 2
 0:04.08 make: Leaving directory '/app/tmp/sa-unified/obj-x86_64-pc-linux-gnu/dom/animation'
 0:04.12 0 compiler warnings present.

dist/system_headers is build here based on this list. As it can be easily seen there are two headers in that list String.h and string.h but in our case in the mentioned directory we only find string.h that is built following the logic of String.h by having the contents:

#pragma GCC system_header
#pragma GCC visibility push(default)
#include_next <Strings.h>
#pragma GCC visibility pop

whereas the include is taken from the filename itself.

My guess is that somehow we overwrite, string.h, when building String.h and the contents of the String.h are overwritten over string.h. This is very strange since this issue does not happen outside of nix.

As a note here, this is all done during the build export phase so we might have later issues when we invoke clang-tidy and these issues might translate to missing on potential defects.

This can be closed now since we've migrated to clang and llvm 7.