forked from marcelamelara/private-data-objects
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the tinyscheme source to build the gipsy development interpreter. (…
…hyperledger-labs#189) We have required three separate tinyscheme packages, one for gipsy inside the enclave, one source install to build pcontract.so and one for contract development outside the enclave. This update uses the source install to build a scheme package that can be used for development out of the enclave. A script (gipsyscheme) invokes the scheme interpreter with the appropriate parameters & load files to mimic (as closely as possible) the environment inside an enclave. Signed-off-by: Mic Bowman <[email protected]>
- Loading branch information
1 parent
c3c6c5b
commit aa83e40
Showing
13 changed files
with
380 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2018 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This script performs several tests on the environment to ensure | ||
# that it is set up correctly. It should be run prior to building | ||
|
||
# ----------------------------------------------------------------- | ||
# ----------------------------------------------------------------- | ||
cred=`tput setaf 1` | ||
cgrn=`tput setaf 2` | ||
cblu=`tput setaf 4` | ||
cmag=`tput setaf 5` | ||
cwht=`tput setaf 7` | ||
cbld=`tput bold` | ||
bred=`tput setab 1` | ||
bgrn=`tput setab 2` | ||
bblu=`tput setab 4` | ||
bwht=`tput setab 7` | ||
crst=`tput sgr0` | ||
|
||
function recho () { | ||
echo "${cbld}${cred}" $@ "${crst}" >&2 | ||
} | ||
|
||
function becho () { | ||
echo "${cbld}${cblu}" $@ "${crst}" >&2 | ||
} | ||
|
||
function say () { | ||
echo "$(basename $0): $*" >&2; | ||
} | ||
|
||
function yell () { | ||
becho "$(basename $0): $*" >&2; | ||
} | ||
|
||
function die() { | ||
recho "$(basename $0): $*" >&2 | ||
exit 111 | ||
} | ||
|
||
: "${TINY_SCHEME_SRC:-$(die Missing environment variable TINY_SCHEME_SRC)}" | ||
|
||
INIT_FILE=$(mktemp /tmp/pdo-init.XXXXXXXXX) | ||
function cleanup { | ||
rm -f ${INIT_FILE} | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
SCRIPT_DIR="$(dirname $(readlink --canonicalize ${BASH_SOURCE}))" | ||
PDO_SOURCE_ROOT="$(realpath ${SCRIPT_DIR}/../..)" | ||
|
||
EXTENSION_PATH=${PDO_SOURCE_ROOT}/common/build | ||
if [ ! -f ${EXTENSION_PATH}/pcontract.so ]; then | ||
die unable to locate pcontract.so, please build first | ||
fi | ||
|
||
GIPSY_INIT_FILE=${PDO_SOURCE_ROOT}/contracts/packages/init.scm | ||
if [ ! -f ${GIPSY_INIT_FILE} ]; then | ||
die unable to locate gipsy init file | ||
fi | ||
|
||
GIPSY_PACKAGE_DIR=${PDO_SOURCE_ROOT}/common/interpreter/gipsy_scheme/packages/ | ||
sed "s@PACKAGE_DIRECTORY@${GIPSY_PACKAGE_DIR}@" ${GIPSY_INIT_FILE} > ${INIT_FILE} | ||
|
||
LD_LIBRARY_PATH=${EXTENSION_PATH} TINYSCHEMEINIT=${INIT_FILE} ${TINY_SCHEME_SRC}/scheme $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.