Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 718616 - <dev-lang/spidermonkey-68 calls ar directly
Summary: <dev-lang/spidermonkey-68 calls ar directly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2020-04-20 12:43 UTC by Agostino Sarubbo
Modified: 2020-08-16 15:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.bz2 (build.log.bz2,54.54 KB, application/x-bzip2)
2020-04-20 12:43 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-04-20 12:43:51 UTC
This is an auto-filled bug because dev-lang/spidermonkey calls ar directly.
The issue was originally discovered on amd64, but it may be reproducible on other arches as well.
Attached build log and emerge --info.

NOTE:
To reproduce this issue you may want to temporarily move the /usr/bin/ar binary.
Comment 1 Agostino Sarubbo gentoo-dev 2020-04-20 12:43:57 UTC
Created attachment 633842 [details]
build.log.bz2

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-04-20 12:51:20 UTC
this is not clear at all but I suppose it is 'ar'
Comment 3 Thomas Deutschmann gentoo-dev Security 2020-04-20 13:48:21 UTC
Can't reproduce with spidermonkey-68.x:

> checking for ar... /usr/bin/x86_64-pc-linux-gnu-ar

I personally will not waste any more time on this old version. I hope we will move to 68.x soon. Patches welcome.
Comment 4 Sergei Trofimovich gentoo-dev 2020-06-03 22:03:42 UTC
At least polkit depends on exact SLOT=60:
    sys-auth/polkit-0.116-r1 (dev-lang/spidermonkey:60[-debug])

Or polkit is expected to be ported or removed by then?
Comment 5 Sergei Trofimovich gentoo-dev 2020-06-28 08:47:21 UTC
The specific error message is:

"""
rm -f libmemory_mozalloc.a libmemory_mozalloc.a.desc
/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/jsobj/_virtualenv/bin/python /tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/config/expandlibs_exec.py --extract -- : crs libmemory_mozalloc.a mozalloc_abort.o Unified_cpp_memory_mozalloc0.o
error: Launching [':', 'crs', 'libmemory_mozalloc.a', 'mozalloc_abort.o', 'Unified_cpp_memory_mozalloc0.o'] : [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/config/expandlibs_exec.py", line 354, in <module>
    exit(main(sys.argv[1:]))
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/config/expandlibs_exec.py", line 343, in main
    raise e
OSError: [Errno 2] No such file or directory
"""

Here ':' is called instead of AR. If we look at the ./configure call it explicitly overrides AR with empty string (no ${AR} specificed).

"""
/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/js/src/configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/s
hare/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-jemalloc --enable-readline --with-system-nspr --with-system-zlib --disable-optimize --wi
th-intl-api --with-system-icu --disable-debug --enable-ion --disable-tests XARGS=/usr/bin/xargs CONFIG_SHELL=/bin/bash CC=x86_64-pc-linux-gnu-gcc CXX=x86_64-pc-linux-gnu-g++ LD=x86_64-pc-linux
-gnu-ld AR= RANLIB=
"""

Once we fix that build gets past to
"""
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/action/check_binary.py", line 362, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/action/check_binary.py", line 358, in main
    return checks(TARGET, options.binary)
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/action/check_binary.py", line 323, in checks
    c(target, binary)
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/action/check_binary.py", line 151, in check_textrel
    for tag, value in at_least_one(iter_readelf_dynamic(target, binary)):
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/action/check_binary.py", line 73, in at_least_one
    for item in iter:
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/action/check_binary.py", line 106, in iter_readelf_dynamic
    for line in get_output(target['readelf'], '-d', binary):
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/util.py", line 935, in __call__
    self[args] = self.func(*args)
  File "/tmp/portage/dev-lang/spidermonkey-60.5.2_p0-r4/work/mozjs-60.5.2/python/mozbuild/mozbuild/action/check_binary.py", line 60, in get_output
    return subprocess.check_output(cmd, env=env).splitlines()
  File "/usr/lib64/python2.7/subprocess.py", line 216, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
"""

which is similar to bug #727160, should be solved by passing --with-toolchain-prefix="${CHOST}-".

Both problems seem to be fixed with the following change:

"""
--- a/dev-lang/spidermonkey/spidermonkey-60.5.2_p0-r4.ebuild
+++ b/dev-lang/spidermonkey/spidermonkey-60.5.2_p0-r4.ebuild
@@ -65,28 +65,31 @@ src_prepare() {

 	# there is a default config.cache that messes everything up
 	rm -f "${S}/js/src"/config.cache || die

 	mkdir -p "${BUILDDIR}" || die
 }

 src_configure() {
 	cd "${BUILDDIR}" || die

+	tc-export AR RANLIB
+
 	ECONF_SOURCE="${S}/js/src" \
 	econf \
 		--disable-jemalloc \
 		--enable-readline \
 		--with-system-nspr \
 		--with-system-zlib \
 		--disable-optimize \
 		--with-intl-api \
+		--with-toolchain-prefix="${CHOST}-" \
 		$(use_with system-icu) \
 		$(use_enable debug) \
 		$(use_enable jit ion) \
 		$(use_enable test tests) \
 		XARGS="/usr/bin/xargs" \
 		CONFIG_SHELL="${EPREFIX}/bin/bash" \
 		CC="${CC}" CXX="${CXX}" LD="${LD}" AR="${AR}" RANLIB="${RANLIB}"
 }

 cross_make() {
"""
Comment 6 Larry the Git Cow gentoo-dev 2020-07-01 18:13:36 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca1565a6c2cefd1184f2cd830f4d7172fadfd84c

commit ca1565a6c2cefd1184f2cd830f4d7172fadfd84c
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-07-01 18:00:30 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-07-01 18:13:24 +0000

    dev-lang/spidermonkey: don't call ar directly
    
    Closes: https://bugs.gentoo.org/718616
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 dev-lang/spidermonkey/spidermonkey-60.5.2_p0-r4.ebuild | 3 +++
 1 file changed, 3 insertions(+)
Comment 7 Joakim Tjernlund 2020-07-01 18:47:51 UTC
(In reply to Sergei Trofimovich from comment #4)
> At least polkit depends on exact SLOT=60:
>     sys-auth/polkit-0.116-r1 (dev-lang/spidermonkey:60[-debug])
> 
> Or polkit is expected to be ported or removed by then?

Upstream seem to have ported to 68:
 https://gitlab.freedesktop.org/polkit/polkit/-/commit/007729aef3ab2bc0e9b60af373ad01cdeb9ed042

No release yet
Comment 8 Thomas Deutschmann gentoo-dev Security 2020-07-01 19:43:30 UTC
Joakim, this is bug 721700.
Comment 9 Larry the Git Cow gentoo-dev 2020-08-16 15:51:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1df519416ed0c47660d49fafb4a8f2ade342e9c5

commit 1df519416ed0c47660d49fafb4a8f2ade342e9c5
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-08-16 15:49:56 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-08-16 15:51:12 +0000

    dev-lang/spidermonkey: fix building against glibc-2.32
    
    Bug: https://bugs.gentoo.org/718616
    Closes: https://bugs.gentoo.org/737108
    Package-Manager: Portage-3.0.2, Repoman-2.3.23
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 dev-lang/spidermonkey/Manifest                     |   1 +
 .../spidermonkey-52.9.1_pre1-r2.ebuild             | 160 +++++++++++++++++++++
 2 files changed, 161 insertions(+)