Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@stable
- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}
components: rustfmt,clippy

- name: Cache dependencies
Expand Down Expand Up @@ -77,7 +83,14 @@ jobs:
with:
go-version-file: go/idkit/go.mod

- uses: dtolnay/rust-toolchain@stable
- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -108,8 +121,14 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Cache dependencies
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -160,8 +179,14 @@ jobs:
with:
version: 9

- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Cache dependencies
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -203,10 +228,14 @@ jobs:
docker builder prune -af || true
df -h

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Cache Cargo dependencies
uses: actions/cache@v4
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,14 @@ jobs:
exit 1
fi

- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add fallback when rust-toolchain.toml is absent

This publish workflow still supports workflow_dispatch for arbitrary commit_sha values on main (validated only by ancestry), but the new yq '.toolchain.channel' rust-toolchain.toml step assumes that file exists in the checked-out ref. For any historical SHA before this commit introduced rust-toolchain.toml, this command fails and prevents dev releases that previously worked from older commits. Please add a fallback path (for example, defaulting to stable when the file is missing) or read the toolchain file from the workflow revision instead of the target ref.

Useful? React with 👍 / 👎.


- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Install wasm-pack
run: cargo install wasm-pack --locked
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/publish-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,14 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.ref }}

- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -208,8 +214,14 @@ jobs:
echo "Disk space after cleanup:"
df -h

- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,14 @@ jobs:
exit 1
fi

- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Install wasm-pack
run: cargo install wasm-pack --locked
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/publish-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,14 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.ref }}

- name: Read rust-toolchain
id: rust-version
run: echo "toolchain=$(yq '.toolchain.channel' rust-toolchain.toml)" >> $GITHUB_OUTPUT

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
toolchain: ${{ steps.rust-version.outputs.toolchain }}

- name: Setup Swift
uses: swift-actions/setup-swift@v2
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.95.0"
1 change: 1 addition & 0 deletions rust/core/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,7 @@ fn to_app_error(error: &Error) -> AppError {
/// Networking errors are network/transport-level failures where the bridge
/// never returned a meaningful response. These are safe to retry because
/// the request itself is valid — only the delivery failed.
#[cfg(feature = "ffi")]
fn is_networking_error(error: &Error) -> bool {
match error {
Error::Timeout | Error::ConnectionFailed | Error::BridgeError(_) => true,
Expand Down
3 changes: 1 addition & 2 deletions rust/core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,7 @@ impl RpContext {
#[cfg(not(target_arch = "wasm32"))]
let now = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.map(|d| d.as_secs())
.unwrap_or(0);
.map_or(0, |d| d.as_secs());

#[cfg(target_arch = "wasm32")]
let now = (js_sys::Date::now() / 1000.0) as u64;
Expand Down
Loading