Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subxt Metadata: #[no_std] compatibility #1401

Merged
merged 19 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a262766
no-std tests and porting of subxt-metadata
tadeohepperle Jan 26, 2024
8aa4bec
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
tadeohepperle Jan 26, 2024
55cfb23
update pipeline
tadeohepperle Jan 26, 2024
1b4e371
fix generate custom metadata test
tadeohepperle Jan 26, 2024
d679e95
fix cargo run command
tadeohepperle Jan 26, 2024
7954815
adjust pipeline
tadeohepperle Jan 29, 2024
fbee16d
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
tadeohepperle Jan 29, 2024
7aa6989
remove prelude from subxt-metadata
tadeohepperle Feb 1, 2024
addc4c8
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
tadeohepperle Feb 1, 2024
87200b4
revert autoformatting of Cargo.toml
tadeohepperle Feb 1, 2024
57743c3
remove alloc::format! again, still causes linker errors
tadeohepperle Feb 2, 2024
408f81e
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
tadeohepperle Feb 2, 2024
f41f090
add no-std-build for thumbv7em-none-eabi target
tadeohepperle Feb 5, 2024
ce17d82
remove std feature flag
tadeohepperle Feb 14, 2024
5d6e0d5
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
tadeohepperle Feb 14, 2024
cb0d35d
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
tadeohepperle Feb 14, 2024
d447f7c
remove libc and add small readme with test instructions
tadeohepperle Feb 14, 2024
9c8fee0
Merge branch 'master' into tadeohepperle/subxt-metadata-no-std
tadeohepperle Feb 15, 2024
1aebd91
change ci for nightly no std
tadeohepperle Feb 15, 2024
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
26 changes: 26 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,29 @@ jobs:
wasm-pack test --headless --firefox
wasm-pack test --headless --chrome
working-directory: signer/wasm-tests

no-std-tests:
name: "Test (no_std)"
runs-on: ubuntu-latest
needs: [machete, docs]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd incline to start this test after the following needs: [clippy, wasm_clippy, check, wasm_check, docs]

Copy link
Member

@niklasad1 niklasad1 Feb 15, 2024

Choose a reason for hiding this comment

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

I don't agree, this no-std check/test should be cheap and runs faster than for example clippy it's not really a test. It just checks that a binary builds without std enabled.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case, we'd need to adjust the needs: [clippy, wasm_clippy, check, wasm_check, docs] to include no-std-tests as well :D

Copy link
Member

Choose a reason for hiding this comment

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

ok, sounds good :)

timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4

# Note: needs nighly toolchain because otherwise we cannot define custom lang-items.
- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3

# Note: in `no_std` no real tests are possible, we just run a binary with some tests in it which panic upon failure.
- name: Run no_std tests
run: |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, we can use a single line syntax

cargo run
working-directory: testing/no-std-tests
42 changes: 24 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ members = [
# We exclude any crates that would depend on non mutually
# exclusive feature flags and thus can't compile with the
# workspace:
exclude = ["testing/wasm-rpc-tests", "testing/wasm-lightclient-tests", "signer/wasm-tests", "examples/wasm-example", "examples/parachain-example"]
exclude = ["testing/no-std-tests", "testing/wasm-rpc-tests", "testing/wasm-lightclient-tests", "signer/wasm-tests", "examples/wasm-example", "examples/parachain-example"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -57,16 +57,19 @@ base58 = { version = "0.2.0" }
bitvec = { version = "1", default-features = false }
blake2 = { version = "0.10.6", default-features = false }
clap = { version = "4.4.18", features = ["derive", "cargo"] }
cfg-if = "1.0.0"
Copy link
Collaborator

@lexnv lexnv Feb 15, 2024

Choose a reason for hiding this comment

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

Are we using this?

criterion = "0.4"
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false }
color-eyre = "0.6.1"
console_error_panic_hook = "0.1.7"
darling = "0.20.3"
derivative = "2.2.0"
derive_more = "0.99.17"
either = "1.9.0"
frame-metadata = { version = "16.0.0", default-features = false, features = ["current", "std"] }
frame-metadata = { version = "16.0.0", default-features = false }
futures = { version = "0.3.30", default-features = false, features = ["std"] }
getrandom = { version = "0.2", default-features = false }
hashbrown = "0.14.3"
hex = "0.4.3"
heck = "0.4.1"
impl-serde = { version = "0.4.0" }
Expand All @@ -78,7 +81,7 @@ proc-macro-error = "1.0.4"
proc-macro2 = "1.0.78"
quote = "1.0.35"
regex = "1.10.3"
scale-info = "2.10.0"
scale-info = { version = "2.10.0", default-features = false }
scale-value = "0.13.0"
scale-bits = "0.4.0"
scale-decode = "0.10.0"
Expand Down
14 changes: 10 additions & 4 deletions metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ documentation.workspace = true
homepage.workspace = true
description = "Command line utilities for checking metadata compatibility between nodes."

[features]
default = ["std"]
std = ["scale-info/std", "frame-metadata/std"]

[dependencies]
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
frame-metadata = { workspace = true }
scale-info = { workspace = true }
scale-info = { workspace = true, default-features = false }
frame-metadata = { workspace = true, default-features = false, features = ["current", "decode"] }
codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = ["derive"] }
sp-core-hashing = { workspace = true }
thiserror = { workspace = true }
hashbrown = { workspace = true }
derive_more = { workspace = true }
cfg-if = { workspace = true }

[dev-dependencies]
bitvec = { workspace = true, features = ["alloc"] }
Expand Down
19 changes: 13 additions & 6 deletions metadata/src/from_into/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,38 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.

use crate::prelude::*;
use derive_more::Display;
use string::String;

mod v14;
mod v15;

/// An error emitted if something goes wrong converting [`frame_metadata`]
/// types into [`crate::Metadata`].
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
#[derive(Debug, Display, PartialEq, Eq)]
#[non_exhaustive]
pub enum TryFromError {
/// Type missing from type registry
#[error("Type id {0} is expected but not found in the type registry")]
#[display(fmt = "Type id {_0} is expected but not found in the type registry")]
TypeNotFound(u32),
/// Type was not a variant/enum type
#[error("Type {0} was not a variant/enum type, but is expected to be one")]
#[display(fmt = "Type {_0} was not a variant/enum type, but is expected to be one")]
VariantExpected(u32),
/// An unsupported metadata version was provided.
#[error("Cannot convert v{0} metadata into Metadata type")]
#[display(fmt = "Cannot convert v{_0} metadata into Metadata type")]
UnsupportedMetadataVersion(u32),
/// Type name missing from type registry
#[error("Type name {0} is expected but not found in the type registry")]
#[display(fmt = "Type name {_0} is expected but not found in the type registry")]
TypeNameNotFound(String),
/// Invalid type path.
#[error("Type has an invalid path {0}")]
#[display(fmt = "Type has an invalid path {_0}")]
InvalidTypePath(String),
}

#[cfg(feature = "std")]
impl std::error::Error for TryFromError {}
Comment on lines +33 to +34
Copy link
Collaborator

Choose a reason for hiding this comment

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

Annoyingly, this is, I think, the only reason that you actually need an "std" feature flag at all for this crate (same is true for some of the scale-* libraries too). Can't wait for Error trait in no-std; then a bunch of crates can just be no-std by default without any feature flag!

Copy link
Member

Choose a reason for hiding this comment

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

yupp, the new error trait looked quite weird in Rust but indeed would be awesome with core::Error :)


impl From<crate::Metadata> for frame_metadata::RuntimeMetadataPrefixed {
fn from(value: crate::Metadata) -> Self {
let m: frame_metadata::v15::RuntimeMetadataV15 = value.into();
Expand Down
31 changes: 19 additions & 12 deletions metadata/src/from_into/v14.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.

use std::collections::HashMap;

use super::TryFromError;
use crate::prelude::*;
use crate::Metadata;
use borrow::ToOwned;
use fmt::Write;
use frame_metadata::{v14, v15};
use hashbrown::HashMap;
use scale_info::TypeDef;
use string::String;
use vec::Vec;

impl TryFrom<v14::RuntimeMetadataV14> for Metadata {
type Error = TryFromError;
Expand All @@ -31,27 +35,27 @@ fn v15_to_v14(mut metadata: v15::RuntimeMetadataV15) -> v14::RuntimeMetadataV14
let extrinsic_type = scale_info::Type {
path: scale_info::Path {
segments: vec![
"primitives".to_string(),
"runtime".to_string(),
"generic".to_string(),
"UncheckedExtrinsic".to_string(),
"primitives".to_owned(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is an alloc::string::ToString you can import btw :)

"runtime".to_owned(),
"generic".to_owned(),
"UncheckedExtrinsic".to_owned(),
],
},
type_params: vec![
scale_info::TypeParameter::<scale_info::form::PortableForm> {
name: "Address".to_string(),
name: "Address".to_owned(),
ty: Some(metadata.extrinsic.address_ty),
},
scale_info::TypeParameter::<scale_info::form::PortableForm> {
name: "Call".to_string(),
name: "Call".to_owned(),
ty: Some(metadata.extrinsic.call_ty),
},
scale_info::TypeParameter::<scale_info::form::PortableForm> {
name: "Signature".to_string(),
name: "Signature".to_owned(),
ty: Some(metadata.extrinsic.signature_ty),
},
scale_info::TypeParameter::<scale_info::form::PortableForm> {
name: "Extra".to_string(),
name: "Extra".to_owned(),
ty: Some(metadata.extrinsic.extra_ty),
},
],
Expand Down Expand Up @@ -342,7 +346,7 @@ fn generate_outer_enums(
let Some(last) = call_path.last_mut() else {
return Err(TryFromError::InvalidTypePath("RuntimeCall".into()));
};
*last = "RuntimeError".to_string();
*last = "RuntimeError".to_owned();
generate_outer_error_enum_type(metadata, call_path)
};

Expand All @@ -368,7 +372,10 @@ fn generate_outer_error_enum_type(
return None;
};

let path = format!("{}Error", pallet.name);
// Note: using the `format!` macro like in `let path = format!("{}Error", pallet.name);`
// leads to linker errors about extern function `_Unwind_Resume` not being defined.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Strange; this isn't expected! Not a big deal but the alloc::format! macro should work fine here so I'd be keen to understand this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to understand this but just could not. When I use alloc::format!("{}Error", pallet.name) the crate on itself compiles fine with cargo check --no-default-features. But when actually running it in the no-std context of the no-std-tests crate, the linker fails. This is the full error:

[tadeo@tadeo no-std-tests]$ cargo run
warning: /home/tadeo/code/subxt2/metadata/Cargo.toml: unused manifest key: dependencies.codec.package
   Compiling subxt-metadata v0.34.0 (/home/tadeo/code/subxt2/metadata)
   Compiling subxt-core-no-std-tests v0.0.0 (/home/tadeo/code/subxt2/testing/no-std-tests)
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/tadeo/binaries/binaryen-version_114/bin/:/home/tadeo/.cargo/bin:/home/tadeo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/emscripten:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl://home/tadeo/software/clion-2023.1.1/bin://home/tadeo/software/RustRover-232.9921.62/bin://home/tadeo/software://home/tadeo/binaries://home/tadeo/binaries/binaryen-version_114/bin://home/tadeo/tadeo/jai/bin://home/tadeo/software/clion-2023.1.1/bin://home/tadeo/software/RustRover-232.9921.62/bin://home/tadeo/software://home/tadeo/binaries://home/tadeo/binaries/binaryen-version_114/bin://home/tadeo/tadeo/jai/bin://home/tadeo/software/clion-2023.1.1/bin://home/tadeo/software/RustRover-232.9921.62/bin://home/tadeo/software://home/tadeo/binaries://home/tadeo/binaries/binaryen-version_114/bin://home/tadeo/tadeo/jai/bin://home/tadeo/software/clion-2023.1.1/bin://home/tadeo/software/RustRover-232.9921.62/bin://home/tadeo/software://home/tadeo/binaries://home/tadeo/binaries/binaryen-version_114/bin://home/tadeo/tadeo/jai/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcp0Q3ax/symbols.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.103d7shcucyldk1g.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.134jxfsp5r7fpsi4.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.15wugjomekc8u9cd.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.178ff35gl51k9jn6.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.1jqpxfobqlnn8dob.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.1khbisjscn1p6t4n.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.1s6jde34ai0c04oa.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.1sfwv0smmwal94uv.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.1yqju8l0gxt8jp4h.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.22sbasemurmw45jc.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.23vjmkzrwirghvh5.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.29jz3hhor6eyhjgo.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.2e8pm24wjwi8pqnb.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.2eas55mtom89jlpi.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.2g758ypgh7ai9z2d.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.2hlg20o9a8r26tny.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.33oo3s3e7xphmlkm.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.34lm33xs8rpm0f6m.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.39d3e7b2uh6hr0m6.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.39uaa6effdb5z6it.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3dvsizvfqr3wxugi.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3n2r7voz6tr59iem.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3n5vq0xmgqov6qex.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3rb54tsaelnlzp3m.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3rgifcfdkpv1ee4e.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3vd9icfw49rg4xc7.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3vlp1daoj4zytiru.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3wbr0ej039s27x53.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3wsxam7zeczjhu47.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3x65b4y4tgm16nw0.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.3z6qwpbs3u5307w2.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.48lgsnngb8wmhfwn.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4a6gn4zz3e3nsy2p.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4adnto81w9ywcza7.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4b5pmus4hc1u5gx5.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4d795spuxyilox3m.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4exap4y2iot01wrr.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4jc6xztur1jbid8p.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4lcqqww4qtfg47cu.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4svmi0pbwo8m12ww.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4v0rq98kzpd7g0zn.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4vp76ust6qq42pds.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4vz95k3cvgfx132b.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4yaei9hul0k9jvk7.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4zzcigv6wroyicrg.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.50xpqhd15ijd73p6.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.51fi6z0od92rlk20.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.54bpxaa0km7juimd.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.59klo2yrskf6m1f5.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.5abx5mf18w95g7c5.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.5bqzfqvsjx3pno3e.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.5g1m8r2w01p7f6b.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.hmrcr4vtok8xv11.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.iqsert8edir48bn.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.ji0f1ji5xs2c30w.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.jnkpcgsrytzhe0w.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.jwfmp58jpysnbw0.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.pgpbdv4u5zly0z6.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.uyjzkjdkpi41f9x.rcgu.o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44.4euzgjsu130ppiyb.rcgu.o" "-Wl,--as-needed" "-L" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps" "-L" "/home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libsubxt_metadata-51d9f1437669e61a.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libsp_core_hashing-b92301fca1f18fe4.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libsha2-fc2ced99413ea5a3.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libcpufeatures-127b28b7f44f8f73.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libsha3-30102a3273cf6aa8.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libkeccak-b1a57eb5615ae5dd.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libtwox_hash-1b6d84b001e138c9.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libstatic_assertions-76e5be1f276ce5ad.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libblake2b_simd-3a0804c8f03d203f.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libconstant_time_eq-9879df55f4488384.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libarrayref-0a9b0146144627df.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libdigest-824630e7c7967625.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libblock_buffer-25e7908af0286f36.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libcrypto_common-d2724c415a8f25fd.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libgeneric_array-5752b1ffb1411b67.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libtypenum-a84ff3aee3fcd5b8.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libbyteorder-fd4dfae9638f420b.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libhashbrown-587c5fc643045699.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libahash-8f8b55be1f83bb29.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libonce_cell-cc3cb20337a1a354.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libzerocopy-d70ac5a9e7e5bf2b.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/liballocator_api2-f38c7224acdc551b.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libframe_metadata-b6624e76cd6133b1.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libscale_info-ac66d96ac73e377a.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libcfg_if-a6cd404a8612f704.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/liblibc-66190e536753d214.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libparity_scale_codec-5bfe95cae8bb589e.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libarrayvec-b7f808d3db61b112.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/libbyte_slice_cast-3824ae5dc231d397.rlib" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/liblibc_alloc-986027e607c85d37.rlib" "/home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-3bf59988464e229a.rlib" "/home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-9686387289eaa322.rlib" "/home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-632ae0f28c5e55ff.rlib" "/home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-8ebeba8f78436673.rlib" "-Wl,-Bdynamic" "-lc" "-lm" "-lrt" "-lpthread" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/tadeo/code/subxt2/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-d06243bfbe399a44" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: /usr/bin/ld: /home/tadeo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-3bf59988464e229a.rlib(alloc-3bf59988464e229a.alloc.9e8bbef5278c9f16-cgu.0.rcgu.o): in function `alloc::fmt::format::format_inner':
          /rustc/e51e98dde6a60637b6a71b8105245b629ac3fe77/library/alloc/src/alloc.rs:(.text._ZN5alloc3fmt6format12format_inner17hcb21963db8ce8921E+0x18a): undefined reference to `_Unwind_Resume'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `subxt-core-no-std-tests` (bin "subxt-core-no-std-tests") due to 1 previous error

Copy link
Collaborator

Choose a reason for hiding this comment

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

So I tried running this no-std-tests on my M1 mac with cargo +nightly run and it blew up hideously for me (error below) even without the format thing!

A way I've tested no-std before it to try compiling for a certain architecture that doesn't support std. It's a bit less good in that it doesn't then also test any code, but worked pretty well.

I wonder what needs changing to make this example compile on my mac! I'm a little scared by un-understandable errors :D

(my error:)

error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/james/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/opt/homebrew/opt/llvm/bin:/Users/james/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/james/.cargo/bin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-arch" "arm64" "/var/folders/w9/qpj02kr93657cz711ppx0t000000gn/T/rustc87T3UO/symbols.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.15d5c1azm5qs75er.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.18o25cv5mh1czzjv.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.1bgxi20o8beedxh9.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.1m7v5cg51x1p7t79.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.1mdjt5lke7rk419d.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.1v8ak6ohszt9il8x.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.1v9sz25zdztrk2hg.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.20lu86g86pae7v1.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.269mpyibt1n9z2i8.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.26gmy4iee7clpnjg.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2827u6krwnwjtvmo.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.28terp055wptt9us.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2gjo3dujmmxwsynl.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2hdy6vweutivgntb.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2ij89yj2b9cfmh0k.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2kxijmagjgn5c651.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2l9spa5avf7kavpj.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2mp073awr9qou2fb.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.2xjmwo260sodaqiq.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.31qn6lw1n4lpjdve.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.347ir8fl8lxog3w6.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.34ay7fxhwl65bj7v.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3g07tcecbxwnnq15.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3ggonenpgi5q0rf7.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3hy4l7kks4k4namn.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3mopnmoc36199hoe.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3mwmtcsm84pap21c.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3pxzeifl0mb14zss.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3qm0plxewj6nsfhf.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3qw0ledh0ykcy9u6.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3sx8ru8t9n82j95.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3t69n7kzsmq96tw3.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.3wrm7uvmrqxraehz.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.400crr6k9d61fu17.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.40vv1ehx1u9exf8h.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.419xohj6in5i57zm.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.49kcb06tsafvm0db.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.49o2xnetxigqdpro.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.4h4ig9h9alzumjiu.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.4l56t28e7lpv17zl.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.4l6ylrtnyepjcwz3.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.4lvkbyvrpemqogh6.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.4w4f3riwmsudy1je.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.4xkclc8ecezl0k83.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.51jptb7x34zdfqf2.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.52x4vlfiymy8pwzd.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.55rg619tv9lf7277.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.5cbdvd0r51grlge5.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.5cfwus2ubakw9ax4.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.7gevje2ejveviaa.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.caeimgud3je6u6x.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.cg62d0ulxjdhpt3.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.er7b56c56du2olw.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.f5h5r5p91v2k9ni.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.fe25tv2z76lodxh.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.gt1xdawrq4l7qvw.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.jv85tnelye4bgri.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.xo8z24wgj0cg9av.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.zq1xrzayduo33qg.rcgu.o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b.1t8ag4zloyspfmmk.rcgu.o" "-L" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps" "-L" "/Users/james/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libsubxt_metadata-8e248289f930cb3c.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libsp_core_hashing-f0c25e154b5c4277.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libsha2-cb2ce43e4b8e194a.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libsha3-5838d6073efb5c3e.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libkeccak-d2d65997e5888b81.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libtwox_hash-857443a2d443ea8b.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libstatic_assertions-9023d874dd538a80.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libblake2b_simd-9fb389da054224a0.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libconstant_time_eq-29dc5e34c80a75b2.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libarrayref-9b1fb0b52a86eb41.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libdigest-4c52f81b6eec5fb1.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libblock_buffer-ec353a40d52c9037.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libcrypto_common-57844e855bcb6cd4.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libgeneric_array-b1f0fee6a20334f9.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libtypenum-775d0f072d4f4abd.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libbyteorder-0820adf1e7c48840.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libhashbrown-5244040c47fd6a4a.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libahash-a7a7d37f197f75c4.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libonce_cell-224b04cb628f70ea.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libzerocopy-c44aef1ea18b0c6c.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/liballocator_api2-ca7226a82670e6c8.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libframe_metadata-e1923b9d96c4e0ee.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libscale_info-799db87831817bb0.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libcfg_if-a70192628636786c.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/liblibc-8cc6a15d6487055d.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libparity_scale_codec-39751d065c7b75ba.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libarrayvec-dff866a194c19e5e.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/libbyte_slice_cast-8fd10abbb6202346.rlib" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/liblibc_alloc-8e6c22beab38a9a5.rlib" "/Users/james/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-fce2a9bd028a2944.rlib" "/Users/james/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-e5afe4e689972eee.rlib" "/Users/james/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-113e29613e2cc3c4.rlib" "/Users/james/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-0faa98e433ca4c9a.rlib" "-liconv" "-L" "/Users/james/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/james/Work/subxt/testing/no-std-tests/target/debug/deps/subxt_core_no_std_tests-c9e698994923ea6b" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture arm64:
            "_memcmp", referenced from:
                _$LT$u8$u20$as$u20$core..slice..cmp..SliceOrd$GT$::compare::h2bc851d9c6b79f93 in libscale_info-799db87831817bb0.rlib(scale_info-799db87831817bb0.scale_info.bfaba07d6ed144ac-cgu.08.rcgu.o)
                _$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$::equal::hb5134437d2fec988 in libscale_info-799db87831817bb0.rlib(scale_info-799db87831817bb0.scale_info.bfaba07d6ed144ac-cgu.08.rcgu.o)
            "_memmove", referenced from:
                core::slice::sort::merge_sort::RunVec$LT$RunAllocF$C$RunDeallocF$GT$::remove::he4ebdd000273eb8e in subxt_core_no_std_tests-c9e698994923ea6b.52x4vlfiymy8pwzd.rcgu.o
                alloc::collections::btree::node::BalancingContext$LT$K$C$V$GT$::bulk_steal_left::h7a76fcbed2e55b36 in libframe_metadata-e1923b9d96c4e0ee.rlib(frame_metadata-e1923b9d96c4e0ee.frame_metadata.41e071e3dfd6810e-cgu.03.rcgu.o)
                hashbrown::raw::RawTableInner::prepare_rehash_in_place::h1c0f596ae44a7f5b in libsubxt_metadata-8e248289f930cb3c.rlib(subxt_metadata-8e248289f930cb3c.2vd0twcydxhja38y.rcgu.o)
            "_memset", referenced from:
                _$LT$i8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$::from_elem::ha4d40836b07f28c1 in subxt_core_no_std_tests-c9e698994923ea6b.5cbdvd0r51grlge5.rcgu.o
                _$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$::from_elem::he5fc054bff2de0b8 in subxt_core_no_std_tests-c9e698994923ea6b.5cbdvd0r51grlge5.rcgu.o
                hashbrown::raw::RawTableInner::fallible_with_capacity::had20f01794ceec46 in libsubxt_metadata-8e248289f930cb3c.rlib(subxt_metadata-8e248289f930cb3c.4di09es9j9z0uye5.rcgu.o)
                _$LT$alloc..vec..into_iter..IntoIter$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h984782dda0343e33 in libframe_metadata-e1923b9d96c4e0ee.rlib(frame_metadata-e1923b9d96c4e0ee.frame_metadata.41e071e3dfd6810e-cgu.01.rcgu.o)
                _$LT$alloc..vec..into_iter..IntoIter$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h148c0c7b754fe643 in libsubxt_metadata-8e248289f930cb3c.rlib(subxt_metadata-8e248289f930cb3c.4f0vy5igmgli8fsf.rcgu.o)
                _$LT$alloc..vec..into_iter..IntoIter$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h6b190362ceded8d4 in libsubxt_metadata-8e248289f930cb3c.rlib(subxt_metadata-8e248289f930cb3c.4f0vy5igmgli8fsf.rcgu.o)
                _$LT$alloc..vec..into_iter..IntoIter$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h6e1c6f16b2e57101 in libsubxt_metadata-8e248289f930cb3c.rlib(subxt_metadata-8e248289f930cb3c.4f0vy5igmgli8fsf.rcgu.o)
                ...
            "_memalign", referenced from:
                _$LT$libc_alloc..LibcAlloc$u20$as$u20$core..alloc..global..GlobalAlloc$GT$::alloc::h6ceccb6ff37b97f1 in subxt_core_no_std_tests-c9e698994923ea6b.269mpyibt1n9z2i8.rcgu.o
            "_memcpy", referenced from:
                core::ops::function::FnMut::call_mut::h50a1ff7c808fa955 in subxt_core_no_std_tests-c9e698994923ea6b.1mdjt5lke7rk419d.rcgu.o
                frame_metadata::_::_$LT$impl$u20$parity_scale_codec..codec..Decode$u20$for$u20$frame_metadata..RuntimeMetadataPrefixed$GT$::decode::hc2d6160521da3f99 in subxt_core_no_std_tests-c9e698994923ea6b.1v8ak6ohszt9il8x.rcgu.o
                frame_metadata::_::_$LT$impl$u20$parity_scale_codec..codec..Decode$u20$for$u20$frame_metadata..RuntimeMetadata$GT$::decode::_$u7b$$u7b$closure$u7d$$u7d$::h02992c01d903eeee in subxt_core_no_std_tests-c9e698994923ea6b.1v8ak6ohszt9il8x.rcgu.o
                frame_metadata::_::_$LT$impl$u20$parity_scale_codec..codec..Decode$u20$for$u20$frame_metadata..RuntimeMetadata$GT$::decode::_$u7b$$u7b$closure$u7d$$u7d$::h0f8ac221182a9398 in subxt_core_no_std_tests-c9e698994923ea6b.1v8ak6ohszt9il8x.rcgu.o
                frame_metadata::_::_$LT$impl$u20$parity_scale_codec..codec..Decode$u20$for$u20$frame_metadata..RuntimeMetadata$GT$::decode::_$u7b$$u7b$closure$u7d$$u7d$::h36e492884daaee58 in subxt_core_no_std_tests-c9e698994923ea6b.1v8ak6ohszt9il8x.rcgu.o
                frame_metadata::_::_$LT$impl$u20$parity_scale_codec..codec..Decode$u20$for$u20$frame_metadata..RuntimeMetadata$GT$::decode::_$u7b$$u7b$closure$u7d$$u7d$::h3dc4f7f50ba2c6b4 in subxt_core_no_std_tests-c9e698994923ea6b.1v8ak6ohszt9il8x.rcgu.o
                frame_metadata::_::_$LT$impl$u20$parity_scale_codec..codec..Decode$u20$for$u20$frame_metadata..RuntimeMetadata$GT$::decode::_$u7b$$u7b$closure$u7d$$u7d$::h3fb7d05b52fb5ce6 in subxt_core_no_std_tests-c9e698994923ea6b.1v8ak6ohszt9il8x.rcgu.o
                ...
            "_abort", referenced from:
                _rust_begin_unwind in subxt_core_no_std_tests-c9e698994923ea6b.3g07tcecbxwnnq15.rcgu.o
            "_free", referenced from:
                _$LT$libc_alloc..LibcAlloc$u20$as$u20$core..alloc..global..GlobalAlloc$GT$::dealloc::hf2148cf9f27498b8 in subxt_core_no_std_tests-c9e698994923ea6b.269mpyibt1n9z2i8.rcgu.o
            "_bzero", referenced from:
                _$LT$libc_alloc..LibcAlloc$u20$as$u20$core..alloc..global..GlobalAlloc$GT$::alloc_zeroed::ha8abe505d0f3cbe3 in subxt_core_no_std_tests-c9e698994923ea6b.269mpyibt1n9z2i8.rcgu.o
                alloc::alloc::Global::grow_impl::h89bdf56ff6b1f1a7 in libparity_scale_codec-39751d065c7b75ba.rlib(parity_scale_codec-39751d065c7b75ba.parity_scale_codec.c0eb5f39e1cd9682-cgu.0.rcgu.o)
                alloc::alloc::Global::grow_impl::hc07514a638cb7bc8 in libtwox_hash-857443a2d443ea8b.rlib(twox_hash-857443a2d443ea8b.twox_hash.599fc9e923e5a001-cgu.0.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `subxt-core-no-std-tests` (bin "subxt-core-no-std-tests") due to 1 previous error

let mut path = String::new();
write!(path, "{}Error", pallet.name).expect("Cannot panic, qed;");
let ty = error.ty.id.into();

Some(scale_info::Variant {
Expand Down
4 changes: 3 additions & 1 deletion metadata/src/from_into/v15.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
// see LICENSE for license details.

use super::TryFromError;
use crate::prelude::*;
use crate::utils::variant_index::VariantIndex;
use crate::{
utils::ordered_map::OrderedMap, ArcStr, ConstantMetadata, ExtrinsicMetadata, Metadata,
OuterEnumsMetadata, PalletMetadataInner, RuntimeApiMetadataInner, RuntimeApiMethodMetadata,
RuntimeApiMethodParamMetadata, SignedExtensionMetadata, StorageEntryMetadata,
StorageEntryModifier, StorageEntryType, StorageHasher, StorageMetadata,
};
use borrow::ToOwned;
use frame_metadata::v15;
use hashbrown::HashMap;
use scale_info::form::PortableForm;
use std::collections::HashMap;

// Converting from V15 metadata into our Subxt repr.
mod from_v15 {
Expand Down
9 changes: 7 additions & 2 deletions metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@
//! 2. Obtaining [`frame_metadata::RuntimeMetadataPrefixed`], and then
//! using `.try_into()` to convert it into [`Metadata`].

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(missing_docs)]

mod from_into;
mod prelude;
mod utils;

use hashbrown::HashMap;
use prelude::*;
use scale_info::{form::PortableForm, PortableRegistry, Variant};
use std::collections::HashMap;
use std::sync::Arc;
use string::String;
use sync::Arc;
use utils::variant_index::VariantIndex;
use utils::{ordered_map::OrderedMap, validation::outer_enum_hashes::OuterEnumHashes};
use vec::Vec;

type ArcStr = Arc<str>;

Expand Down
Loading
Loading