Skip to content

Commit 17bd71a

Browse files
committed
fixup
1 parent 672bfd8 commit 17bd71a

File tree

5 files changed

+40
-7
lines changed

5 files changed

+40
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,35 @@ jobs:
136136
- uses: actions/checkout@v5
137137
- run: pip install --user codespell[toml]
138138
- run: codespell --ignore-words-list=ans,atmost,crate,inout,ratatui,ser,stayin,swarmin,worl --skip=CHANGELOG.md
139+
140+
wasm_build_and_test:
141+
name: Build & test wasm32
142+
runs-on: ubuntu-latest
143+
env:
144+
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
145+
steps:
146+
- name: Checkout sources
147+
uses: actions/checkout@v4
148+
149+
- name: Install Node.js
150+
uses: actions/setup-node@v4
151+
with:
152+
node-version: 22
153+
154+
- name: Install stable toolchain
155+
uses: dtolnay/rust-toolchain@stable
156+
157+
- name: Add wasm target
158+
run: rustup target add wasm32-unknown-unknown
159+
160+
- name: Install wasm-tools
161+
uses: bytecodealliance/actions/wasm-tools/setup@v1
162+
163+
- name: wasm32 build
164+
run: cargo build --target wasm32-unknown-unknown
165+
166+
# If the Wasm file contains any 'import "env"' declarations, then
167+
# some non-Wasm-compatible code made it into the final code.
168+
- name: Ensure no 'import "env"' in wasm
169+
run: |
170+
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/n0_error.wasm | grep 'import "env"'

.github/workflows/commit.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches: [main]
66
types: [opened, edited, synchronize]
77

8-
env:
9-
IROH_FORCE_STAGING_RELAYS: "1"
10-
118
jobs:
129
check-for-cc:
1310
runs-on: ubuntu-latest

.github/workflows/tests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ env:
2424
RUSTDOCFLAGS: -Dwarnings
2525
SCCACHE_CACHE_SIZE: "50G"
2626
CRATES_LIST: "n0-error"
27-
IROH_FORCE_STAGING_RELAYS: "1"
2827

2928
jobs:
3029
build_and_test_nix:

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ spez = "0.1.2"
1212
[dev-dependencies]
1313
anyhow = "1"
1414

15+
[profile.dev-ci]
16+
inherits = 'dev'
17+
opt-level = 1
18+
1519
[features]
1620
default = ["anyhow"]
1721
anyhow = ["dep:anyhow"]

src/macros.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ pub use spez as __spez;
3434
///
3535
/// - `anyerr!("msg")` creates an error with just a message.
3636
/// - `anyerr!("this failed at {a} with {}", b)` creates an error with a formatted message
37-
/// - `anyerr!(value)` converts any `impl StackError`, `impl std::error::Error`, or `impl Display` into [`AnyError`].
38-
/// - `anyerr!(value, "context string") works as above, but adds "context string" as [`context`](Anyerr::context).
39-
/// - `anyerr!(value, "context {}", foo) works as above, but with a formatted string as context
37+
/// - `anyerr!(value)` converts any [`impl StackError`], `impl std::error::Error`, or `impl Display` into [`AnyError`].
38+
/// - `anyerr!(value, "context")` works as above and then adds context via [`AnyError::context`].
39+
/// - `anyerr!(value, "context {}", foo)` works as above, but with a formatted string as context
4040
///
4141
/// The forms that take `value` use *autoref specialization* to keep the most details possible:
4242
/// if given a [`StackError`] it uses [`AnyError::from_stack`], if given a std error, uses [`AnyError::from_std`],
@@ -48,6 +48,7 @@ pub use spez as __spez;
4848
/// [`AnyError::from_std`]: crate::AnyError::from_std
4949
/// [`AnyError`]: crate::AnyError
5050
/// [`StackError`]: crate::StackError
51+
/// [`impl StackError`]: crate::StackError
5152
#[macro_export]
5253
macro_rules! anyerr {
5354
($fmt:literal$(, $($arg:expr),* $(,)?)?) => {

0 commit comments

Comments
 (0)