[all archs] devel/spidermonkey68 can be built without rust and llvm

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[all archs] devel/spidermonkey68 can be built without rust and llvm

Charlene Wendling
Hi,

I was trying to build a port depending on spidermonkey68 on my macppc
machine and found out it "requires" rust. After seeing how other
downstreams deal with it, i've found out that Debian actually does not
use rust for spidermonkey. For all archs [0].

What i'm proposing here is a proof of concept that allows building
spidermonkey68 on !rust archs, like macppc [1], but i think really we
should drop rust and llvm for all archs.

Comments/feedback are welcome,

Charlène.

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
[1] https://bin.charlenew.xyz/spidermonkey_norust.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/spidermonkey68/Makefile,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 Makefile
--- Makefile 24 Jun 2020 08:57:02 -0000 1.4
+++ Makefile 24 Jun 2020 22:18:37 -0000
@@ -54,9 +54,7 @@ LIB_DEPENDS = devel/nspr \
 DEBUG_PACKAGES = ${BUILD_PACKAGES}
 
 AUTOCONF_VERSION= 2.13
-BUILD_DEPENDS += devel/autoconf/${AUTOCONF_VERSION} \
- devel/llvm \
- lang/rust
+BUILD_DEPENDS += devel/autoconf/${AUTOCONF_VERSION}
 
 SEPARATE_BUILD = Yes
 WRKDIST = ${WRKDIR}/firefox-${V}
@@ -77,9 +75,7 @@ CONFIGURE_ARGS = --disable-debug \
  --with-system-zlib \
  --with-system-icu \
  --with-system-nspr \
- --enable-unaligned-private-values \
- --with-libclang-path=${LOCALBASE}/lib \
- --with-clang-path=${LOCALBASE}/bin/clang
+ --enable-unaligned-private-values
 
 # Build failure on mips64(,el}. Related bug on Debian:
 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908486
@@ -99,6 +95,16 @@ MAKE_ENV = SHELL=/bin/sh \
  SO_VERSION=${SO_VERSION}
 
 NO_TEST = Yes
+
+.include <bsd.port.arch.mk>
+.if ${PROPERTIES:Mrust}
+BUILD_DEPENDS += devel/llvm \
+ lang/rust
+CONFIGURE_ARGS += --with-libclang-path=${LOCALBASE}/lib \
+ --with-clang-path=${LOCALBASE}/bin/clang
+.else
+PATCH_LIST += patch-* patch_norust-*
+.endif
 
 pre-configure:
  cd ${WRKSRC} && env -i AUTOCONF_VERSION=${AUTOCONF_VERSION} autoconf
Index: patches/patch_norust-js_moz_configure
===================================================================
RCS file: patches/patch_norust-js_moz_configure
diff -N patches/patch_norust-js_moz_configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch_norust-js_moz_configure 24 Jun 2020 22:18:37 -0000
@@ -0,0 +1,31 @@
+$OpenBSD$
+
+Remove unused LLVM and Rust build dependencies. Since the Javascript engine is
+normally part of Firefox, its build system has dependencies on the LLVM and
+Rust toolchains. This limits  the number of architectures which mozjs68 can be
+built on. It turns out, however, that neither LLVM nor Rust are used when
+mozjs68 is being built and these build dependencies are therefore not
+necessary.
+
+This patch removes them and allows mozjs68 to be built on any
+architecture.
+
+Author: John Paul Adrian Glaubitz <[hidden email]>
+
+From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
+
+Index: js/moz.configure
+--- js/moz.configure.orig
++++ js/moz.configure
+@@ -18,11 +18,6 @@ def building_js(build_project):
+ option(env='JS_STANDALONE', default=building_js,
+        help='Reserved for internal use')
+
+-include('../build/moz.configure/rust.configure',
+-        when='--enable-compile-environment')
+-include('../build/moz.configure/bindgen.configure',
+-        when='--enable-compile-environment')
+-
+ @depends('JS_STANDALONE')
+ def js_standalone(value):
+     if value:
Index: patches/patch_norust-moz_configure
===================================================================
RCS file: patches/patch_norust-moz_configure
diff -N patches/patch_norust-moz_configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch_norust-moz_configure 24 Jun 2020 22:18:37 -0000
@@ -0,0 +1,56 @@
+$OpenBSD$
+
+Remove unused LLVM and Rust build dependencies. Since the Javascript engine is
+normally part of Firefox, its build system has dependencies on the LLVM and
+Rust toolchains. This limits  the number of architectures which mozjs68 can be
+built on. It turns out, however, that neither LLVM nor Rust are used when
+mozjs68 is being built and these build dependencies are therefore not
+necessary.
+
+This patch removes them and allows mozjs68 to be built on any
+architecture.
+
+Author: John Paul Adrian Glaubitz <[hidden email]>
+
+From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
+
+Index: moz.configure
+--- moz.configure.orig
++++ moz.configure
+@@ -598,36 +598,6 @@ set_config('MAKENSISU_FLAGS', nsis_flags)
+
+ check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
+
+-
+-@depends(host_c_compiler, c_compiler, bindgen_config_paths)
+-def llvm_objdump(host_c_compiler, c_compiler, bindgen_config_paths):
+-    clang = None
+-    for compiler in (host_c_compiler, c_compiler):
+-        if compiler and compiler.type == 'clang':
+-            clang = compiler.compiler
+-            break
+-        elif compiler and compiler.type == 'clang-cl':
+-            clang = os.path.join(os.path.dirname(compiler.compiler), 'clang')
+-            break
+-
+-    if not clang and bindgen_config_paths:
+-        clang = bindgen_config_paths.clang_path
+-    llvm_objdump = 'llvm-objdump'
+-    if clang:
+-        out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
+-                               onerror=lambda: None)
+-        if out:
+-            llvm_objdump = out.rstrip()
+-    return (llvm_objdump,)
+-
+-
+-llvm_objdump = check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
+-                          when='--enable-compile-environment',
+-                          paths=toolchain_search_path)
+-
+-add_old_configure_assignment('LLVM_OBJDUMP', llvm_objdump)
+-
+-
+ # Please do not add configure checks from here on.
+
+ # Fallthrough to autoconf-based configure

Reply | Threaded
Open this post in threaded view
|

Re: [all archs] devel/spidermonkey68 can be built without rust and llvm

Jasper Lievisse Adriaanse-7

> On 25 Jun 2020, at 00:28, Charlene Wendling <[hidden email]> wrote:
>
> Hi,
>
> I was trying to build a port depending on spidermonkey68 on my macppc
> machine and found out it "requires" rust. After seeing how other
> downstreams deal with it, i've found out that Debian actually does not
> use rust for spidermonkey. For all archs [0].
>
> What i'm proposing here is a proof of concept that allows building
> spidermonkey68 on !rust archs, like macppc [1], but i think really we
> should drop rust and llvm for all archs.
>
> Comments/feedback are welcome,
>
> Charlène.
>
> [0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
> [1] https://bin.charlenew.xyz/spidermonkey_norust.log

Hi,

Since it doesn’t change anything (as in, nothing ends up using it) I see no point in keeping
the dependencies around for a subset of architectures. The cost of maintaining these patches
is already there anyway. Go ahead and just drop these dependencies on all architectures.

Cheers,
Jasper

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/spidermonkey68/Makefile,v
> retrieving revision 1.4
> diff -u -p -u -p -r1.4 Makefile
> --- Makefile 24 Jun 2020 08:57:02 -0000 1.4
> +++ Makefile 24 Jun 2020 22:18:37 -0000
> @@ -54,9 +54,7 @@ LIB_DEPENDS = devel/nspr \
> DEBUG_PACKAGES = ${BUILD_PACKAGES}
>
> AUTOCONF_VERSION= 2.13
> -BUILD_DEPENDS += devel/autoconf/${AUTOCONF_VERSION} \
> - devel/llvm \
> - lang/rust
> +BUILD_DEPENDS += devel/autoconf/${AUTOCONF_VERSION}
>
> SEPARATE_BUILD = Yes
> WRKDIST = ${WRKDIR}/firefox-${V}
> @@ -77,9 +75,7 @@ CONFIGURE_ARGS = --disable-debug \
> --with-system-zlib \
> --with-system-icu \
> --with-system-nspr \
> - --enable-unaligned-private-values \
> - --with-libclang-path=${LOCALBASE}/lib \
> - --with-clang-path=${LOCALBASE}/bin/clang
> + --enable-unaligned-private-values
>
> # Build failure on mips64(,el}. Related bug on Debian:
> # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908486
> @@ -99,6 +95,16 @@ MAKE_ENV = SHELL=/bin/sh \
> SO_VERSION=${SO_VERSION}
>
> NO_TEST = Yes
> +
> +.include <bsd.port.arch.mk>
> +.if ${PROPERTIES:Mrust}
> +BUILD_DEPENDS += devel/llvm \
> + lang/rust
> +CONFIGURE_ARGS += --with-libclang-path=${LOCALBASE}/lib \
> + --with-clang-path=${LOCALBASE}/bin/clang
> +.else
> +PATCH_LIST += patch-* patch_norust-*
> +.endif
>
> pre-configure:
> cd ${WRKSRC} && env -i AUTOCONF_VERSION=${AUTOCONF_VERSION} autoconf
> Index: patches/patch_norust-js_moz_configure
> ===================================================================
> RCS file: patches/patch_norust-js_moz_configure
> diff -N patches/patch_norust-js_moz_configure
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch_norust-js_moz_configure 24 Jun 2020 22:18:37 -0000
> @@ -0,0 +1,31 @@
> +$OpenBSD$
> +
> +Remove unused LLVM and Rust build dependencies. Since the Javascript engine is
> +normally part of Firefox, its build system has dependencies on the LLVM and
> +Rust toolchains. This limits  the number of architectures which mozjs68 can be
> +built on. It turns out, however, that neither LLVM nor Rust are used when
> +mozjs68 is being built and these build dependencies are therefore not
> +necessary.
> +
> +This patch removes them and allows mozjs68 to be built on any
> +architecture.
> +
> +Author: John Paul Adrian Glaubitz <[hidden email]>
> +
> +From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
> +
> +Index: js/moz.configure
> +--- js/moz.configure.orig
> ++++ js/moz.configure
> +@@ -18,11 +18,6 @@ def building_js(build_project):
> + option(env='JS_STANDALONE', default=building_js,
> +        help='Reserved for internal use')
> +
> +-include('../build/moz.configure/rust.configure',
> +-        when='--enable-compile-environment')
> +-include('../build/moz.configure/bindgen.configure',
> +-        when='--enable-compile-environment')
> +-
> + @depends('JS_STANDALONE')
> + def js_standalone(value):
> +     if value:
> Index: patches/patch_norust-moz_configure
> ===================================================================
> RCS file: patches/patch_norust-moz_configure
> diff -N patches/patch_norust-moz_configure
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch_norust-moz_configure 24 Jun 2020 22:18:37 -0000
> @@ -0,0 +1,56 @@
> +$OpenBSD$
> +
> +Remove unused LLVM and Rust build dependencies. Since the Javascript engine is
> +normally part of Firefox, its build system has dependencies on the LLVM and
> +Rust toolchains. This limits  the number of architectures which mozjs68 can be
> +built on. It turns out, however, that neither LLVM nor Rust are used when
> +mozjs68 is being built and these build dependencies are therefore not
> +necessary.
> +
> +This patch removes them and allows mozjs68 to be built on any
> +architecture.
> +
> +Author: John Paul Adrian Glaubitz <[hidden email]>
> +
> +From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
> +
> +Index: moz.configure
> +--- moz.configure.orig
> ++++ moz.configure
> +@@ -598,36 +598,6 @@ set_config('MAKENSISU_FLAGS', nsis_flags)
> +
> + check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
> +
> +-
> +-@depends(host_c_compiler, c_compiler, bindgen_config_paths)
> +-def llvm_objdump(host_c_compiler, c_compiler, bindgen_config_paths):
> +-    clang = None
> +-    for compiler in (host_c_compiler, c_compiler):
> +-        if compiler and compiler.type == 'clang':
> +-            clang = compiler.compiler
> +-            break
> +-        elif compiler and compiler.type == 'clang-cl':
> +-            clang = os.path.join(os.path.dirname(compiler.compiler), 'clang')
> +-            break
> +-
> +-    if not clang and bindgen_config_paths:
> +-        clang = bindgen_config_paths.clang_path
> +-    llvm_objdump = 'llvm-objdump'
> +-    if clang:
> +-        out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
> +-                               onerror=lambda: None)
> +-        if out:
> +-            llvm_objdump = out.rstrip()
> +-    return (llvm_objdump,)
> +-
> +-
> +-llvm_objdump = check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
> +-                          when='--enable-compile-environment',
> +-                          paths=toolchain_search_path)
> +-
> +-add_old_configure_assignment('LLVM_OBJDUMP', llvm_objdump)
> +-
> +-
> + # Please do not add configure checks from here on.
> +
> + # Fallthrough to autoconf-based configure

Reply | Threaded
Open this post in threaded view
|

Re: [all archs] devel/spidermonkey68 can be built without rust and llvm

Charlene Wendling
On Thu, 25 Jun 2020 08:38:44 +0200
Jasper Lievisse Adriaanse wrote:

>
> > On 25 Jun 2020, at 00:28, Charlene Wendling <[hidden email]>
> > wrote:
> >
> > Hi,
> >
> > I was trying to build a port depending on spidermonkey68 on my
> > macppc machine and found out it "requires" rust. After seeing how
> > other downstreams deal with it, i've found out that Debian actually
> > does not use rust for spidermonkey. For all archs [0].
> >
> > What i'm proposing here is a proof of concept that allows building
> > spidermonkey68 on !rust archs, like macppc [1], but i think really
> > we should drop rust and llvm for all archs.
> >
> > Comments/feedback are welcome,
> >
> > Charlène.
> >
> > [0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
> > [1] https://bin.charlenew.xyz/spidermonkey_norust.log
>
> Hi,
>
> Since it doesn’t change anything (as in, nothing ends up using it) I
> see no point in keeping the dependencies around for a subset of
> architectures. The cost of maintaining these patches is already there
> anyway. Go ahead and just drop these dependencies on all
> architectures.
>
> Cheers,
> Jasper

Here it is, i added a safety REVISION bump as well but i don't think
it's needed.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/spidermonkey68/Makefile,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 Makefile
--- Makefile 24 Jun 2020 08:57:02 -0000 1.4
+++ Makefile 25 Jun 2020 09:05:38 -0000
@@ -20,7 +20,7 @@ V = ${MOZILLA_VERSION}.9.0
 DISTNAME = firefox-${V}esr.source
 EXTRACT_SUFX = .tar.bz2
 PKGNAME = spidermonkey${MOZILLA_VERSION}-${V}
-REVISION = 0
+REVISION = 1
 
 SHARED_LIBS = mozjs-68 0.0
 
@@ -54,9 +54,7 @@ LIB_DEPENDS = devel/nspr \
 DEBUG_PACKAGES = ${BUILD_PACKAGES}
 
 AUTOCONF_VERSION= 2.13
-BUILD_DEPENDS += devel/autoconf/${AUTOCONF_VERSION} \
- devel/llvm \
- lang/rust
+BUILD_DEPENDS += devel/autoconf/${AUTOCONF_VERSION}
 
 SEPARATE_BUILD = Yes
 WRKDIST = ${WRKDIR}/firefox-${V}
@@ -77,9 +75,7 @@ CONFIGURE_ARGS = --disable-debug \
  --with-system-zlib \
  --with-system-icu \
  --with-system-nspr \
- --enable-unaligned-private-values \
- --with-libclang-path=${LOCALBASE}/lib \
- --with-clang-path=${LOCALBASE}/bin/clang
+ --enable-unaligned-private-values
 
 # Build failure on mips64(,el}. Related bug on Debian:
 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908486
Index: patches/patch-js_moz_configure
===================================================================
RCS file: patches/patch-js_moz_configure
diff -N patches/patch-js_moz_configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-js_moz_configure 25 Jun 2020 09:05:38 -0000
@@ -0,0 +1,31 @@
+$OpenBSD$
+
+Remove unused LLVM and Rust build dependencies. Since the Javascript engine is
+normally part of Firefox, its build system has dependencies on the LLVM and
+Rust toolchains. This limits the number of architectures which mozjs68 can be
+built on. It turns out, however, that neither LLVM nor Rust are used when
+mozjs68 is being built and these build dependencies are therefore not
+necessary.
+
+This patch removes them and allows mozjs68 to be built on any
+architecture.
+
+Author: John Paul Adrian Glaubitz <[hidden email]>
+
+From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
+
+Index: js/moz.configure
+--- js/moz.configure.orig
++++ js/moz.configure
+@@ -18,11 +18,6 @@ def building_js(build_project):
+ option(env='JS_STANDALONE', default=building_js,
+        help='Reserved for internal use')
+
+-include('../build/moz.configure/rust.configure',
+-        when='--enable-compile-environment')
+-include('../build/moz.configure/bindgen.configure',
+-        when='--enable-compile-environment')
+-
+ @depends('JS_STANDALONE')
+ def js_standalone(value):
+     if value:
Index: patches/patch-moz_configure
===================================================================
RCS file: /cvs/ports/devel/spidermonkey68/patches/patch-moz_configure,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 patch-moz_configure
--- patches/patch-moz_configure 14 May 2020 14:54:11 -0000 1.1.1.1
+++ patches/patch-moz_configure 25 Jun 2020 09:05:38 -0000
@@ -1,5 +1,9 @@
 $OpenBSD: patch-moz_configure,v 1.1.1.1 2020/05/14 14:54:11 jasper Exp $
 
+- Fix awk detection
+- Remove unused LLVM and Rust build dependencies, from:
+  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959144
+
 Index: moz.configure
 --- moz.configure.orig
 +++ moz.configure
@@ -12,3 +16,40 @@ Index: moz.configure
 
  # Until the AWK variable is not necessary in old-configure
  @depends(awk)
+@@ -598,36 +598,6 @@ set_config('MAKENSISU_FLAGS', nsis_flags)
+
+ check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
+
+-
+-@depends(host_c_compiler, c_compiler, bindgen_config_paths)
+-def llvm_objdump(host_c_compiler, c_compiler, bindgen_config_paths):
+-    clang = None
+-    for compiler in (host_c_compiler, c_compiler):
+-        if compiler and compiler.type == 'clang':
+-            clang = compiler.compiler
+-            break
+-        elif compiler and compiler.type == 'clang-cl':
+-            clang = os.path.join(os.path.dirname(compiler.compiler), 'clang')
+-            break
+-
+-    if not clang and bindgen_config_paths:
+-        clang = bindgen_config_paths.clang_path
+-    llvm_objdump = 'llvm-objdump'
+-    if clang:
+-        out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
+-                               onerror=lambda: None)
+-        if out:
+-            llvm_objdump = out.rstrip()
+-    return (llvm_objdump,)
+-
+-
+-llvm_objdump = check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
+-                          when='--enable-compile-environment',
+-                          paths=toolchain_search_path)
+-
+-add_old_configure_assignment('LLVM_OBJDUMP', llvm_objdump)
+-
+-
+ # Please do not add configure checks from here on.
+
+ # Fallthrough to autoconf-based configure