Fix Plume arm builds #427
|
|
@ -1,8 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
ARCH=`arch`
|
||||
ARCH=$(python <<EOF
|
||||
from __future__ import print_function
|
||||
yes. with great difficulty.
+1 > Wouldn't it be possible to do the same with Bash?
yes. with great difficulty.
> And maybe you could use Python
+1
@BaptisteGelez I was trying to do this in bash initally and... it ended up being easier to read and maintain with python. Re python 2/3 ; the code in question will run under both. Ubuntu and Debian still have python2 as a default and the slim docker images don't include both by default. I wanted to keep the code as generic as possible so additional dependencies won't be necessary if it's used elsewhere. @BaptisteGelez I was trying to do this in bash initally and... it ended up being easier to read and maintain with python.
Re python 2/3 ; the code in question will run under both. Ubuntu and Debian still have python2 as a default and the slim docker images don't include both by default. I wanted to keep the code as generic as possible so additional dependencies won't be necessary if it's used elsewhere.
|
||||
import platform
|
||||
processor = platform.machine()
|
||||
architecture = platform.architecture()
|
||||
if processor == 'aarch64':
|
||||
# Mutli arch arm support is why this 32bit check is present
|
||||
if '32bit' in architecture:
|
||||
print('armv71', end='')
|
||||
else:
|
||||
print('aarch64', end='')
|
||||
elif processor == 'x86 64' or processor == 'x86_64':
|
||||
print('amd64', end='')
|
||||
elif processor == 'armv7l':
|
||||
print('armhf', end='')
|
||||
EOF
|
||||
|
how big is the chance that anyone's still using i386? how big is the chance that anyone's still using i386?
@igalic the main linux kernel dev's have suggested dropping i386 support... If it's something others run into I'm happy to add it back but i need the platform.machine() output to add it to the conditional. I don't have access to i386 and didn't want to add an arch that I don't have valid output for. @igalic the main linux kernel dev's have suggested dropping i386 support...
If it's something others run into I'm happy to add it back but i need the platform.machine() output to add it to the conditional. I don't have access to i386 and didn't want to add an arch that I don't have valid output for.
|
||||
)
|
||||
|
||||
if [ "$ARCH" == "aarch64" -o "$ARCH" == "armv7l" ] ; then
|
||||
if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; then
|
||||
export PATH=/opt/local/llvm/bin:${PATH}
|
||||
cd /app
|
||||
RUSTFLAGS="-C linker=lld" cargo web deploy -p plume-front
|
||||
|
|
|
|||
|
|
@ -1,14 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
ARCH=`arch`
|
||||
ARCH=$(python <<EOF
|
||||
from __future__ import print_function
|
||||
import platform
|
||||
processor = platform.machine()
|
||||
architecture = platform.architecture()
|
||||
if processor == 'aarch64':
|
||||
# Mutli arch arm support is why this 32bit check is present
|
||||
if '32bit' in architecture:
|
||||
print('armv71', end='')
|
||||
else:
|
||||
print('aarch64', end='')
|
||||
elif processor == 'x86 64' or processor == 'x86_64':
|
||||
print('amd64', end='')
|
||||
elif processor == 'armv7l':
|
||||
print('armhf', end='')
|
||||
EOF
|
||||
)
|
||||
|
||||
if [ "$ARCH" == "aarch64" -o "$ARCH" == "armv7l" ] ; then
|
||||
echo "Detected arch: $ARCH"
|
||||
|
||||
if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; 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
|
||||
# Pin LLVM to post 7.0.1 tag and pin to a known-good revision for Plume builds
|
||||
svn co -r350977 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
|
||||
# Pin lld to post 7.0.1 tag and pin to a known-good revision for Plume builds
|
||||
svn co -r350975 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
|
||||
|
|
|
|||
Wouldn't it be possible to do the same with Bash? And maybe you could use Python 3 if it present instead of importing from
__future__.