@@ -181,6 +181,7 @@ jobs:
181181 - name : Install stable toolchain
182182 uses : dtolnay/rust-toolchain@stable
183183 with :
184+ toolchain : 1.93.0
184185 components : rustfmt, clippy
185186
186187 - name : Set up cache
@@ -192,6 +193,25 @@ jobs:
192193 - name : Run cargo clippy
193194 run : cargo clippy --workspace --tests --benches --examples -- -D warnings
194195
196+ check-no-std :
197+ name : Check no_std
198+ runs-on : ubuntu-latest
199+ steps :
200+ - name : Checkout sources
201+ uses : actions/checkout@v4
202+
203+ - name : Install stable toolchain
204+ uses : dtolnay/rust-toolchain@stable
205+
206+ - name : Add thumbv7em-none-eabi target
207+ run : rustup target add thumbv7em-none-eabi
208+
209+ - name : Set up cache
210+ uses : Swatinem/rust-cache@v2
211+
212+ - name : Run no_std cargo check for crypto/addresses
213+ run : cargo check -p kaspa-addresses --no-default-features --target thumbv7em-none-eabi
214+
195215
196216 check-wasm32 :
197217 name : Check WASM32
@@ -247,6 +267,74 @@ jobs:
247267
248268 - name : Run cargo check of kaspa-wasm for wasm32 target
249269 run : cargo clippy -p kaspa-wasm --target wasm32-unknown-unknown
270+
271+ test-wasm32 :
272+ name : Test WASM32
273+ runs-on : ubuntu-latest
274+ steps :
275+ - name : Checkout sources
276+ uses : actions/checkout@v4
277+
278+ - name : Install Protoc
279+ uses : arduino/setup-protoc@v3
280+ with :
281+ repo-token : ${{ secrets.GITHUB_TOKEN }}
282+
283+ - name : Install llvm
284+ id : install_llvm
285+ continue-on-error : true
286+ run : |
287+ wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
288+ sudo apt-get install -y clang-15 lldb-15 lld-15 clangd-15 clang-tidy-15 clang-format-15 clang-tools-15 llvm-15-dev lld-15 lldb-15 llvm-15-tools libomp-15-dev libc++-15-dev libc++abi-15-dev libclang-common-15-dev libclang-15-dev libclang-cpp15-dev libunwind-15-dev
289+ # Make Clang 15 default
290+ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-15/bin/clang++ 100
291+ sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-15/bin/clang 100
292+ sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/lib/llvm-15/bin/clang-format 100
293+ sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/lib/llvm-15/bin/clang-tidy 100
294+ sudo update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/lib/llvm-15/bin/run-clang-tidy 100
295+ # Alias cc to clang
296+ sudo update-alternatives --install /usr/bin/cc cc /usr/lib/llvm-15/bin/clang 0
297+ sudo update-alternatives --install /usr/bin/c++ c++ /usr/lib/llvm-15/bin/clang++ 0
298+
299+ - name : Install gcc-multilib
300+ # gcc-multilib allows clang to find gnu libraries properly
301+ run : |
302+ sudo apt-get update
303+ sudo apt install -y gcc-multilib
304+
305+ - name : Install stable toolchain
306+ if : steps.install_llvm.outcome == 'success' && steps.install_llvm.conclusion == 'success'
307+ uses : dtolnay/rust-toolchain@stable
308+
309+ - name : Install wasm-pack
310+ uses : taiki-e/install-action@v2
311+ with :
312+ tool : wasm-pack
313+
314+ - name : Add wasm32 target
315+ run : rustup target add wasm32-unknown-unknown
316+
317+ - name : Set up cache
318+ uses : Swatinem/rust-cache@v2
319+
320+ - name : Install Node.js
321+ uses : actions/setup-node@v6
322+ with :
323+ node-version : 20
324+
325+ - name : Install NodeJS dependencies
326+ run : npm install --global typedoc typescript
327+
328+ # append here any new crates that contains wasm test suites (and aren't already covered)
329+ - name : Run wasm tests for consensus/core
330+ run : wasm-pack test --node consensus/core
331+
332+ - name : Run wasm tests for crypto/addresses
333+ run : wasm-pack test --node crypto/addresses
334+
335+ - name : Run wasm tests for wallet/pskt
336+ run : wasm-pack test --node wallet/pskt
337+
250338
251339 build-wasm32 :
252340 name : Build WASM32 SDK
@@ -339,20 +427,15 @@ jobs:
339427 - name : Set up Rust cache
340428 uses : Swatinem/rust-cache@v2
341429
342- - name : Cache Toolchain
343- uses : actions/cache@v4
344- with :
345- path : |
346- ~/x-tools
347- key : ${{ runner.os }}-musl-${{ hashFiles('**/musl-toolchain/preset.sh') }}
348- restore-keys : |
349- ${{ runner.os }}-musl-
350-
351-
352430 - name : Build RK with musl toolchain
353431 if : runner.os == 'Linux'
354432 run : |
355433 # Run build script for musl toolchain
356434 source musl-toolchain/build.sh
357- # Build for musl
358- cargo --verbose build --bin kaspad --bin rothschild --bin kaspa-wallet --release --target x86_64-unknown-linux-musl
435+ # Build bridge with allow-multiple-definition flag to handle mimalloc conflicts with libstdc++ in musl builds
436+ # This flag is only needed for kaspa-stratum-bridge due to its dual mimalloc dependency structure
437+ export RUSTFLAGS="$RUSTFLAGS -C link-arg=-Wl,--allow-multiple-definition"
438+
439+ # Build other binaries first (without the allow-multiple-definition flag)
440+ cargo build --bin kaspad --bin rothschild --bin kaspa-wallet --bin stratum-bridge --release --target x86_64-unknown-linux-musl
441+
0 commit comments