oortcloud / meteorite

Installer & smart package manager for Meteor
http://oortcloud.github.com/meteorite/
MIT License
841 stars 106 forks source link

mrt install breaks with smart packages inside smart packages #175

Open mizzao opened 11 years ago

mizzao commented 11 years ago

I have a smart package turkserver-meteor which contains its own smart-package waiting-lobby.

When I do mrt install inside a package that uses turkserver-meteor, it creates only a single symlink to the waiting-lobby package instead of one to turkserver-meteor and one to waiting-lobby:

$ ls -l packages/
lrwxrwxrwx 1 mao mao   59 Aug  6 22:39 turkserver -> /home/mao/projects/turkserver-meteor/packages/waiting-lobby

It should create two separate symlinks (which I am currently doing manually.)

tmeasday commented 11 years ago

Sorry, so are you saying you are in package C, which depends on B, which in turn depends on A, it installs only A into C's packages/ directory?

tmeasday commented 11 years ago

I'm not observing this behaviour. Can you try it with a clean checkout of https://github.com/tmeasday/meteor-transitioner ?

$ ls packages/
lrwxr-xr-x  1 tom  staff  125  7 Aug 14:34 page-js-ie-support -> /Users/tom/.meteorite/packages/page-js-ie-support/tmeasday/meteor-page-js-ie-support/b99ed8380aefd10b2afc8f18d9eed4dd0d8ea9cb
lrwxr-xr-x  1 tom  staff  101  7 Aug 14:34 router -> /Users/tom/.meteorite/packages/router/tmeasday/meteor-router/7bd3a1bdd1099625bb8b49406d9b8f961d6f4a17
lrwxr-xr-x  1 tom  staff   42  7 Aug 14:34 transitioner -> /Users/tom/Development/meteor/transitioner```
mizzao commented 11 years ago

B depends on A, but A is just straight up inside Bs packages folder - not a symlink. I'm not sure if people do this with smart packages, but I thought I'd try it out

In my case I am seeing the following...first I've deleted B from packages and then tried to do an install:

mao@aiur-ubuntu:~/projects/CrowdMapper$ ls -l packages
total 12
lrwxrwxrwx 1 mao mao   42 Jul 31 12:05 accounts-testing -> /home/mao/projects/meteor-accounts-testing
lrwxrwxrwx 1 mao mao  107 Jul 23 14:27 bootboxjs -> /home/mao/.meteorite/packages/bootboxjs/TimHeckel/meteor-bootboxjs/6088b5b6ec13304457394cd358cbdc5f3def1a1c
lrwxrwxrwx 1 mao mao   42 Jul 31 17:47 collection-hooks -> /home/mao/projects/meteor-collection-hooks
lrwxrwxrwx 1 mao mao   30 Jul 29 16:13 iron-router -> /home/mao/projects/iron-router
drwxrwxr-x 4 mao mao 4096 Aug  6 15:13 openlayers
lrwxrwxrwx 1 mao mao  132 Jun 28 17:43 publish-with-relations -> /home/mao/.meteorite/packages/publish-with-relations/erundook/meteor-publish-with-relations/98213e9f056b139597c99fb9ec2884ae6be76d91
lrwxrwxrwx 1 mao mao   33 Jun 24 17:40 sharejs -> /home/mao/projects/meteor-sharejs
lrwxrwxrwx 1 mao mao   37 Jun 24 13:51 user-status -> /home/mao/projects/meteor-user-status
lrwxrwxrwx 1 mao mao   46 Jun 27 14:29 x-editable-bootstrap -> /home/mao/projects/meteor-x-editable-bootstrap
mao@aiur-ubuntu:~/projects/CrowdMapper$ mrt install .

Done installing smart packages
mao@aiur-ubuntu:~/projects/CrowdMapper$ ls -l packages
total 12
lrwxrwxrwx 1 mao mao   42 Jul 31 12:05 accounts-testing -> /home/mao/projects/meteor-accounts-testing
lrwxrwxrwx 1 mao mao  107 Jul 23 14:27 bootboxjs -> /home/mao/.meteorite/packages/bootboxjs/TimHeckel/meteor-bootboxjs/6088b5b6ec13304457394cd358cbdc5f3def1a1c
lrwxrwxrwx 1 mao mao   42 Jul 31 17:47 collection-hooks -> /home/mao/projects/meteor-collection-hooks
lrwxrwxrwx 1 mao mao   30 Jul 29 16:13 iron-router -> /home/mao/projects/iron-router
drwxrwxr-x 4 mao mao 4096 Aug  6 15:13 openlayers
lrwxrwxrwx 1 mao mao  132 Jun 28 17:43 publish-with-relations -> /home/mao/.meteorite/packages/publish-with-relations/erundook/meteor-publish-with-relations/98213e9f056b139597c99fb9ec2884ae6be76d91
lrwxrwxrwx 1 mao mao   33 Jun 24 17:40 sharejs -> /home/mao/projects/meteor-sharejs
lrwxrwxrwx 1 mao mao   59 Aug  7 00:37 turkserver -> /home/mao/projects/turkserver-meteor/packages/waiting-lobby
lrwxrwxrwx 1 mao mao   37 Jun 24 13:51 user-status -> /home/mao/projects/meteor-user-status
lrwxrwxrwx 1 mao mao   46 Jun 27 14:29 x-editable-bootstrap -> /home/mao/projects/meteor-x-editable-bootstrap

B points to A, and A is simply not there. I do mv B A and then manually symlink B in order to get things to work.

mao@aiur-ubuntu:~/projects/CrowdMapper/packages$ mv turkserver waiting-lobby
mao@aiur-ubuntu:~/projects/CrowdMapper/packages$ ln -s /home/mao/projects/turkserver-meteor turkserver
tmeasday commented 11 years ago

Yeah, Meteorite doesn't really support putting smart packages inside packages/ folders of other packages. Remember that Meteorite was written before packages/ existed.

The reason you're seeing this weird behaviour is because Meteorite searches for a package.js within your package, and links to the folder containing this. Perhaps you are missing a package.js at the root, or maybe the algorithm is depth first, I can't remember.