I came across the two modules in $SUBJECT as part of jQuery packaging. Both bundle code that is part of node core as of v0.10, so they're not permitted in Fedora due to our bundled library policy. Luckily, both are easy to work around.
For string_decoder, you just need to '%nodejs_fixdep -r string_decoder'. Core presents exactly the same interface in exactly the same module name so no patches are needed.
For readable-stream, it's a bit trickier. The old module split the different classes into seperate files. The core module makes all the classes available in one file. Additionaly the core module is called "stream", not "readable-stream".
If you're lucky (as I was with nodejs-lazystream for the most part), upstream will only use the module as a fallback, e.g.:
var readable = require('stream').Readable || require('readable-stream/readable')
In this case, you ought to be able to just '%nodejs_fixdep -r readable-stream' and things will just work. If you're not so lucky, you will need to patch require() calls thusly:
- var readable = require('readable-stream/readable') + var readable = require('stream').Readable
and/or
- var writable = require('readable-stream/writable') + var writable = require('stream').Writable
and lather, rinse, repeat for any other classes. Don't forget to '%nodejs_fixdep -r readable-stream' here also.
-T.C.
On 31/03/14 01:38, T.C. Hollingsworth wrote:
For readable-stream, it's a bit trickier. The old module split the different classes into seperate files. The core module makes all the classes available in one file. Additionaly the core module is called "stream", not "readable-stream".
If you're lucky (as I was with nodejs-lazystream for the most part), upstream will only use the module as a fallback, e.g.:
var readable = require('stream').Readable || require('readable-stream/readable')
In this case, you ought to be able to just '%nodejs_fixdep -r readable-stream' and things will just work. If you're not so lucky, you will need to patch require() calls thusly:
- var readable = require('readable-stream/readable')
- var readable = require('stream').Readable
and/or
- var writable = require('readable-stream/writable')
- var writable = require('stream').Writable
and lather, rinse, repeat for any other classes. Don't forget to '%nodejs_fixdep -r readable-stream' here also.
Just wanted to note that npm(readable-stream) comes in: - a 1.0.x branch which is the 'stream' module from Node 0.10 core - a 1.1.x branch which is the 'stream' module from Node 0.11 core
There are three modules so far that I've packaged that depend on readable stream 1.1.x. Fortunately, IIRC all tests still passed after patching them to use the 'stream' module from Node 0.10 core. I imagine patching in this way might cause problems for some modules though?
Kind regards,
On Mon, Mar 31, 2014 at 9:26 AM, Jamie Nguyen j@jamielinux.com wrote:
Just wanted to note that npm(readable-stream) comes in:
- a 1.0.x branch which is the 'stream' module from Node 0.10 core
- a 1.1.x branch which is the 'stream' module from Node 0.11 core
There are three modules so far that I've packaged that depend on readable stream 1.1.x. Fortunately, IIRC all tests still passed after patching them to use the 'stream' module from Node 0.10 core. I imagine patching in this way might cause problems for some modules though?
It should work in all cases. There might be a performance impact if they accidentally trigger the backwards compatibility behavior which is not present in 0.11: http://stackoverflow.com/a/21549237
As long as the application using them still works okay it shouldn't be a problem. Likely modules depending on this just want to use new streams fanciness without explicitly caring whether they get the Streams2 backward compatibility behavior or not.
That being said, readable-stream 1.1.x is packagable in Fedora as far as bundling issues are concerned, if it were to become necessary. (Though it looks like there are other issues with the package besides that. :-( ) There's plenty of precedent from the Python and Perl worlds for shipping userspace modules that provide new functionality not yet available in the standard library of the version of the language runtime provided by Fedora.
-T.C.
nodejs@lists.fedoraproject.org