mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-27 21:26:38 +00:00
chore: fix lzma-native not building for the x86 Linux CLI (#1448)
There are various problems that contributed to this issue: - `node-pre-gyp` doesn't detect the 6.10.3 node version. We reverted to 6.1.0, which the module recognised, and which shares the same v8 ABI - Passing `--force` to `npm install` causes npm to swallow any errors and silently continue - The x86 Docker container has problems writing to `$HOME/.node-gyp`. The solution is to enable `unsafe-perm` given that the container is running as `root` Fixes: https://github.com/resin-io/etcher/issues/1444 Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
parent
57e29a5725
commit
a74e6b53cd
4
Makefile
4
Makefile
@ -19,7 +19,7 @@ BUILD_OUTPUT_DIRECTORY = $(BUILD_DIRECTORY)/out
|
|||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
|
|
||||||
ELECTRON_VERSION = $(shell jq -r '.devDependencies["electron"]' package.json)
|
ELECTRON_VERSION = $(shell jq -r '.devDependencies["electron"]' package.json)
|
||||||
NODE_VERSION = 6.10.3
|
NODE_VERSION = 6.1.0
|
||||||
COMPANY_NAME = $(shell jq -r '.companyName' package.json)
|
COMPANY_NAME = $(shell jq -r '.companyName' package.json)
|
||||||
APPLICATION_NAME = $(shell jq -r '.displayName' package.json)
|
APPLICATION_NAME = $(shell jq -r '.displayName' package.json)
|
||||||
APPLICATION_DESCRIPTION = $(shell jq -r '.description' package.json)
|
APPLICATION_DESCRIPTION = $(shell jq -r '.description' package.json)
|
||||||
@ -191,7 +191,7 @@ $(BUILD_DIRECTORY)/electron-$(TARGET_PLATFORM)-$(TARGET_ARCH)-dependencies: pack
|
|||||||
$(BUILD_DIRECTORY)/node-$(TARGET_PLATFORM)-$(TARGET_ARCH)-dependencies: package.json npm-shrinkwrap.json \
|
$(BUILD_DIRECTORY)/node-$(TARGET_PLATFORM)-$(TARGET_ARCH)-dependencies: package.json npm-shrinkwrap.json \
|
||||||
| $(BUILD_DIRECTORY)
|
| $(BUILD_DIRECTORY)
|
||||||
mkdir $@
|
mkdir $@
|
||||||
./scripts/build/dependencies-npm.sh -p -f \
|
./scripts/build/dependencies-npm.sh -p \
|
||||||
-r "$(TARGET_ARCH)" \
|
-r "$(TARGET_ARCH)" \
|
||||||
-v "$(NODE_VERSION)" \
|
-v "$(NODE_VERSION)" \
|
||||||
-x $@ \
|
-x $@ \
|
||||||
|
@ -32,7 +32,6 @@ function usage() {
|
|||||||
echo " -t <target platform (node|electron)>"
|
echo " -t <target platform (node|electron)>"
|
||||||
echo " -s <target operating system>"
|
echo " -s <target operating system>"
|
||||||
echo " -x <install prefix>"
|
echo " -x <install prefix>"
|
||||||
echo " -f force install"
|
|
||||||
echo " -p production install"
|
echo " -p production install"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -42,17 +41,15 @@ ARGV_TARGET_VERSION=""
|
|||||||
ARGV_TARGET_PLATFORM=""
|
ARGV_TARGET_PLATFORM=""
|
||||||
ARGV_TARGET_OPERATING_SYSTEM=""
|
ARGV_TARGET_OPERATING_SYSTEM=""
|
||||||
ARGV_PREFIX=""
|
ARGV_PREFIX=""
|
||||||
ARGV_FORCE=false
|
|
||||||
ARGV_PRODUCTION=false
|
ARGV_PRODUCTION=false
|
||||||
|
|
||||||
while getopts ":r:v:t:s:x:fp" option; do
|
while getopts ":r:v:t:s:x:p" option; do
|
||||||
case $option in
|
case $option in
|
||||||
r) ARGV_ARCHITECTURE=$OPTARG ;;
|
r) ARGV_ARCHITECTURE=$OPTARG ;;
|
||||||
v) ARGV_TARGET_VERSION=$OPTARG ;;
|
v) ARGV_TARGET_VERSION=$OPTARG ;;
|
||||||
t) ARGV_TARGET_PLATFORM=$OPTARG ;;
|
t) ARGV_TARGET_PLATFORM=$OPTARG ;;
|
||||||
s) ARGV_TARGET_OPERATING_SYSTEM=$OPTARG ;;
|
s) ARGV_TARGET_OPERATING_SYSTEM=$OPTARG ;;
|
||||||
x) ARGV_PREFIX=$OPTARG ;;
|
x) ARGV_PREFIX=$OPTARG ;;
|
||||||
f) ARGV_FORCE=true ;;
|
|
||||||
p) ARGV_PRODUCTION=true ;;
|
p) ARGV_PRODUCTION=true ;;
|
||||||
*) usage ;;
|
*) usage ;;
|
||||||
esac
|
esac
|
||||||
@ -87,10 +84,6 @@ export npm_config_arch=$ELECTRON_ARCHITECTURE
|
|||||||
|
|
||||||
INSTALL_OPTS=""
|
INSTALL_OPTS=""
|
||||||
|
|
||||||
if [ "$ARGV_FORCE" == "true" ]; then
|
|
||||||
INSTALL_OPTS="$INSTALL_OPTS --force"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ARGV_PRODUCTION" == "true" ]; then
|
if [ "$ARGV_PRODUCTION" == "true" ]; then
|
||||||
INSTALL_OPTS="$INSTALL_OPTS --production"
|
INSTALL_OPTS="$INSTALL_OPTS --production"
|
||||||
fi
|
fi
|
||||||
|
@ -33,6 +33,10 @@ RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
|
|||||||
# NodeJS
|
# NodeJS
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
||||||
&& apt-get install -y nodejs
|
&& apt-get install -y nodejs
|
||||||
|
|
||||||
|
# See https://github.com/mapbox/node-pre-gyp/issues/165
|
||||||
|
RUN npm config set unsafe-perm=true
|
||||||
|
|
||||||
RUN npm config set spin=false
|
RUN npm config set spin=false
|
||||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
||||||
|
|
||||||
|
@ -33,6 +33,10 @@ RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
|
|||||||
# NodeJS
|
# NodeJS
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
||||||
&& apt-get install -y nodejs
|
&& apt-get install -y nodejs
|
||||||
|
|
||||||
|
# See https://github.com/mapbox/node-pre-gyp/issues/165
|
||||||
|
RUN npm config set unsafe-perm=true
|
||||||
|
|
||||||
RUN npm config set spin=false
|
RUN npm config set spin=false
|
||||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
||||||
|
|
||||||
|
@ -33,6 +33,10 @@ RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
|
|||||||
# NodeJS
|
# NodeJS
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
||||||
&& apt-get install -y nodejs
|
&& apt-get install -y nodejs
|
||||||
|
|
||||||
|
# See https://github.com/mapbox/node-pre-gyp/issues/165
|
||||||
|
RUN npm config set unsafe-perm=true
|
||||||
|
|
||||||
RUN npm config set spin=false
|
RUN npm config set spin=false
|
||||||
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user