Skip to content

Commit

Permalink
[Runtime] Break running from repo
Browse files Browse the repository at this point in the history
This is unsupported and as of now broken for anything other than
Linux-SGX. Let's leave the error message for some time for people to
notice.

Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
  • Loading branch information
woju committed Jun 8, 2021
1 parent 6b840c0 commit db5a444
Showing 1 changed file with 12 additions and 58 deletions.
70 changes: 12 additions & 58 deletions Runtime/pal_loader
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-3.0-or-later */
# Copyright (C) 2014 Stony Brook University
# Copyright (C) 2019 Invisible Things Lab
# Copyright (C) 2020 Intel Corporation
# Michał Kowalczyk <mkow@invisiblethingslab.com>
# Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2014 Stony Brook University
# Copyright (C) 2019 Invisible Things Lab
# Copyright (C) 2020-2021 Intel Corporation
# Michał Kowalczyk <mkow@invisiblethingslab.com>
# Wojtek Porczyk <woju@invisiblethingslab.com>


# This is how we detect whether we're installed or running from inside git repo.
Expand All @@ -17,62 +17,16 @@ IN_GIT=@IN_GIT@

if test -n "$IN_GIT"
then
echo >&2
echo "WARNING: Running from repository is untested and unsupported." >&2
echo "Please install Graphene using Meson." >&2
echo "Running from repository is broken. Please install Graphene using Meson." >&2
echo "See https://graphene.readthedocs.io/en/latest/building.html for details." >&2
echo >&2

while :
do
case "$1" in
"SGX")
SGX=1
export SGX
;;
"GDB")
GDB=1
;;
*)
break
;;
esac
shift
done

RUNTIME_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
if [ -z "$PAL_HOST" ]; then
if ! command -v make >/dev/null; then
libpal="$RUNTIME_DIR/libpal-*.so"
libpal="$(echo -n "$libpal")"
libpal="${libpal//$RUNTIME_DIR\//}"
if [ "$libpal" = 'libpal-*.so' ]; then
echo "Unable to detect PAL_HOST. Please install the make program."
exit 1
fi

array=("$libpal")
if [ ${#array[@]} -ne 1 ]; then
echo "Multiple libpal detected ($libpal). Please explicitly set the environment variable PAL_HOST."
exit 1
fi

PAL_HOST="${libpal%.so}"
PAL_HOST="${PAL_HOST#libpal-}"
else
PAL_HOST=$(make --no-print-directory --quiet -f "$RUNTIME_DIR/../Scripts/Makefile.configs" print_host 2>&1)
fi
fi
PAL_CMD="$RUNTIME_DIR/pal-$PAL_HOST"
LIBPAL_PATH=$(realpath "$RUNTIME_DIR/libpal-$PAL_HOST.so")
HOST_PAL_PATH=$(realpath "$RUNTIME_DIR/../Pal/src/host/$PAL_HOST")
else
PAL_CMD=@PAL_CMD@
LIBPAL_PATH=@LIBPAL_PATH@
HOST_PAL_PATH=@HOST_PAL_PATH@
SGX=@SGX@
exit 1
fi

PAL_CMD=@PAL_CMD@
LIBPAL_PATH=@LIBPAL_PATH@
HOST_PAL_PATH=@HOST_PAL_PATH@
SGX=@SGX@

APPLICATION=
ENVS=()
PREFIX=()
Expand Down

0 comments on commit db5a444

Please sign in to comment.