Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Plume front arm support #402

Merged
merged 7 commits into from
Dec 31, 2018
Merged
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
make \
openssl \
libssl-dev
WORKDIR /scratch
COPY script/wasm-deps.sh .
RUN chmod a+x ./wasm-deps.sh && ./wasm-deps.sh
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY Cargo.toml Cargo.lock rust-toolchain ./
RUN cargo install diesel_cli --no-default-features --features postgres --version '=1.3.0'
RUN cargo install cargo-web
COPY . .
RUN cargo web deploy -p plume-front
RUN chmod a+x ./script/plume-front.sh && ./script/plume-front.sh
RUN cargo install --path ./ --force --no-default-features --features postgres
RUN cargo install --path plume-cli --force --no-default-features --features postgres
RUN cargo clean
Expand Down
11 changes: 11 additions & 0 deletions script/plume-front.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

ARCH=`arch`

if [ "$ARCH" == "aarch64" -o "$ARCH" == "armv7l" ] ; then
export PATH=/opt/local/llvm/bin:${PATH}
cd /app
RUSTFLAGS="-C linker=lld" cargo web deploy -p plume-front
else
cargo web deploy -p plume-front
fi
33 changes: 33 additions & 0 deletions script/wasm-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

ARCH=`arch`

if [ "$ARCH" == "aarch64" -o "$ARCH" == "armv7l" ] ; then
apt-get install -y --no-install-recommends build-essential subversion ninja-build cmake
mkdir -p /scratch/src
cd /scratch/src
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd /scratch/src/llvm/tools
svn co http://llvm.org/svn/llvm-project/lld/trunk lld
#svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
#svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
mkdir -p /scratch/build/arm
cd /scratch/build/arm
if [ "$ARCH" == "aarch64" ] ; then
cmake -G Ninja /scratch/src/llvm \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/local/llvm \
-DLLVM_TARGETS_TO_BUILD="AArch64" \
-DLLVM_TARGET_ARCH="AArch64"
else
cmake -G Ninja /scratch/src/llvm \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/local/llvm \
-DLLVM_TARGETS_TO_BUILD="ARM" \
-DLLVM_TARGET_ARCH="ARM"
fi
ninja lld
ninja install-lld
cd ~
rm -rf /scratch
fi