Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 378367 - dev-lang/spidermonkey-1.8.5: please create new slot
Summary: dev-lang/spidermonkey-1.8.5: please create new slot
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Dirkjan Ochtman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 376987
  Show dependency tree
 
Reported: 2011-08-08 16:56 UTC by Ian Stakenvicius (RETIRED)
Modified: 2011-11-14 19:17 UTC (History)
3 users (show)

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


Attachments
patch to put spidermonkey-1.8.5.ebuild in its own slot (slot.patch,1.24 KB, patch)
2011-08-08 17:08 UTC, Ian Stakenvicius (RETIRED)
Details | Diff
Patch to fix the entire tree for spidermonkey-1.8.5 slotting (185-slot.patch,15.07 KB, text/plain)
2011-08-26 19:24 UTC, Ian Stakenvicius (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-08 16:56:15 UTC
Due to significant differences between spidermonkey-1.8.5 and previous versions, it would be very helpful to slot spidermonkey-1.8.5 (and above, possibly) so that compatible packages can start depending on it instead of xulrunner-2.0 for JS_VERSION >= 185.

Note that the package itself leads to slot'ing already:
- a pkg-config file is provided now, so relocation of includes and libs can be easily handled.  Also, it is expected that packages use pkg-config to obtain the proper settings for spidermonkey-1.8.5 (and the upstream packages that have been migrated all seem to do this)
- the library installed is 'libmozjs185.so' et. al, which already differs from the 'libjs.so' and 'libmozjs.so' of the previous packages.
- the API is incompatible, so even though include files are currently installed to /usr/include/js they are not actually compatible with previous versions and so any app depending on the include files in that path will actually break.

The only part of the package that does NOT lead to slotting is the 'js-config' script which is installed to /usr/bin/.  However, it is reported upstream that this file is often broken in spidermonkey-1.8.5 installs, and since pkg-config capability is provided it is most likely that this file could simply be removed.  Also, an audit of all packages which depend on dev-lang/spidermonkey in the tree has shown that none of their build systems use the js-config script; they all use paths and/or AC_CHECK_[whatever] (and pkg-config, for 185) to detect locations and build settings.

Finally, having spidermonkey-1.8.5 in its own slot would permit the un-hard-masking of this package.  This is gaining in importance due to the runtime conflict between spidermonkey-1.8.2.* and xulrunner-2.0.  Packages like gjs, which currently require JS_VERSION >= 185 for all versions in-tree, could then link to spidermonkey-1.8.5 instead of xulrunner-2 and allow for packages like gxine (which currently depends on =spidermonkey-1.8.2*) to install without issue.
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-08 17:08:58 UTC
Created attachment 282587 [details, diff]
patch to put spidermonkey-1.8.5.ebuild in its own slot

This patch is a rudamentary attempt at slotting spidermonkey-1.8.5.  

I have test-installed this version and test-built gjs-1.29.0 and freewrl-1.22.12_pre2 (both of which are in-tree and support spidermonkey-1.8.5) against it, and both packages build and install without issue.
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-08 17:11:48 UTC
(In reply to comment #1)
> Created attachment 282587 [details, diff]
> patch to put spidermonkey-1.8.5.ebuild in its own slot
> 
> This patch is a rudamentary attempt at slotting spidermonkey-1.8.5.  
> 
> I have test-installed this version and test-built gjs-1.29.0 and
> freewrl-1.22.12_pre2 (both of which are in-tree and support spidermonkey-1.8.5)
> against it, and both packages build and install without issue.


..actually i should qualify that i modified the DEPEND and RDEPEND in gjs-1.29.0.ebuild:

-       >=net-libs/xulrunner-2.0:1.9"
+       >=dev-lang/spidermonkey-1.8.5"
 DEPEND="${RDEPEND}
        sys-devel/gettext
-       >=dev-util/pkgconfig-0.9
-       !dev-lang/spidermonkey"
-# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with spidermonkey installed
+       >=dev-util/pkgconfig-0.9"
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-09 15:58:10 UTC
..ok small problem;

my rudimentary slotting attempt installed the headers to /usr/include/mozjs185/js/*  (as compared to /usr/include/js/*) ..  

mongodb (after being patched with upstream's spidermonkey-1.8.5 support patch) finds the libmozjs185.so library for 1.8.5, and within that finds all the various JS_VERSION >= 185 support it expects.  However, it does this via its 'scons' build system which apparently ignores pkg-config and therefore assumes the default /usr/include/js/*.h are the correct ones, which they arent...

Obviously the mongodb package could be patched to use pkg-config (probably), but if there's one case then there's probably more.....  :/
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-26 14:28:35 UTC
OK, so, mongodb is not going to support 1.8.5+ -- that means their funky build system is a non-issue.  I will audit the build systems of the remaining packages and see what it will take to support them with a slotted spidermonkey-1.8.5.
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-26 17:44:44 UTC
OK -- here's the verbose results.  Comments include what would need to be done to use the slotted spidermonkey-1.8.5, even if no such support exists right now:


dev-perl/Javascript-Spidermonkey seems to be a little bit lacking and I expect, as-is, will only work with a 'libjs.so' -- so it's dep should remain at :0 and probably also be limited to <=1.7 .

dev-lang/gjs-1.29.0 works great.  
dev-lang/gjs-0.7.x ebuild has a dependency forcing xulrunner-2 (ie, mozjs185) , but internally it seems to support both spidermonkey-1.8.2* and spidermonkey-1.8.5+.  Right now the build system only looks for 'mozilla-js' via pkg-config and so it will need to be patched to also look for 'mozjs185' to support spidermonkey-1.8.5+ whether slotted or not.  The dep could also be made more generic, so that those choosing to stick with a pre-185 spidermonkey (or xulrunner) could do so.

media-gfx/freewrl works great.

dev-libs/coin[javascript] -- i cannot figure out how javascript support is detected in this build system; it looks to me like there are autoconf macros missing from the tarball because too many of the functions used in configure.ac just don't seem to exist.  Furthermore i'm not exactly sure if coin actually links against spidermonkey or just provides an API that can be used along with it somehow.  Regardless, though, the code in Coin-3.1.3/include/Inventor/C/glue/spidermonkey.h is not compatible with JS_VERSION >= 185 so it seems all versions of coin need to stick to the pre-1.8.5 slot, and therefore just the dep needs to be adjusted accordingly.

media-video/gpac[javascript] I think will need its configure script adjusted, since it seems to only look for the lib and includes based on static guesses as to where they are.  However, since we're patching in the static guesses ourselves we can patch them to whatever they need to be.  IIRC though, JS_VERSION >= 185 isn't supported yet so no change should be required other than to correct the dep.

media-video/gxine currently has a hard-dep on spidermonkey-1.8.2* but except for the patch that renames the lib it searches for it seems that it would still support older spidermonkeys.  IIRC it does not support 1.8.5+, and the build system as-is would not find libmozjs185, so all that's needed here is to adjust the dep.  If support for spidermonkey-1.8.5 was going to be added, since the build system uses pkg-config, I expect it would detect the correct settings with the new slot without modification.

app-accessibility/edbrowse -- the lib to link against is passed in as a parameter to emake, so the only potential slotting issue in the future would be to add support for a different include path as well (assuming the build system doesn't change).  Again, this package doesn't support JS_VERSION >= 185 at the moment so the dep is the only change necessary (and needs to be done anyways).

dev-db/couchdb -- no issues here.  to support slotting, our slot-specific include dir would need to be specified in the ebuild, the same way the regular include dir is specified now.  There is no support for JS_VERSION >= 185, and presumedly when support will be added then a proper lib check for libmozjs185.so will be added to ./configure.  Only the dep needs to be changed.

dev-db/mongodb -- no change necessary; the maintainer has even adjusted the dep already.

dev-games/crystalspace[javascript] -- the source code has no support for javascript to begin with, so this isn't even a valid dep.  There is no --with-js in ./configure, and all references to 'js' relate to joystick support.  So the
flag and dep should just be removed.

net-misc/mediatomb[javascript] -- configure script does this one the hard way, it searches a list of paths for jsapi.h and then searches for various types of support in a list of libs (libjs, libmozjs, etc).  No issues with slotting here as libmozjs185 isn't in the list and the package doesn't support JS_VERSION >= 185 yet.  Adding slot support once 185 is supported will require direct specification of the slotted include path, which it seems can be done by setting one in JS_SEARCH_HEADERS, so fairly trivial.

net-misc/plowshare[javascript] -- no build system, the use flag just allows or disables the installation of a few modules.  As far as I can tell, though, spidermonkey is only a dep because it is assumed that it provides an interpreter shell via the 'js' bin, and 1.8.2 and above do not.  So this dep seems to be invalid -- what is needed here is a javascript interpreter for the console, which spidermonkey is not.

www-client/elinks[javascript] -- latest version doesn't work with 1.8.5 and the DEP states as such accordingly.  There -is- a has_version within the ebuild that may need adjustment, though.  configure.ac does detection the hard way, with checking for jsapi.h in certain paths and then checking for libjs / libsmjs / libmozjs in a related path.  If support for 1.8.5 was added in the future, the slotted include path can be specified via the --with-js= option to ./configure within the ebuild.

-----------------------------------------------------------
Here's the To-Do:

Ebuilds that need atom fixes only, to force slot 0 :

app-accessibility/edbrowse/edbrowse-3.4.7.ebuild
dev-db/couchdb/couchdb-1.0.2.ebuild
dev-db/couchdb/couchdb-1.1.0.ebuild
dev-db/mongodb/mongodb-1.6.5-r1.ebuild
dev-db/mongodb/mongodb-1.8.2.ebuild
dev-db/mongodb/mongodb-1.8.2-r1.ebuild
dev-db/mongodb/mongodb-1.8.2_rc3.ebuild
dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.20.ebuild
media-libs/coin/coin-3.1.0.ebuild
media-libs/coin/coin-3.1.3-r1.ebuild
media-video/gpac/gpac-0.4.5-r1.ebuild
media-video/gpac/gpac-0.4.5-r4.ebuild
media-video/gxine/gxine-0.5.905-r1.ebuild
net-misc/mediatomb/mediatomb-0.12.1.ebuild
www-client/elinks/elinks-0.12_pre5-r1.ebuild (in a has_version)


Ebuilds that need to be fixed because their use of spidermonky is wrong:

dev-games/crystalspace/crystalspace-1.2.1.ebuild
net-misc/plowshare/plowshare-0.9.3.ebuild
net-misc/plowshare/plowshare-0.9.4.ebuild
net-misc/plowshare/plowshare-1327.ebuild


Ebuilds that need other changes:

dev-libs/gjs/gjs-0.7.14.ebuild - depends on xulrunner-2 right now but should instead be patched to use xpidermonkey-1.8.5 (and then have it's dep adjusted), or be set to depend on xulrunner-1.9 and/or spidermonkey-1.8.2.*, which internally seems to be supported.

dev-libs/gjs/gjs-1.29.0.ebuild - depends on xulrunner-2 but should depend instead on spidermonkey-1.8.5. Support is already in the package, just the dep needs adjustment.


...all the rest should work unchanged.
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-26 19:24:05 UTC
Created attachment 284739 [details]
Patch to fix the entire tree for spidermonkey-1.8.5 slotting

This patch includes changes to spidermonkey-1.8.5.ebuild for slotting (sorry it doesn't revbump it, i don't know how to manage that one in a patch yet), and all changes necessary to the rest of the ebuilds in the tree as well.

The only significant change is with dev-libs/gjs-0.7.14 , where i changed the dep entirely to spidermonkey-1.8.5 and also backported relevant detection from the configure.ac script in gjs-1.21.0.  The rest of the changes are rather trivial.

I reconsidered the removal of js-config and decided to rename it js185-config instead.  If absolutely necessary we could set up an eselect module for it but I don't know of anything that actually uses the script (nothing in the tree does, at least)

I am currently doing test builds of all of these packages in x86 and ~x86 chroots, to confirm everything is as expected.
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-26 20:57:38 UTC
..my gjs-0.7.14 patch doesn't seem to work atm; i'll have to revisit that.  Technically that ebuild can stay as-is, it is just unfortunate that it won't work unless spidermonkey-1.8.2* is not installed concurrently with it.
Comment 8 Nirbheek Chauhan (RETIRED) gentoo-dev 2011-09-25 14:17:20 UTC
From the packages list, it doesn't seem like there are lot of packages that depend on spidermonkey.

I see that other distros have patches to port the packages to 1.8.5 — it's better to use those patches instead of hacking around the problem by slotting it.

elinks:
http://pkgs.fedoraproject.org/gitweb/?p=elinks.git;a=blob;f=elinks-0.12pre5-js185.patch;hb=HEAD

gxine:
http://pkgs.fedoraproject.org/gitweb/?p=gxine.git;a=blob;f=gxine-0.5.905-js.patch;hb=HEAD

couchdb:
Has support in svn, probably best to use a snapshot.

mediatomb:
http://pkgs.fedoraproject.org/gitweb/?p=mediatomb.git;a=blob;f=mediatomb-0.12.1.tonewjs.patch;hb=HEAD
http://pkgs.fedoraproject.org/gitweb/?p=mediatomb.git;a=blob;f=mediatomb-0.12.1-jsparse.patch;hb=HEAD

Freewrl already works, according to the ebuild.

plowshare needs /usr/bin/js -- need to investigate if it can use /usr/bin/gjs instead.

No patches for coin and gpac yet, we should just version-restrict them.

crystalspace has no USE=javascript in the latest version.

mongodb has an internal copy of spidermonkey, which should be used instead.
Comment 9 Ian Stakenvicius (RETIRED) gentoo-dev 2011-09-28 16:16:26 UTC
well, bug 376987 is the tracker for all of these issues; none of which have been resolved in months..  is it authoritatively decided that packages must be made compatible with 1.8.5 instead of having 1.8.5 be slotted?  And if so, does that mean these packages will be upgraded sometime soon?
Comment 10 Ian Stakenvicius (RETIRED) gentoo-dev 2011-10-04 16:14:01 UTC
FYI, there is apparently a gjs-0.7.14-r1 on the gnome overlay that does work with spidermonkey instead of xulrunner.  So that will be one more package that needs spidermonkey-1.8.5 unmasked one way or another.
Comment 11 Ian Stakenvicius (RETIRED) gentoo-dev 2011-11-14 19:17:55 UTC
I rescind my request, as 1.8.5 is being unmasked soon and i concurr with everyone that keeping the slot would be too much work.