-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'main' into 11-07-update-sns-aggregator
Showing
6 changed files
with
77 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Installs binstall' | ||
description: | | ||
Installs `cargo binstall` at the version specified in `bin/versions.bash` | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install binstall | ||
shell: bash | ||
run: | | ||
. bin/versions.bash | ||
curl -L --proto '=https' --tlsv1.2 -sSf "https://github.com/cargo-bins/cargo-binstall/releases/download/v${BINSTALL_VERSION}/cargo-binstall-x86_64-unknown-linux-musl.tgz" | tar -xvzf - | ||
./cargo-binstall -y --force "cargo-binstall@$BINSTALL_VERSION" |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
SOURCE_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | ||
PATH="$SOURCE_DIR:$PATH" | ||
|
||
print_help() { | ||
cat <<-EOF | ||
Polyfill for the now outdated wasm-nm. | ||
Supports only: | ||
wasm-nm -e SOMEFILE.wasm | ||
wasm-nm -e -j SOMEFILE.wasm | ||
Note: ic-wasm now provides much the same information, but not in a very machine-readable format. | ||
EOF | ||
} | ||
|
||
# Source the clap.bash file --------------------------------------------------- | ||
source "$SOURCE_DIR/clap.bash" | ||
# Define options | ||
clap.define short=e long=export desc="Display only export symbols." variable=ONLY_EXPORT nargs=0 | ||
clap.define short=j long=export desc="Just display the symbol names (no type)." variable=NO_TYPE nargs=0 | ||
# Source the output file ---------------------------------------------------------- | ||
source "$(clap.build)" | ||
|
||
(($# == 1)) || { | ||
echo "ERROR: Please provide the Wasm filename as a positional argument, like this:" | ||
echo " wasm-nm -e my-file.wasm" | ||
exit 1 | ||
} >&2 | ||
|
||
WASM_FILENAME="${1:-}" | ||
|
||
export_symbols() { | ||
ic-wasm "${WASM_FILENAME:-}" info | sed -nE '/^Exported methods:/,/^]/p' | sed '1d;$d' | sed -E 's/.*"(.*)",/\1/;s/ *\(.*//g' | { | ||
if [[ "${NO_TYPE:-}" == "true" ]]; then | ||
cat | ||
else | ||
sed 's/^/e /g' | ||
fi | ||
} | ||
} | ||
|
||
if [[ "${ONLY_EXPORT}" == "true" ]]; then | ||
export_symbols | ||
else | ||
{ | ||
echo "ERROR: Action not supported, sorry." | ||
exit 1 | ||
} >&2 | ||
fi |