This commit is contained in:
John Smith 2022-12-25 11:46:32 -05:00
parent e1593baabf
commit e9da652e9a
3 changed files with 27 additions and 9 deletions

View File

@ -1,6 +1,11 @@
#!/bin/bash #!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [[ "$(uname)" != "Linux" ]]; then
echo Not running Linux
exit 1
fi
if [ "$(lsb_release -d | grep -qEi 'debian|buntu|mint')" ]; then if [ "$(lsb_release -d | grep -qEi 'debian|buntu|mint')" ]; then
echo Not a supported Linux echo Not a supported Linux
exit 1 exit 1

View File

@ -167,6 +167,9 @@ class _MyAppState extends State<MyApp> with UiLoggy {
}, },
onSubmitted: (String v) async { onSubmitted: (String v) async {
try { try {
if (v.isEmpty) {
return;
}
var res = await Veilid.instance.debug(v); var res = await Veilid.instance.debug(v);
loggy.info(res); loggy.info(res);
setState(() { setState(() {

View File

@ -1,6 +1,13 @@
#!/bin/bash #!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
set -eo pipefail
get_abs_filename() {
# $1 : relative filename
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
pushd $SCRIPTDIR &> /dev/null pushd $SCRIPTDIR &> /dev/null
if [ -f /usr/local/opt/llvm/bin/llvm-dwarfdump ]; then if [ -f /usr/local/opt/llvm/bin/llvm-dwarfdump ]; then
@ -15,7 +22,15 @@ else
fi fi
if [[ "$1" == "debug" ]]; then if [[ "$1" == "release" ]]; then
OUTPUTDIR=../target/wasm32-unknown-unknown/release/pkg
INPUTDIR=../target/wasm32-unknown-unknown/release
cargo build --target wasm32-unknown-unknown --release
mkdir -p $OUTPUTDIR
wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript $INPUTDIR/veilid_wasm.wasm
wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm
else
OUTPUTDIR=../target/wasm32-unknown-unknown/debug/pkg OUTPUTDIR=../target/wasm32-unknown-unknown/debug/pkg
INPUTDIR=../target/wasm32-unknown-unknown/debug INPUTDIR=../target/wasm32-unknown-unknown/debug
@ -24,14 +39,9 @@ if [[ "$1" == "debug" ]]; then
wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript --keep-debug --debug $INPUTDIR/veilid_wasm.wasm wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript --keep-debug --debug $INPUTDIR/veilid_wasm.wasm
./wasm-sourcemap.py $OUTPUTDIR/veilid_wasm_bg.wasm -o $OUTPUTDIR/veilid_wasm_bg.wasm.map --dwarfdump $DWARFDUMP ./wasm-sourcemap.py $OUTPUTDIR/veilid_wasm_bg.wasm -o $OUTPUTDIR/veilid_wasm_bg.wasm.map --dwarfdump $DWARFDUMP
# wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm # wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm
else
OUTPUTDIR=../target/wasm32-unknown-unknown/release/pkg
INPUTDIR=../target/wasm32-unknown-unknown/release
cargo build --target wasm32-unknown-unknown --release
mkdir -p $OUTPUTDIR
wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript $INPUTDIR/veilid_wasm.wasm
wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm
fi fi
popd &> /dev/null popd &> /dev/null
# Print for use with scripts
echo SUCCESS:OUTPUTDIR=$(get_abs_filename $OUTPUTDIR)