pantsbuild / binaries

A temporary home for pants static binaries and scripts
16 stars 37 forks source link

Add npm scripts and binaries for mac #1

Closed tejal29 closed 9 years ago

tejal29 commented 9 years ago

These will install npm modules for tasks

  1. LessC
  2. RequireJs and
  3. RTLCSS

The modules will be downloaded in node_modules directory where you run the scripts. Please copy the

  1. node_modules/less/bin/lessc to appropriate platform specific dir.
  2. node_modules/R2/bin/r2 to appropriate platform specific dir.
  3. node_modules/requirejs/bin/r.js to appropriate platform specific dir.
tejal29 commented 9 years ago

@jsirois does this look good? Let me know if i should put up a req for this. Also, i have a feeling, the lessc and require.js should be platform independent.

jsirois commented 9 years ago

Yeah - it seems to me the only binaries we should host are node and npm. Pants can then use npm to do local installs of other tools in .pants.d (but probably with artifact caching turned on so they wind up in ~/.cache/pants/artifact_cache and are only ever installed once per version.

For the node and npm install you should be ensuring a static binary on linux and the build should really be local; ie: sudo is a big red flag. I used ./configure --prefix to do this, for example, for bison to support building thrift on OSX's with too-old a bison, but wanting to avoid installing bison on the builder's machine. See here: https://github.com/pantsbuild/binaries/blob/gh-pages/build-thrift-0.9.2.sh#L3

tejal29 commented 9 years ago

@jsirois can we merge this in?

jsirois commented 9 years ago

I'd prefer not as per my comments above. The build script does scary things as root, etc. Can you respond to that?

jsirois commented 9 years ago

oh... you did do changes - just a sec.

jsirois commented 9 years ago

@tejal29 - so this departs from how binaries works to-date. Do you need everything in those tarballs or just bin/node and bin/npm?

tejal29 commented 9 years ago

No, the way node works, it needs everything in lib folder.

The binary for npm bin/npm is nothing but a file pointer to lib/node_modules/npm/bin/npm-cli.js

npm install <module> actually runs sources froms lib folder. So i need everything in those tarballs.

jsirois commented 9 years ago

Ok then, I'm happy with this. I'll squash this in as 1 commit and publish presently.

tejal29 commented 9 years ago

Thanks a lot!

jsirois commented 9 years ago

OK - squashed in @ https://github.com/pantsbuild/binaries/commit/ea277381173b04ee4780c3c26fe7d50d7b94e73b and synced up to bintray.