Skip to content

Commit 593f9d5

Browse files
committed
build: build and publish binaries for 32-bit systems
includes workaround which symlinks /usr/include/asm to /usr/include/asm-generic, see https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/825574/comments/2
1 parent 89915d2 commit 593f9d5

2 files changed

Lines changed: 32 additions & 11 deletions

File tree

.travis.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,22 @@ sudo: false
1313

1414
env:
1515
matrix:
16-
- export NODE_VERSION="0.12"
17-
- export NODE_VERSION="4.1"
18-
- export NODE_VERSION="5.8"
16+
- export NODE_VERSION="0.12" TARGET_ARCH="x64"
17+
- export NODE_VERSION="4.1" TARGET_ARCH="x64"
18+
- export NODE_VERSION="5.8" TARGET_ARCH="x64"
1919

2020
matrix:
2121
fast_finish: true
22+
include:
23+
- os: linux
24+
env: export NODE_VERSION="0.12" TARGET_ARCH="ia32"
25+
sudo: required
26+
- os: linux
27+
env: export NODE_VERSION="4.1" TARGET_ARCH="ia32"
28+
sudo: required
29+
- os: linux
30+
env: export NODE_VERSION="5.8" TARGET_ARCH="ia32"
31+
sudo: required
2232

2333
git:
2434
depth: 1
@@ -30,15 +40,19 @@ addons:
3040
packages:
3141
- build-essential
3242
- libssl-dev
33-
- gcc-4.9
34-
- g++-4.9
43+
- gcc-4.9-multilib
44+
- g++-4.9-multilib
3545
- lcov
3646

3747
before_install:
3848
- export CC=clang
3949
- export CXX=clang++
4050
- export npm_config_clang=1
4151

52+
- if [ $TARGET_ARCH == "ia32" ]; then
53+
sudo ln -s /usr/include/asm-generic /usr/include/asm;
54+
fi
55+
4256
- if [ $TRAVIS_OS_NAME != "linux" ]; then
4357
git clone https://github.com/creationix/nvm.git ./.nvm;
4458
source ./.nvm/nvm.sh;
@@ -74,22 +88,26 @@ before_script:
7488
- git config --global user.email johndoe@example.com
7589

7690
script:
77-
- if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "0.12" ]; then
78-
npm test && npm run cov && npm run coveralls;
91+
- if [ $TARGET_ARCH == "x64" ]; then
92+
if [ -z "$TRAVIS_TAG" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "0.12" ]; then
93+
npm test && npm run cov && npm run coveralls;
94+
else
95+
npm test;
96+
fi
7997
else
80-
npm test;
98+
echo "Not running tests because the binary is not built for 64-bit systems";
8199
fi
82100

83101
after_success:
84102
- if [ -n "$TRAVIS_TAG" ]; then
85103
npm install -g node-pre-gyp;
86104
npm install -g aws-sdk;
87105
node lifecycleScripts/clean;
88-
node-pre-gyp package;
89-
node-pre-gyp publish;
106+
node-pre-gyp package --target_arch=$TARGET_ARCH;
107+
node-pre-gyp publish --target_arch=$TARGET_ARCH;
90108
fi
91109

92-
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "4.1" ]; then
110+
- if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ] && [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "4.1" ] && [ $TARGET_ARCH == "x64" ]; then
93111
.travis/deploy-docs.sh;
94112
fi
95113

lifecycleScripts/install.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ function build() {
8181
var builder = "node-gyp";
8282
var debug = (process.env.BUILD_DEBUG ? "--debug" : "");
8383
var target = "";
84+
var arch = (process.env.TARGET_ARCH ?
85+
"--arch=" + process.env.TARGET_ARCH : "");
8486
var distUrl = "";
8587
var runtime = "";
8688

@@ -114,6 +116,7 @@ function build() {
114116
"rebuild",
115117
debug,
116118
target,
119+
arch,
117120
distUrl,
118121
runtime
119122
]

0 commit comments

Comments
 (0)