Skip to content

Commit

Permalink
Merge branch 'tomas/update-toolchain-follow-up' (#3820)
Browse files Browse the repository at this point in the history
* tomas/update-toolchain-follow-up:
  tests: use `extern "C-unwind"` in native host fns to unwind panics
  ci: rm threads rustflag
  make fmt
  • Loading branch information
tzemanovic committed Sep 14, 2024
2 parents 463d282 + 7792418 commit f7830f6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ jobs:
run: make test-unit-with-coverage
# run: cargo +${{ env.NIGHTLY }} llvm-cov nextest run -E 'not test(e2e)' -E 'not test(integration)' -E 'not test(pos_state_machine_test)' --features namada/testing --no-fail-fast --lcov --output-path lcov.info
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold -Z threads=8"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Store coverage file artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -392,7 +392,7 @@ jobs:
run: make test-integration-with-coverage
# run: cargo +${{ env.NIGHTLY }} nextest run -E 'test(integration)' --test-threads 1 --no-fail-fast
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold -Z threads=8"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Store coverage file artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -451,7 +451,7 @@ jobs:
- name: Run benchmarks tests
run: make test-benches
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold -Z threads=8"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Clean cargo cache
if: steps.cache.outputs.cache-hit != 'true'
run: cargo cache --autoclean-expensive
Expand Down
10 changes: 8 additions & 2 deletions crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ pub const DEFAULT_GAS_LIMIT: u64 = 200_000;
/// An interface for high-level interaction with the Namada SDK
#[cfg_attr(feature = "async-send", async_trait::async_trait)]
#[cfg_attr(not(feature = "async-send"), async_trait::async_trait(?Send))]
#[rustversion::attr(nightly, allow(elided_named_lifetimes, reason = "Not actually named"))]
#[rustversion::attr(
nightly,
allow(elided_named_lifetimes, reason = "Not actually named")
)]
pub trait Namada: NamadaIo {
/// Captures the interactive parts of the wallet's functioning
type WalletUtils: WalletIo + WalletStorage + MaybeSend + MaybeSync;
Expand Down Expand Up @@ -776,7 +779,10 @@ where

#[cfg_attr(feature = "async-send", async_trait::async_trait)]
#[cfg_attr(not(feature = "async-send"), async_trait::async_trait(?Send))]
#[rustversion::attr(nightly, allow(elided_named_lifetimes, reason = "Not actually named"))]
#[rustversion::attr(
nightly,
allow(elided_named_lifetimes, reason = "Not actually named")
)]
impl<C, U, V, I> Namada for NamadaImpl<C, U, V, I>
where
C: Client + MaybeSend + Sync,
Expand Down
6 changes: 3 additions & 3 deletions crates/tests/src/vm_host_env/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ mod native_tx_host_env {
( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) ) => {
concat_idents!(extern_fn_name = namada, _, $fn {
#[no_mangle]
extern "C" fn extern_fn_name( $($arg: $type),* ) {
extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) {
with(|TestTxEnv {
state,
iterators,
Expand Down Expand Up @@ -384,7 +384,7 @@ mod native_tx_host_env {
( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) -> $ret:ty ) => {
concat_idents!(extern_fn_name = namada, _, $fn {
#[no_mangle]
extern "C" fn extern_fn_name( $($arg: $type),* ) -> $ret {
extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) -> $ret {
with(|TestTxEnv {
tx_index,
state,
Expand Down Expand Up @@ -429,7 +429,7 @@ mod native_tx_host_env {
( "non-result", $fn:ident ( $($arg:ident : $type:ty),* $(,)?) ) => {
concat_idents!(extern_fn_name = namada, _, $fn {
#[no_mangle]
extern "C" fn extern_fn_name( $($arg: $type),* ) {
extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) {
with(|TestTxEnv {
state,
iterators,
Expand Down
4 changes: 2 additions & 2 deletions crates/tests/src/vm_host_env/vp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ mod native_vp_host_env {
( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) ) => {
concat_idents!(extern_fn_name = namada, _, $fn {
#[no_mangle]
extern "C" fn extern_fn_name( $($arg: $type),* ) {
extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) {
with(|TestVpEnv {
addr,
state,
Expand Down Expand Up @@ -271,7 +271,7 @@ mod native_vp_host_env {
( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) -> $ret:ty ) => {
concat_idents!(extern_fn_name = namada, _, $fn {
#[no_mangle]
extern "C" fn extern_fn_name( $($arg: $type),* ) -> $ret {
extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) -> $ret {
with(|TestVpEnv {
addr,
state,
Expand Down

0 comments on commit f7830f6

Please sign in to comment.