Skip to content

Commit

Permalink
build: --keep-name-section in docker as well
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Sep 21, 2024
1 parent c6298ff commit c9b366a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,22 @@ function build_canister() {
ic-wasm \
"$CARGO_TARGET_DIR/$TARGET/release/$canister.wasm" \
-o "./$canister.wasm" \
shrink
shrink \
--keep-name-section

# adds the content of $canister.did to the `icp:public candid:service` custom section of the public metadata in the wasm
ic-wasm "$canister.wasm" -o "$canister.wasm" metadata candid:service -f "$SRC_DIR/$canister.did" -v public
ic-wasm "$canister.wasm" -o "$canister.wasm" metadata candid:service -f "$SRC_DIR/$canister.did" -v public --keep-name-section

if [ "$canister" == "satellite" ]
then
# add the type of build "stock" to the satellite. This way, we can identify whether it's the standard canister ("stock") or a custom build ("extended") of the developer.
ic-wasm "$canister.wasm" -o "$canister.wasm" metadata juno:build -d "stock" -v public
ic-wasm "$canister.wasm" -o "$canister.wasm" metadata juno:build -d "stock" -v public --keep-name-section
fi

if [ "$canister" == "satellite" ] || [ "$canister" == "console" ];
then
# indicate support for certificate version 1 and 2 in the canister metadata
ic-wasm "$canister.wasm" -o "$canister.wasm" metadata supported_certificate_versions -d "1,2" -v public
ic-wasm "$canister.wasm" -o "$canister.wasm" metadata supported_certificate_versions -d "1,2" -v public --keep-name-section
fi

gzip --no-name --force "./$canister.wasm"
Expand Down

0 comments on commit c9b366a

Please sign in to comment.