Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 376983 - Patch or remove <dev-db/mongodb-2.2.0 as they fail to build against >=spidermonkey-1.8.5
Summary: Patch or remove <dev-db/mongodb-2.2.0 as they fail to build against >=spider...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ultrabug
URL:
Whiteboard:
Keywords:
Depends on: 390631
Blocks:
  Show dependency tree
 
Reported: 2011-07-29 19:24 UTC by Ian Stakenvicius (RETIRED)
Modified: 2013-01-18 11:23 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,2.88 KB, text/plain)
2011-08-02 19:35 UTC, Ian Stakenvicius (RETIRED)
Details
patch to support JS_VERSION >= 185 (mongodb-1.8-spidermonkey-1.8.5-support.patch,56.71 KB, text/plain)
2011-08-08 15:27 UTC, Ian Stakenvicius (RETIRED)
Details
patch to support all JS_VERSIONs (including >= 185) (mongodb-1.8-spidermonkey-1.8.5-support2.patch,57.89 KB, text/plain)
2011-08-09 16:23 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-07-29 19:24:21 UTC
spidermonkey-1.8.5 provides libmozjs185.so , while previous versions provide either libmozjs.so or libjs.so.  This version of mongodb should have it's dep updated to:

!v8? ( =dev-lang/spidermonkey-1.8.2* )

...or alternatively force the 'v8' dep.



Reproducible: Always
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2011-07-29 19:35:20 UTC
..correction, this applies to all versions currently in the tree.
Comment 2 Agostino Sarubbo gentoo-dev 2011-07-30 03:49:50 UTC
Please add your full build log as attachment and emerge --info
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2011-07-30 05:00:22 UTC
...I will have to re-emerge these to get the build log(s); will attach in the future.

However, looking directly at the source of mongodb-1.8.2, scripting/engine_spidermonkey.cpp(L1142): 
    _global = JS_NewObject( _context , &global_class, NULL, NULL);

..is invalid in JS_VERSION >= 185.  Global objects now need to be created using the call JS_NewGlobalObject() or JS_NewContainerAndGlobalObject().  This is just one of -many- API changes in JS_VERSION >= 185.  Getting this package to actually work with spidermonkey-1.8.5 is going to require a (rather large) patch or update from upstream.
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-02 19:35:10 UTC
Created attachment 281881 [details]
build.log

Here's the build log showing the failure to discover a valid js library at configure time.

And here's the output of `equery f spidermonkey |grep 'lib/'`:

/usr/lib/libmozjs185.so
/usr/lib/libmozjs185.so.1.0
/usr/lib/libmozjs185.so.1.0.0
/usr/lib/pkgconfig
/usr/lib/pkgconfig/mozjs185.pc

...as you can see, the result does not match the list ['mozjs', 'js', 'js_static']
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-08 15:27:05 UTC
Created attachment 282575 [details]
patch to support JS_VERSION >= 185

Upstream has had a patch to support spidermonkey-1.8.5 in place since mongodb-1.8.0 (unsure why it hasn't been added to the main sources, tbh).  Attached is the patch from http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/mongodb/releases/1.8.1/2/SOURCES/mongodb-1.8.0-spidermonkey-1.8.5-support.patch?revision=665533&view=markup , slightly modified to apply cleanly alongside existing gentoo patches.

Compiles fine against spidermonkey-1.8.5 here; did not test runtime but since most other distros are using it I expect it's fine.

Patch doesn't work on pre-1.8.5 spidermonkeys though; there are a couple of spots that are JS_VERSION >= 185 specific.  Will need to be epatched with a has_version wrapper.
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-09 16:23:14 UTC
Created attachment 282729 [details]
patch to support all JS_VERSIONs (including >= 185)

For this patch I back-ported the old code into #ifdef's so that the result woud compile cleanly with both older and newer spidermonkeys.  

I would recommend using this patch instead; plus, this is the patch that should be submitted for integration into the upstream codebase, if they wish to support multiple versions of spidermonkey.

Note that neither patch provide a scons configuration that uses pkg-config (or similar) to obtain the cflags and ldflags of spidermonkey-1.8.5;  by association, the package will not work with a slotted spidermonkey (bug 378367)
Comment 7 Ultrabug gentoo-dev 2011-08-11 09:51:29 UTC
Hi Ian,

First, thanks a lot for this work and help.

I'm just checking in to at least say that I'm unable to take the necessary look on this matter due to heavy RL work load atm.

Thanks again for your patience and help.
Comment 8 Johan Bergström 2011-08-26 08:34:35 UTC
First of all: Ian, thanks for your work.

I've been looking closer into this and here's a couple of notes:
 - 1.8.5 is already package.mask:ed in gentoo and most likely will be for a while
 - This patch doesn't seem to have gotten much feedback from upstream, which is a bit frightening. By looking at their JIRA and git master, it seems clear that the way forward is leaning more on v8.

Related tickets:
 - https://jira.mongodb.org/browse/SERVER-2887 , the spidermonkey 1.8.5 bug
 - From 2.0 and forward, they bundle their own legacy version of 1.7: https://github.com/mongodb/mongo/tree/master/third_party/js-1.7
 - Switch to v8 in 2.2: https://jira.mongodb.org/browse/SERVER-2407

I haven't fully confirmed this with upstream, but it looks to me that they shift focus to v8, which makes me inclined to doing the same for gentoo. We should stick to a spidermonkey version that works (we basically already are committed to 1.8.2.x) and then stick to upstreams decisions regarding v8. 

This would therefore result in a WONTFIX.

Thoughts?
Comment 9 Ultrabug gentoo-dev 2011-08-26 12:52:23 UTC
Hello guys,

As seen with you Johan, I agree that we should stick to upstream's plans and Gentoo's stable spidermonkey version anyway.
So we will follow Ian's first impression and force dep to spidermonkey-1.8.2* versions. I thus close this bug as UPSTREAM as it is in their hands.

I took the opportunity to do some other changes I had in mind and discussed with Johan, so here we go :

+*mongodb-1.8.3 (26 Aug 2011)
+
+  26 Aug 2011; Ultrabug <ultrabug@gentoo.org> -mongodb-1.6.5-r1.ebuild,
+  -files/mongodb-1.6-fix-scons.patch, -mongodb-1.8.2_rc3.ebuild,
+  -mongodb-1.8.2.ebuild, mongodb-1.8.2-r1.ebuild, +mongodb-1.8.3.ebuild,
+  files/mongodb.confd, files/mongodb.initd, files/mongos.confd,
+  files/mongos.initd, metadata.xml:
+  Fix spidermonkey dependency wrt #376983 (thanks to Ian Stakenvicius). Version
+  bump. Drop old 1.6 series. Add Johan Bergström as proxy maintainer. Init
+  scripts handle baselayout-1 and openrc correctly + better bind_ip setup.
+

Thank you again for your patience Ian, and help guys.

PS: mongodb-2.0.0_rc0 ebuild is on its way ;)
Comment 10 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-26 14:24:24 UTC
Thank-you.

The primary purpose of my filing this bug was to help resolve all outstanding issues that keep spidermonkey-1.8.5 from being unmasked.  Setting the dep specifically to <=1.8.2* should help.

Also, the decision to not support 1.8.5+ in the mongodb ebuilds means that if spidermonkey-1.8.5 ends up being added in a new slot, mongodb's somewhat unorthodox js detection in its build system won't need to have any nasty workarounds to support it.  :)
Comment 11 Ian Stakenvicius (RETIRED) gentoo-dev 2011-08-26 15:43:10 UTC
Given that there are still a few other packages in the tree that don't work with any spidermonkey newer than 1.7 due to the whole 'libjs.so => libmozjs.so' name change, would it be in the interest of mongodb to stick with a 1.7 spidermonkey dep as well?  ie, if 1.8.2.x was retired from the tree?
Comment 12 Johan Bergström 2011-12-01 16:27:26 UTC
I'm inclined to close this since upstream basically enforces a 1.7 build. If no one disagrees I'll close this in a week or so.
Comment 13 Ian Stakenvicius (RETIRED) gentoo-dev 2012-10-11 20:11:53 UTC
Changing bug to help track neccessary steps for the removal of older spidermonkey versions once 1.8.5 goes stable.
Comment 14 Ultrabug gentoo-dev 2012-11-04 14:24:32 UTC
Ok Ian thanks. FYI I prepared for this, all we'll have to do is drop 1.8.5 from tree.

  04 Nov 2012; <alexys@gentoo.org> +files/mongodb-2.0-r1-boost-1.50.patch,
  -mongodb-2.0.7.ebuild, +mongodb-2.0.7-r1.ebuild, +mongodb-2.0.7-r2.ebuild,
  -mongodb-2.2.0.ebuild, +mongodb-2.2.0-r2.ebuild,
  +files/mongodb-2.2-r2-boost-1.50.patch, +mongodb-2.2.1.ebuild:
  Fix boost-1.50 build for 2.x series, fix #425190, use -r1 versions for older
  boost, use -r2 for >=1.50 boost. No longer depend on spidermonkey-1.7 for all
  the 2.x series wrt #390631. Note that v1.8.5 will be dropped later wrt
  #376983. Version bump fix #441586. Drop old stuff.
Comment 15 Ultrabug gentoo-dev 2013-01-18 11:23:11 UTC
I think we can close this bug now Ian, re-open if I missed something.

+*mongodb-2.2.2-r1 (18 Jan 2013)
+
+  18 Jan 2013; Ultrabug <ultrabug@gentoo.org> -mongodb-1.8.5.ebuild,
+  +mongodb-2.2.2-r1.ebuild, files/mms-agent.initd, files/mongodb.initd,
+  files/mongos.initd:
+  Do not keepdir /var/run wrt #445686, obsolete version 1.8.5 moved to ultrabug
+  overlay wrt #376983
+

Cheers