This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
unresolved import sp_core::to_substrate_wasm_fn_return_value
#13582
Labels
J2-unconfirmed
Issue might be valid, but it’s not yet known.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
NOTE: I tried this recommendation, but it did not work...
https://substrate.stackexchange.com/questions/1079/no-to-substrate-wasm-fn-return-value-in-the-root-when-i-run-cargo-build-in
I built a MacOS target example successfully
I built Substrate example successfully
When I added Substate dependencies to MacOS version I get the following error:
error[E0432]: unresolved import sp_core::to_substrate_wasm_fn_return_value
--> ~/.cargo/git/checkouts/substrate-7e08433d4c370a21/f38bd66/primitives/api/src/lib.rs:80:9
|
80 | pub use sp_core::to_substrate_wasm_fn_return_value;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no to_substrate_wasm_fn_return_value in the root
Can this be my .toml , etc.
Note sp-core compiles but can not find. Using same version as contract pallet for testing.
Compiling sp-core v7.0.0 (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#f38bd667)
#!/bin/bash
##################################################
We call this from an Xcode run script.
##################################################
set -e
if [[ -z "$PROJECT_DIR" ]]; then
echo "Must provide PROJECT_DIR environment variable set to the Xcode project directory." 1>&2
exit 1
fi
cd $PROJECT_DIR
export PATH="$HOME/.cargo/bin:$PATH"
Without this we can't compile on MacOS Big Sur
TimNN/cargo-lipo#41 (comment)
if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]; then
export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}"
fi
TARGETS=""
if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then
TARGETS="aarch64-apple-ios-sim,x86_64-apple-ios"
else
TARGETS="x86_64-apple-darwin,aarch64-apple-darwin"
fi
if [ $ENABLE_PREVIEWS == "NO" ]; then
if [[ $CONFIGURATION == "Release" ]]; then
echo "BUIlDING FOR RELEASE ($TARGETS)"
cargo lipo --release --manifest-path ../Cargo.toml --targets $TARGETS
else
echo "BUIlDING FOR DEBUG ($TARGETS)"
cargo lipo --manifest-path ../Cargo.toml --targets $TARGETS
fi
else
echo "Skipping the script because of preview mode"
fi
[package]
name = "macos-rust-analyzer"
version = "0.1.0"
edition = "2021"
build = "build.rs"
[build-dependencies]
swift-bridge-build = "0.1"
[lib]
crate-type = ["staticlib"]
[dependencies]
swift-bridge = "0.1"
ide = {git = "https://github.com/rust-analyzer/rust-analyzer"}
petgraph = "0.6.3"
anyhow = "1.0.43"
frame-metadata = { version = "15.0.0", features = ["v13"] }
hex = "0.4.3"
parity-scale-codec = "3.0.0"
reqwest = { version = "0.11.4", features = ["json"] }
serde = "1"
serde_json = "1"
tokio = { version = "1.10.0", features = ["full"] }
jsonrpsee = { version = "0.12.0", features = ["async-client", "client-ws-transport"] }
Various types and functions useful for interacting with substrate exist in these sp (substrate-primitives) crates:
sp-core = { git = "https://github.com/paritytech/substrate", package = "sp-core", default-features = false, branch = "polkadot-v0.9.37" }
sp_runtime = { git = "https://github.com/paritytech/substrate", package = "sp-runtime", default-features = false, branch = "polkadot-v0.9.37" }
sp_keyring = { git = "https://github.com/paritytech/substrate.git", package = "sp-keyring", default-features = false, branch = "polkadot-v0.9.37" }
sp_version = { git = "https://github.com/paritytech/substrate.git", package = "sp-version", default-features = false, branch = "polkadot-v0.9.37" }
XCM utilized for the 06_storage_iter example.
xcm = { version = "0.9", git = "https://github.com/paritytech/polkadot.git", branch = "master", package = "xcm" }
There are some types we want in the pallet crates (if we liked, we could just redefine them to save bringing these in):
pallet_balances = { git = "https://github.com/paritytech/substrate.git", package = "pallet-balances", default-features = false, branch = "polkadot-v0.9.37" }
pallet_system = { git = "https://github.com/paritytech/substrate.git", package = "frame-system", default-features = false, branch = "polkadot-v0.9.37" }
[profile.dev]
panic = 'unwind'
[profile.release]
panic = 'unwind'
Steps to reproduce
I created Mac version of project here successfully -
https://chinedufn.github.io/swift-bridge/building/xcode-and-cargo/index.html
Added dependencies from this project which caused import error -
https://github.com/paritytech/polkadot-interaction-examples-rs
The text was updated successfully, but these errors were encountered: