Skip to content

Commit

Permalink
Merge pull request #10015 from RocketChat/fix/snap-execstack-and-grpc
Browse files Browse the repository at this point in the history
Fix snap install. Remove execstack from sharp, and bypass grpc error
  • Loading branch information
graywolf336 authored Mar 28, 2018
2 parents 89bb702 + fda37f1 commit 93b2be7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions .circleci/snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ git clone -b $SNAP_CHANNEL git+ssh://rocket.chat.buildmaster@git.launchpad.net/r
# Rarely will change, but just incase we copy it all
cp -r resources buildinfo launchpad/
sed s/#{RC_VERSION}/$RC_VERSION/ snapcraft.yaml > launchpad/snapcraft.yaml
sed s/#{RC_VERSION}/$RC_VERSION/ resources/prepareRocketChat > launchpad/resources/prepareRocketChat

cd launchpad
git add resources snapcraft.yaml buildinfo
Expand Down
18 changes: 18 additions & 0 deletions .snapcraft/resources/prepareRocketChat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

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

tar xvf rocket.chat.tgz --strip 1

cd programs/server

npm install

# 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" ]]
then
cp -r npm/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc npm/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-unknown
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
6 changes: 2 additions & 4 deletions .snapcraft/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@ parts:
build-packages:
- curl
plugin: dump
prepare: curl -SLf "https://releases.rocket.chat/#{RC_VERSION}/download/" -o rocket.chat.tgz; tar xvf rocket.chat.tgz --strip 1; cd programs/server; npm install; npm install grpc@1.6.6;
prepare: ./resources/prepareRocketChat
after: [node]
source: .
stage-packages:
- graphicsmagick
- execstack
stage:
- programs
- main.js
- .node_version.txt
- usr
- lib
mongodb:
build-packages:
- wget
Expand Down

0 comments on commit 93b2be7

Please sign in to comment.