Skip to content

Commit

Permalink
Merge client with pdo_common
Browse files Browse the repository at this point in the history
* Only include client crypto in pdo common library
* Ensure client is always built with services

Signed-off-by: Marcela Melara <[email protected]>
  • Loading branch information
marcelamelara committed May 3, 2023
1 parent f5f9e5f commit 11226fb
Show file tree
Hide file tree
Showing 38 changed files with 56 additions and 383 deletions.
64 changes: 14 additions & 50 deletions build/__tools__/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,37 @@ if [ "$NUM_CORES " == " " ]; then
NUM_CORES=4
fi

F_CLIENT='no'
CLIENT_ONLY='no'

TEMP=$(getopt -o '' --long 'client,trusted,untrusted' -n "build.sh" -- "$@")
if [ $? != 0 ] ; then echo "Usage: build.sh [--client]" >&2 ; exit 1 ; fi

eval set -- "$TEMP"
while true ; do
case "$1" in
--client) F_CLIENT="yes" ; shift 1 ;;
--client) CLIENT_ONLY="yes" ; shift 1 ;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
done
TEMP
TEMP=""

if [ ${F_CLIENT} == "yes" ]; then
if [ ${CLIENT_ONLY} == "yes" ]; then
CMAKE_ARGS="-DBUILD_CLIENT=1 -DBUILD_TRUSTED=0 -DBUILD_UNTRUSTED=0"
MAKE_ARGS="-j${NUM_CORES} BUILD_CLIENT=1"
else
CMAKE_ARGS="-DBUILD_CLIENT=0 -DBUILD_TRUSTED=1 -DBUILD_UNTRUSTED=1"
MAKE_ARGS="-j${NUM_CORES} BUILD_CLIENT=0"
CMAKE_ARGS="-DBUILD_CLIENT=1 -DBUILD_TRUSTED=1 -DBUILD_UNTRUSTED=1"
MAKE_ARGS="-j${NUM_CORES} BUILD_CLIENT=1"
fi

# -----------------------------------------------------------------
# BUILD
# -----------------------------------------------------------------

yell --------------- COMMON ---------------

# now build the rest of common
cd $SRCDIR/common

if [ ! -d build ]; then
yell create the build directory
mkdir -p build
pushd build
try cmake ${CMAKE_ARGS} ..
popd
fi

cd build
#try cmake ${CMAKE_ARGS} ..
#try make ${MAKE_ARGS}
try cmake --build . -- ${MAKE_ARGS}
try cmake -S . -B build ${CMAKE_ARGS}
try cmake --build build -- ${MAKE_ARGS}

yell --------------- BIN ---------------
cd $SRCDIR/bin
Expand All @@ -81,57 +68,34 @@ try make ${MAKE_ARGS} install

yell --------------- PYTHON ---------------
cd $SRCDIR/python

if [ ! -d build ]; then
yell create the build directory
mkdir -p build
pushd build
try cmake ${CMAKE_ARGS} ..
popd
fi

cd build
try cmake --build . -- ${MAKE_ARGS}
try cmake -S . -B build ${CMAKE_ARGS}
try cmake --build build -- ${MAKE_ARGS}

yell temporarily installing pdo as part of build
pip install dist/pdo-0.2.0-py3-none-any.whl

yell --------------- SSERVICE ---------------
cd $SRCDIR/sservice

if [ ! -d build ]; then
yell create the build directory
mkdir -p build
pushd build
try cmake ${CMAKE_ARGS} ..
popd
fi

cd build
try cmake --build . -- ${MAKE_ARGS}
try cmake -S . -B build ${CMAKE_ARGS}
try cmake --build build -- ${MAKE_ARGS}

yell temporarily installing pdo_sservice as part of build
pip install dist/pdo_sservice-0.2.0-py3-none-any.whl

yell --------------- ESERVICE ---------------
if [ ${F_CLIENT} == "no" ]; then
if [ ${CLIENT_ONLY} == "no" ]; then
cd $SRCDIR/eservice
try make ${MAKE_ARGS}
try make ${MAKE_ARGS} install
fi

yell --------------- PSERVICE ---------------
if [ ${F_CLIENT} == "no" ]; then
if [ ${CLIENT_ONLY} == "no" ]; then
cd $SRCDIR/pservice
try make ${MAKE_ARGS}
try make ${MAKE_ARGS} install
fi

yell --------------- CLIENT ---------------
cd $SRCDIR/client
try make ${MAKE_ARGS}
try make ${MAKE_ARGS} install

yell --------------- CONTRACTS ---------------
cd $SRCDIR/contracts
try make ${MAKE_ARGS} all
Expand Down
6 changes: 1 addition & 5 deletions build/__tools__/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ make clean

yell --------------- PYTHON ---------------
cd $SRCDIR/python
rm -rf build dist pdo-common.egg-info pdo/common/crypto_swig.py pdo/common/key_value_swig.py *.cxx
rm -rf build dist pdo.egg-info pdo/common/crypto.py pdo/common/key_value_swig.py *.cxx *.so

yell --------------- SSERVICE ---------------
cd $SRCDIR/sservice
Expand All @@ -53,10 +53,6 @@ rm -f contract_enclave_mrenclave.cpp
cd $SRCDIR/pservice
make clean

yell --------------- CLIENT ---------------
cd $SRCDIR/client
make clean

yell --------------- CONTRACTS ---------------
cd $SRCDIR/contracts
make clean
7 changes: 0 additions & 7 deletions client/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions client/MANIFEST

This file was deleted.

46 changes: 0 additions & 46 deletions client/Makefile

This file was deleted.

91 changes: 0 additions & 91 deletions client/docs/BUILD.md

This file was deleted.

15 changes: 0 additions & 15 deletions client/pdo/__init__.py

This file was deleted.

68 changes: 0 additions & 68 deletions client/setup.py

This file was deleted.

Loading

0 comments on commit 11226fb

Please sign in to comment.