From add94552f8f29a9718acf311fe1a9a8b486c30bd Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Wed, 17 Apr 2024 09:39:23 +0200 Subject: [PATCH 1/5] chore: gzip wasm --- .github/workflows/e2e.yaml | 2 +- dfx.json | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index eb83e04..9771f0e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -62,7 +62,7 @@ jobs: - name: Run e2e tests vs dfx ${{ matrix.dfx }} run: | - export DFX_WALLET_WASM=$GITHUB_WORKSPACE/target/wasm32-unknown-unknown/release/wallet-opt.wasm + export DFX_WALLET_WASM=$GITHUB_WORKSPACE/.dfx/local/canisters/wallet/wallet.wasm.gz export assets=$GITHUB_WORKSPACE/e2e/assets bats e2e/bash/*.bash diff --git a/dfx.json b/dfx.json index e4d947c..6901dcf 100644 --- a/dfx.json +++ b/dfx.json @@ -5,6 +5,7 @@ "candid": "wallet/src/lib.did", "type": "custom", "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm", + "gzip": true, "declarations": { "output": "wallet_ui/declarations/wallet" } @@ -14,14 +15,16 @@ "dependencies": ["wallet"], "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm" + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm", + "gzip": true }, "bob": { "build": "true", "dependencies": ["wallet"], "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm" + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm", + "gzip": true } }, "version": 1 From a791dd055b2214e279b8b5d768555160a0fa0300 Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Wed, 17 Apr 2024 09:53:26 +0200 Subject: [PATCH 2/5] print .dfx content --- .github/workflows/e2e.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 9771f0e..0c3d420 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -59,6 +59,7 @@ jobs: dfx canister create wallet dfx build wallet dfx stop + find .dfx/local - name: Run e2e tests vs dfx ${{ matrix.dfx }} run: | From 89b38c000dbe9b45bda116a2ff0e8b3c60a3e8a7 Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Wed, 17 Apr 2024 09:59:35 +0200 Subject: [PATCH 3/5] dfx too old to know "shrink": true --- .github/workflows/e2e.yaml | 3 +-- dfx.json | 9 +++------ wallet/build.sh | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 0c3d420..038ae02 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -59,11 +59,10 @@ jobs: dfx canister create wallet dfx build wallet dfx stop - find .dfx/local - name: Run e2e tests vs dfx ${{ matrix.dfx }} run: | - export DFX_WALLET_WASM=$GITHUB_WORKSPACE/.dfx/local/canisters/wallet/wallet.wasm.gz + export DFX_WALLET_WASM=$GITHUB_WORKSPACE/target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz export assets=$GITHUB_WORKSPACE/e2e/assets bats e2e/bash/*.bash diff --git a/dfx.json b/dfx.json index 6901dcf..389a07e 100644 --- a/dfx.json +++ b/dfx.json @@ -4,8 +4,7 @@ "build": "wallet/build.sh", "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm", - "gzip": true, + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz", "declarations": { "output": "wallet_ui/declarations/wallet" } @@ -15,16 +14,14 @@ "dependencies": ["wallet"], "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm", - "gzip": true + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz" }, "bob": { "build": "true", "dependencies": ["wallet"], "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm", - "gzip": true + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz" } }, "version": 1 diff --git a/wallet/build.sh b/wallet/build.sh index 76ffe5d..96ff2b2 100755 --- a/wallet/build.sh +++ b/wallet/build.sh @@ -23,6 +23,7 @@ if [ "$STATUS" -eq "0" ]; then target/wasm32-unknown-unknown/release/wallet.wasm \ -o target/wasm32-unknown-unknown/release/wallet-opt.wasm \ shrink + gzip -nk target/wasm32-unknown-unknown/release/wallet-opt.wasm true else From ecfda5e16365e4fd2b26d6541796b35585538e44 Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Wed, 17 Apr 2024 10:04:12 +0200 Subject: [PATCH 4/5] also doesnt read gzipped wasm... --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 038ae02..eb83e04 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -62,7 +62,7 @@ jobs: - name: Run e2e tests vs dfx ${{ matrix.dfx }} run: | - export DFX_WALLET_WASM=$GITHUB_WORKSPACE/target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz + export DFX_WALLET_WASM=$GITHUB_WORKSPACE/target/wasm32-unknown-unknown/release/wallet-opt.wasm export assets=$GITHUB_WORKSPACE/e2e/assets bats e2e/bash/*.bash From 7155d21aec00c8b333064191d73e99c0998fd675 Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Wed, 17 Apr 2024 10:23:55 +0200 Subject: [PATCH 5/5] saving a file before committing is a good idea --- dfx.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dfx.json b/dfx.json index 389a07e..e4d947c 100644 --- a/dfx.json +++ b/dfx.json @@ -4,7 +4,7 @@ "build": "wallet/build.sh", "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz", + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm", "declarations": { "output": "wallet_ui/declarations/wallet" } @@ -14,14 +14,14 @@ "dependencies": ["wallet"], "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz" + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm" }, "bob": { "build": "true", "dependencies": ["wallet"], "candid": "wallet/src/lib.did", "type": "custom", - "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm.gz" + "wasm": "target/wasm32-unknown-unknown/release/wallet-opt.wasm" } }, "version": 1