[Pkg-javascript-devel] NodeJS repository structure

Jonas Smedegaard dr at jones.dk
Fri Oct 14 00:10:52 UTC 2011


On 11-10-14 at 01:58am, Jérémy Lal wrote:
> On 14/10/2011 01:45, Jonas Smedegaard wrote:
> > On 11-10-13 at 11:21pm, Jérémy Lal wrote:
> >> On 13/10/2011 20:31, Jonas Smedegaard wrote:
> >>> On 11-10-13 at 08:25pm, David Paleino wrote:
> >>>> I noticed that we're putting libraries under /usr/lib/nodejs/, but 
> >>>> there's also a /usr/share/nodejs/ populated by nodejs-dev.
> >>>>
> >>>> I've packaged libnode-sqlite3, which compiles a binding to 
> >>>> libsqlite3-dev, so /u/lib/ is its perfect place. But I'm wondering 
> >>>> why we're putting also arch-independent libraries in /u/lib/ ? 
> >>>> Wouldn't it better to follow the commonly used scheme of /u/share 
> >>>> for arch-indep and /u/lib for arch-dep?
> >>>>
> >>>> I haven't looked at nodejs code, but it doesn't seem too hard to 
> >>>> implement, given nodejs-dev already populates that directory.
> >>>>
> >>>> What do you think about this?
> >>>
> >>> As a principle I totally agree.
> >>>
> >>> Jérémy is our Node expert, however - let's wait and hear his opinion 
> >>> :-)
> >>
> >> Facts :
> >> * arch-independent libs must go to /usr/share/nodejs
> >> * arch-dependent libs must go to /usr/lib/nodejs
> >> * node libs that are arch-dependent almost all have two files : a 
> >>   dependent .node and an independent .js
> >> * it is unwise to multiply nodejs search paths...
> >>
> >> The simple decision is to put all modules in /usr/lib/nodejs, I 
> >> understand it's more important to have arch-dependent libs in the 
> >> right place than having arch-independent libs in the right place, and 
> >> all modules stay in the same dir.
> >> More importantly this is the same pattern as python and ruby.
> >>
> >> I'm nonetheless open to discussion.
> > 
> > Care to elaborate why it is unwise to multiply nodejs search paths?
> 
> Node already looks for modules in .node_libraries, ./node_modules, /usr/lib/nodejs...
> It's confusing, that's all. Also it adds one to an already long list of stat().
> 
> Also consider that lib, that contains both : a.js and a.node.
> At some point a.js will be require()'d. 
> a.js will expect a.node to be in the same dir, or something like that, because you can do
> require('./a.node');
> So a.js will need to be patched.

Seems you are talking about a library containing both arch-dependent and 
arch-independent code.

My point is that a package that *only* contains arch-independent code 
makes sense to install under /usr/share.


> > I do not follow your argument that same is true for Python: 
> > arch-independent Python library packages install below /usr/share.
> 
> I had a quick look but i swear /usr/share/python is almost empty here.
> http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html#s-paths
> It is unclear (to me, at first glance) wether it's /usr/lib/pythonxx or what.

Try look below /usr/share/pyshared.


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-javascript-devel/attachments/20111014/e2ba1990/attachment.pgp>


More information about the Pkg-javascript-devel mailing list