-
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.
207 test tarball runner + tweak rpc client logging (#242)
- [X] Tweaks to `rpc-client`: * use `MonadLogger` and a log-level option * cancel the request in flight if the user interrupts the program (by `^C` or sending `SIGINT`) - [x] unpack and use all `rpc_*` directories, with their respective path - [x] Add a regression test for running a tarball. Fixes #207 --------- Co-authored-by: Sam Balco <goodlyrottenapple@gmail.com>
- Loading branch information
1 parent
0251d2d
commit 662476c
Showing
8 changed files
with
417 additions
and
124 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
48 changes: 48 additions & 0 deletions
48
test/rpc-integration/resources/foundry-bug-report.tar.gz.kompile
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,48 @@ | ||
set -eux | ||
|
||
SCRIPT_DIR=$(dirname $0) | ||
PLUGIN_DIR=${PLUGIN_DIR:-""} | ||
NIX_LIBS=${NIX_LIBS:-""} | ||
|
||
|
||
if [ -z "$PLUGIN_DIR" ]; then | ||
echo "PLUGIN_DIR required to link in a crypto plugin dependency" | ||
exit 1 | ||
else | ||
for lib in libff libcryptopp libsecp256k1; do | ||
LIBFILE=$(find ${PLUGIN_DIR} -name "${lib}.a" | head -1) | ||
[ -z "$LIBFILE" ] && (echo "[Error] Unable to locate ${lib}.a"; exit 1) | ||
PLUGIN_LIBS+="$LIBFILE " | ||
PLUGIN_INCLUDE+="-I$(dirname $LIBFILE)/../include " | ||
done | ||
#PLUGIN_CPP=$(find ${PLUGIN_DIR}/plugin-c -name "*.cpp") | ||
PLUGIN_CPP="${PLUGIN_DIR}/include/plugin-c/blake2.cpp ${PLUGIN_DIR}/include/plugin-c/crypto.cpp ${PLUGIN_DIR}/include/plugin-c/plugin_util.cpp" | ||
fi | ||
|
||
NAME=$(basename ${0%.tar.gz.kompile}) | ||
NAMETGZ=$(basename ${0%.kompile}) | ||
|
||
# unpack definition.kore and llvm_definition from tarball | ||
# into a directory named after the tarball | ||
cd $SCRIPT_DIR | ||
mkdir -p $NAME | ||
tar xzf ../test-$NAMETGZ -C $NAME definition.kore llvm_definition/ | ||
|
||
# provide definition | ||
cp $NAME/definition.kore ${NAMETGZ}.kore | ||
|
||
# kompile llvm-definition to interpreter | ||
|
||
case "$OSTYPE" in | ||
linux*) LPROCPS="-lprocps" ;; | ||
*) LPROCPS="" ;; | ||
esac | ||
|
||
llvm-kompile $NAME/llvm_definition/definition.kore $NAME/llvm_definition/dt c -- \ | ||
-fPIC -std=c++17 -o interpreter \ | ||
$PLUGIN_LIBS $PLUGIN_INCLUDE $PLUGIN_CPP \ | ||
-lcrypto -lssl $LPROCPS | ||
mv interpreter.* $NAMETGZ.dylib | ||
|
||
# remove temporary artefacts | ||
rm -r $NAME |
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
Binary file not shown.
Oops, something went wrong.