Skip to content

Commit

Permalink
[FIX] Armhf snap build (#11268)
Browse files Browse the repository at this point in the history
* Update snapcraft.yaml

* Add node prep script

* Make executable

* Remove devDependency that caused arm failure.  Also removed packaged binary for sharp for arm

* dev/null tar stdout.  Remove sharp vendor folder only for arm so it will download and build

* add missing slash

* fix arm check to catch armv7l also

* remove /dev/null and verbose flag.

* Move extract to new line
  • Loading branch information
geekgonecrazy authored and rodrigok committed Jun 27, 2018
1 parent 204baf6 commit 445ef8b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 65 deletions.
61 changes: 0 additions & 61 deletions .snapcraft/README.md

This file was deleted.

14 changes: 11 additions & 3 deletions .snapcraft/resources/prepareRocketChat
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

curl -SLf "https://releases.rocket.chat/#{RC_VERSION}/download/" -o rocket.chat.tgz

tar xvf rocket.chat.tgz --strip 1
tar xf rocket.chat.tgz --strip 1

cd programs/server
rm -rf npm/node_modules/meteor/emojione_emojione/node_modules/grunt-contrib-qunit

npm install
if [[ $(uname -m) == *armv6l* ]] || [[ $(uname -m) == *armv7l* ]]
then
rm -rf npm/node_modules/sharp/vendor
fi

export NODE_ENV=production
npm i

# Ideally this will go away. For some reason on install its installing node-v57-linux-x64-glibc but when actually running it is looking for node-v57-linux-x64-unknown
if [[ $(uname -m) == "x86_64" ]]
Expand All @@ -15,4 +22,5 @@ then
fi

# sharp needs execution stack removed - https://forum.snapcraft.io/t/snap-and-executable-stacks/1812
execstack --clear-execstack npm/node_modules/sharp/vendor/lib/librsvg-2.so.2.42.0
ls -l npm/node_modules/sharp/vendor
execstack --clear-execstack npm/node_modules/sharp/vendor/lib/librsvg-2.so*
23 changes: 23 additions & 0 deletions .snapcraft/resources/preparenode
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

node_version="v8.11.3"

unamem="$(uname -m)"
if [[ $unamem == *aarch64* ]]; then
node_arch="arm64"
elif [[ $unamem == *64* ]]; then
node_arch="x64"
elif [[ $unamem == *86* ]]; then
node_arch="x86"
elif [[ $unamem == *armv6l* ]]; then
node_arch="armv6l"
elif [[ $unamem == *armv7l* ]]; then
node_arch="armv7l"
else
echo "Aborted, unsupported or unknown architecture: $unamem"
return 2
fi


wget https://nodejs.org/dist/$node_version/node-$node_version-linux-$node_arch.tar.xz
tar xf node-$node_version-linux-$node_arch.tar.xz --strip 1
2 changes: 1 addition & 1 deletion .snapcraft/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ apps:
parts:
node:
plugin: dump
prepare: wget https://nodejs.org/dist/v8.11.2/node-v8.11.2-linux-x64.tar.xz; tar xvf node-v8.11.2-linux-x64.tar.xz --strip 1;
prepare: ./resources/preparenode
build-packages:
# For fibers
- python
Expand Down

0 comments on commit 445ef8b

Please sign in to comment.