Yarn: Support --arch and --target_arch to build modules for other architectures

Created on 11 Dec 2016  路  5Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
Not able to pass parameters so that yarn can be told to build packages for a specific architecture. Right now, in order to build for a specific target other than the architecture of the machine yarn is executed on, one has to run (example given to compile for arm):

yarn --production --ignore-scripts
npm rebuild --arch=arm --target_arch=arm

What is the expected behavior?
Ability to pass --arch and --target_arch that yarn would then pass on to node-gyp, so that the above example would turn into:

yarn --production --arch=arm --target_arch=arm

Please mention your node.js, yarn and operating system version.
node v6.9.1
yarn 0.17.10
Ubuntu 14.04

cat-feature good first issue help wanted triaged

Most helpful comment

This should be resolved now. Cross-compiling is available by setting the npm_config_arch environment variable.

All 5 comments

+1

PR is welcome

This should be resolved now. Cross-compiling is available by setting the npm_config_arch environment variable.

That aside it would also be great to support --target_platform, e.g. --target_platform=linux to be able for example to natively build a docker container on osx. Or is it possible to set a env variable for that also?

https://docs.npmjs.com/misc/config theoretically if npm has a flag for it, you can set the env var the same way, e.g. something like npm_config_platform=linux

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebmck picture sebmck  路  3Comments

AzGoalie picture AzGoalie  路  3Comments

torifat picture torifat  路  3Comments

MunifTanjim picture MunifTanjim  路  3Comments

davidmaxwaterman picture davidmaxwaterman  路  3Comments