Bug 250161 - lang/spidermonkey78: build fails
Summary: lang/spidermonkey78: build fails
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: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-06 17:17 UTC by Philipp Engel
Modified: 2020-11-21 18:25 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (swills)


Attachments
my log (426.97 KB, text/plain)
2020-10-06 17:31 UTC, Steve Wills
no flags Details
spidermonkey78-78.2.0-2.log (389.32 KB, text/plain)
2020-10-06 17:38 UTC, Philipp Engel
no flags Details
my log for 78.2.0 (422.14 KB, text/plain)
2020-10-06 17:41 UTC, Steve Wills
no flags Details
patch to spidermonkey (610 bytes, patch)
2020-10-06 17:54 UTC, Steve Wills
no flags Details | Diff
updated patch (1.81 KB, patch)
2020-10-06 19:30 UTC, Steve Wills
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Engel 2020-10-06 17:17:00 UTC
Building lang/spidermonkey78 78.3.1 on FreeBSD 12.1-RELEASE-p10 with Poudriere fails:

error: failed to run custom build command for `mozglue-static v0.1.0 (/tmp/ports/usr/ports/lang/spidermonkey78/work/firefox-78.2.0/mozglue/static/rust)`

Caused by:
  process didn't exit successfully: `/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/release/build/mozglue-static-386a6e7be02144d2/build-script-build` (exit code: 1)
  --- stdout
  TARGET = Some("x86_64-unknown-freebsd")
  OPT_LEVEL = Some("2")
  HOST = Some("x86_64-unknown-freebsd")
  CXX_x86_64-unknown-freebsd = None
  CXX_x86_64_unknown_freebsd = Some(" /usr/local/bin/clang++80 -std=gnu++17")
  CXXFLAGS_x86_64-unknown-freebsd = None
  CXXFLAGS_x86_64_unknown_freebsd = Some("-I/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/dist/system_wrappers -include /tmp/ports/usr/ports/lang/spidermonkey78/work/firefox-78.2.0/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DEXPORT_JS_API -DMOZ_HAS_MOZGLUE -I/tmp/ports/usr/ports/lang/spidermonkey78/work/firefox-78.2.0/js/src/rust -I/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/js/src/rust -I/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/dist/include -I/usr/local/include/nspr -I/usr/local/include -fPIC -DMOZILLA_CLIENT -include /tmp/ports/usr/ports/lang/spidermonkey78/work/.build/js/src/js-confdefs.h -Qunused-arguments -I/usr/local/include -isystem /usr/local/include -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 -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-noexcept-type -Wno-unknown-warning-option -fno-sized-deallocation -fno-aligned-new -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -O -fomit-frame-pointer -funwind-tables -DMOZILLA_CONFIG_H")
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  running: "/usr/local/bin/clang++80" "-std=gnu++17" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-unknown-freebsd" "-I/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/dist/system_wrappers" "-include" "/tmp/ports/usr/ports/lang/spidermonkey78/work/firefox-78.2.0/config/gcc_hidden.h" "-U_FORTIFY_SOURCE" "-D_FORTIFY_SOURCE=2" "-fstack-protector-strong" "-DNDEBUG=1" "-DTRIMMED=1" "-DEXPORT_JS_API" "-DMOZ_HAS_MOZGLUE" "-I/tmp/ports/usr/ports/lang/spidermonkey78/work/firefox-78.2.0/js/src/rust" "-I/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/js/src/rust" "-I/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/dist/include" "-I/usr/local/include/nspr" "-I/usr/local/include" "-fPIC" "-DMOZILLA_CLIENT" "-include" "/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/js/src/js-confdefs.h" "-Qunused-arguments" "-I/usr/local/include" "-isystem" "/usr/local/include" "-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" "-Wempty-init-stmt" "-Wfloat-overflow-conversion" "-Wfloat-zero-conversion" "-Wloop-analysis" "-Wc++2a-compat" "-Wcomma" "-Wimplicit-fallthrough" "-Wunused-function" "-Wunused-variable" "-Wstring-conversion" "-Wtautological-overlap-compare" "-Wtautological-unsigned-enum-zero-compare" "-Wtautological-unsigned-zero-compare" "-Wno-error=tautological-type-limit-compare" "-Wno-inline-new-delete" "-Wno-error=deprecated-declarations" "-Wno-error=array-bounds" "-Wno-error=backend-plugin" "-Wno-error=return-std-move" "-Wno-error=atomic-alignment" "-Wformat" "-Wformat-security" "-Wno-gnu-zero-variadic-macro-arguments" "-Wno-noexcept-type" "-Wno-unknown-warning-option" "-fno-sized-deallocation" "-fno-aligned-new" "-O2" "-pipe" "-fstack-protector-strong" "-isystem" "/usr/local/include" "-fno-strict-aliasing" "-isystem" "/usr/local/include" "-fno-rtti" "-ffunction-sections" "-fdata-sections" "-fno-exceptions" "-fno-math-errno" "-pipe" "-O" "-fomit-frame-pointer" "-funwind-tables" "-DMOZILLA_CONFIG_H" "-I" "/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/js/src" "-I" "/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/dist/include" "-DMOZ_HAS_MOZGLUE" "-o" "/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/x86_64-unknown-freebsd/release/build/mozglue-static-38598c650063714d/out/wrappers.o" "-c" "wrappers.cpp"
  cargo:warning=In file included from wrappers.cpp:11:
  cargo:warning=In file included from /tmp/ports/usr/ports/lang/spidermonkey78/work/.build/dist/include/mozilla/Assertions.h:418:
  cargo:warning=/tmp/ports/usr/ports/lang/spidermonkey78/work/.build/dist/system_wrappers/type_traits:3:15: fatal error: 'type_traits' file not found
  cargo:warning=#include_next <type_traits>
  cargo:warning=              ^~~~~~~~~~~~~
  cargo:warning=1 error generated.
  exit code: 1

  --- stderr

[...]

warning: build failed, waiting for other jobs to finish...
Comment 1 Steve Wills freebsd_committer 2020-10-06 17:26:52 UTC
(In reply to Philipp Engel from comment #0)
Not able to reproduce. I'm confused though. Why does your work dir have firefox-78.2.0 if you're building 78.3.1?
Comment 2 Steve Wills freebsd_committer 2020-10-06 17:31:42 UTC
Created attachment 218563 [details]
my log

FWIW, here's my log of the build
Comment 3 Philipp Engel 2020-10-06 17:38:30 UTC
Created attachment 218564 [details]
spidermonkey78-78.2.0-2.log
Comment 4 Philipp Engel 2020-10-06 17:39:50 UTC
(In reply to Steve Wills from comment #1)

> Why does your work dir have firefox-78.2.0 if you're building 78.3.1?

Sorry, my fault, it's actually spidermonkey 78.2.0. I tried running "poudriere pkgclean" and "poudriere distclean" for a clean build, but the issue persists. See attached log.
Comment 5 Steve Wills freebsd_committer 2020-10-06 17:41:35 UTC
Created attachment 218565 [details]
my log for 78.2.0
Comment 6 Steve Wills freebsd_committer 2020-10-06 17:45:03 UTC
Hmm, the first things I notice different between your log and mine is that somehow you are using llvm80 instead of llvm90 and python38. Can you share your make.conf?
Comment 7 Philipp Engel 2020-10-06 17:47:58 UTC
(In reply to Steve Wills from comment #6)

Yes, I'm still using llvm80. My make.conf:

WRKDIRPREFIX=/tmp/ports

DEFAULT_VERSIONS+=ssl=base python=3.8 php=7.3 gcc=10 llvm=80
OPTIONS_SET=ICONV SNDIO
OPTIONS_UNSET=ALSA AVAHI AVX2 BASH CPUFLAGS CPU_OPTS CUPS DBUS DEBUG DOCS EXAMPLES FLAC FONTCONFIG GNOME GSTREAMER HAL JACK JAVA LDAP MANPAGES NLS NOTIFY OPTIMIZED_CFLAGS POLICYKIT PULSEAUDIO PROFILE SNDIO SPEEX TEST TESTS VIDEO_WAYLAND VIM_OPTIONS WAYLAND ZSH OPENCV
Comment 8 Steve Wills freebsd_committer 2020-10-06 17:49:11 UTC
(In reply to Philipp Engel from comment #7)
I think llvm90 is required here. Will post a patch for that.
Comment 9 Steve Wills freebsd_committer 2020-10-06 17:54:34 UTC
Created attachment 218567 [details]
patch to spidermonkey

I think this patch should fix it. Please test.
Comment 10 Philipp Engel 2020-10-06 19:08:58 UTC
(In reply to Steve Wills from comment #9)
Yup, your patch forces llvm90, but I had to set the default version to llvm90 in my make.conf. Otherwise, the port still tries to use llvm80 instead:

===>   spidermonkey78-78.2.0 depends on file: /usr/local/bin/clang80 - not found
===>   Installing existing package /packages/All/llvm80-8.0.1_4.txz
[12-amd64-local-job-01] Installing llvm80-8.0.1_4...
[12-amd64-local-job-01] Extracting llvm80-8.0.1_4: .......... done
===>   spidermonkey78-78.2.0 depends on file: /usr/local/bin/clang80 - found
===>   Returning to build of spidermonkey78-78.2.0     

[...]

checking for rustdoc... /usr/local/bin/rustdoc
checking for rustfmt... /usr/local/bin/rustfmt
checking for clang for bindgen... /usr/local/bin/clang++80
checking for libclang for bindgen... /usr/local/llvm80/lib/libclang.so
checking that libclang is new enough... yes
Comment 11 Steve Wills freebsd_committer 2020-10-06 19:24:35 UTC
(In reply to Philipp Engel from comment #10)
Ah, right, this is because of USES=compiler and your make.conf. I'm not sure compiler.mk offers what we need here yet. I'll look into it more.
Comment 12 Steve Wills freebsd_committer 2020-10-06 19:30:16 UTC
Created attachment 218572 [details]
updated patch

Perhaps this will do the trick
Comment 13 Philipp Engel 2020-10-07 09:58:00 UTC
(In reply to Steve Wills from comment #12)
Can confirm, builds with llvm90 despite default version set to llvm80.
Comment 14 commit-hook freebsd_committer 2020-10-07 13:31:39 UTC
A commit references this bug:

Author: swills
Date: Wed Oct  7 13:30:42 UTC 2020
New revision: 551637
URL: https://svnweb.freebsd.org/changeset/ports/551637

Log:
  lang/spidermonkey78: fix build with local default llvm set to 8.0

  by forcing llvm90

  PR:		250161
  Reported by:	Philipp Engel <kidon@posteo.de>

Changes:
  head/lang/spidermonkey78/Makefile
Comment 15 Steve Wills freebsd_committer 2020-10-07 13:31:50 UTC
Committed, thanks!
Comment 16 Bengt Ahlgren 2020-11-21 18:25:03 UTC
The current solution (r554043) forces llvm90 also on systems with clang 10 in base (11.4 and 12.2).  How about instead doing something along these lines:

.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 90
CPP=		${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT}
CC=		${LOCALBASE}/bin/clang${LLVM_DEFAULT}
CXX=		${LOCALBASE}/bin/clang++${LLVM_DEFAULT}
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
...
.endif

Furthermore, perhaps the following should be moved into the above conditional?

CONFIGURE_ENV+=	LLVM_CONFIG=llvm-config${LLVM_DEFAULT} \
		LLVM_OBJDUMP=llvm-objdump${LLVM_DEFAULT}

(USES=compiler should already set USE_GCC if needed, so is not necessary in the port, if I understand correctly)