Skip to content

Commit 8ee818e

Browse files
marc0oloclaude
andcommitted
fix(ci): remove sudo from provision-linux.sh, guard candid-extractor, fix lint
- Remove sudo from provision-linux.sh rustup install so cargo lands in the runner user's PATH (same fix already applied to provision-frontend-linux.sh) - Guard all gen_bindings.sh scripts behind `command -v candid-extractor` to prevent bash from truncating the static .did file via shell redirection when candid-extractor is absent but the WASM build cache is present - Fix 4 prettier/eslint violations in password_manager frontend: - NewPassword.svelte: break long disabled attribute across lines - Vault.svelte: remove unnecessary @ts-ignore (svelte-icons types resolve fine) - encrypted_maps.ts: inline canisterEnv lookup onto one line - auth.ts: wrap long expirationMs expression Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8d2d7f5 commit 8ee818e

12 files changed

Lines changed: 37 additions & 20 deletions

File tree

.github/workflows/provision-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm ic-mops
1010

1111
# Install rust
1212
wget --output-document install-rustup.sh "https://sh.rustup.rs"
13-
sudo bash install-rustup.sh -y
13+
bash install-rustup.sh -y
1414
rustup target add wasm32-unknown-unknown
1515

1616
# Set environment variables.

examples/basic_bls_signing/frontend/scripts/gen_bindings.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
# Bindings are always generated from the Rust backend since both backends
44
# expose the same Candid interface.
5-
cd ../../rust/backend && make extract-candid
6-
7-
cd ../..
5+
if command -v candid-extractor >/dev/null 2>&1; then
6+
cd ../../rust/backend && make extract-candid
7+
cd ../..
8+
else
9+
cd ../..
10+
fi
811

912
rm -rf frontend/src/declarations/basic_bls_signing
1013

examples/basic_ibe/frontend/scripts/gen_bindings.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/bash
22

3-
cd ../../rust/backend && make extract-candid
4-
5-
cd ../..
3+
if command -v candid-extractor >/dev/null 2>&1; then
4+
cd ../../rust/backend && make extract-candid
5+
cd ../..
6+
else
7+
cd ../..
8+
fi
69

710
rm -rf frontend/src/declarations/basic_ibe
811

examples/basic_timelock_ibe/frontend/scripts/gen_bindings.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/bash
22

3-
cd ../../backend && make extract-candid
4-
5-
cd ..
3+
if command -v candid-extractor >/dev/null 2>&1; then
4+
cd ../../backend && make extract-candid
5+
cd ..
6+
else
7+
cd ..
8+
fi
69

710
rm -rf frontend/src/declarations/basic_timelock_ibe
811

examples/encrypted_chat/frontend/scripts/gen_bindings.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
# Resolve the physical path of this script so that navigating up works
66
# correctly even when frontend/ is reached via a symlink (e.g. motoko/frontend).
77
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd -P)
8-
cd "$SCRIPT_DIR/../../rust/backend" && make extract-candid
8+
if command -v candid-extractor >/dev/null 2>&1; then
9+
cd "$SCRIPT_DIR/../../rust/backend" && make extract-candid
10+
fi
911

1012
cd "$SCRIPT_DIR/../.."
1113
rm -rf frontend/src/declarations/encrypted_chat

examples/encrypted_notes_dapp_vetkd/frontend/scripts/gen_bindings.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# Resolve the physical path of this script so that navigating up works
77
# correctly even when frontend/ is reached via a symlink (e.g. motoko/frontend).
88
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd -P)
9-
cd "$SCRIPT_DIR/../../rust/backend" && make extract-candid
9+
if command -v candid-extractor >/dev/null 2>&1; then
10+
cd "$SCRIPT_DIR/../../rust/backend" && make extract-candid
11+
fi
1012

1113
cd "$SCRIPT_DIR/../.."
1214

examples/password_manager/frontend/scripts/gen_bindings.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
# Resolve the physical path of this script so that navigating up works
66
# correctly even when frontend/ is reached via a symlink (e.g. motoko/frontend).
77
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd -P)
8-
cd "$SCRIPT_DIR/../../rust/backend" && make extract-candid
8+
if command -v candid-extractor >/dev/null 2>&1; then
9+
cd "$SCRIPT_DIR/../../rust/backend" && make extract-candid
10+
fi
911

1012
cd "$SCRIPT_DIR/../.."
1113
rm -rf frontend/src/declarations/ic_vetkeys_encrypted_maps_canister

examples/password_manager/frontend/src/components/NewPassword.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@
110110
<PasswordEditor {editor} class="mb-3" disabled={creating} />
111111
<button
112112
class="btn mt-6 btn-primary {creating ? 'loading' : ''}"
113-
disabled={creating || vaultName.trim() === "" || passwordName.trim() === ""}
113+
disabled={creating ||
114+
vaultName.trim() === "" ||
115+
passwordName.trim() === ""}
114116
on:click={add}>{creating ? "Adding..." : "Add password"}</button
115117
>
116118
</main>

examples/password_manager/frontend/src/components/Vault.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { Principal } from "@icp-sdk/core/principal";
77
import Header from "./Header.svelte";
88
import Spinner from "./Spinner.svelte";
9-
// @ts-ignore: svelte-icons have no type declarations
109
import GiOpenTreasureChest from "svelte-icons/gi/GiOpenTreasureChest.svelte";
1110
import { auth } from "../store/auth";
1211
import SharingEditor from "./SharingEditor.svelte";

examples/password_manager/frontend/src/lib/encrypted_maps.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ export async function createEncryptedMaps(
1414
agentOptions?: HttpAgentOptions,
1515
): Promise<EncryptedMaps> {
1616
const canisterId =
17-
canisterEnv?.[
18-
"PUBLIC_CANISTER_ID:ic_vetkeys_encrypted_maps_canister"
19-
];
17+
canisterEnv?.["PUBLIC_CANISTER_ID:ic_vetkeys_encrypted_maps_canister"];
2018
if (!canisterId) {
2119
throw new Error(
2220
"Canister ID for ic_vetkeys_encrypted_maps_canister is not set",

0 commit comments

Comments
 (0)