From 4aeca02ff521c952f6d44d226c2e50ecfdc8c7e2 Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Mon, 5 Mar 2018 16:09:15 -0600 Subject: [PATCH 1/2] Remove execstack from sharp, and bypass grpc error --- .circleci/snap.sh | 1 + .snapcraft/resources/prepareRocketChat | 17 +++++++++++++++++ .snapcraft/snapcraft.yaml | 6 ++---- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100755 .snapcraft/resources/prepareRocketChat diff --git a/.circleci/snap.sh b/.circleci/snap.sh index cd733d85209ee..38850daa19381 100644 --- a/.circleci/snap.sh +++ b/.circleci/snap.sh @@ -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 diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat new file mode 100755 index 0000000000000..7464115c38d75 --- /dev/null +++ b/.snapcraft/resources/prepareRocketChat @@ -0,0 +1,17 @@ +#!/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 + +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 \ No newline at end of file diff --git a/.snapcraft/snapcraft.yaml b/.snapcraft/snapcraft.yaml index 5674b4764bee9..df80e0ed5069b 100644 --- a/.snapcraft/snapcraft.yaml +++ b/.snapcraft/snapcraft.yaml @@ -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 From 555993e0c0818060d2b9f2586c2c82899008283a Mon Sep 17 00:00:00 2001 From: Aaron Ogle Date: Tue, 6 Mar 2018 11:46:52 -0600 Subject: [PATCH 2/2] add comment explaining things --- .snapcraft/resources/prepareRocketChat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index 7464115c38d75..882998b9f82a8 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -8,10 +8,11 @@ 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 \ No newline at end of file +execstack --clear-execstack npm/node_modules/sharp/vendor/lib/librsvg-2.so.2.42.0