NFT icon indicating copy to clipboard operation
NFT copied to clipboard

tests fail on M1 Mac with error[E0425]: cannot find function `get_fault_info` in this scope

Open myklemykle opened this issue 3 years ago • 2 comments

Hi,

I'm trying to build the NEP171 example contract (ver 5d9f516) from scratch on MacOS 11.6, M1 CPU.
Build succeeds, but tests fail here:

   Compiling clang-sys v0.29.3
error[E0425]: cannot find function `get_fault_info` in this scope
   --> /Volumes/External/mykle/Documents/near/figment/flarn2.0/registry/src/github.com-1ecc6299db9ec823/wasmer-runtime-core-near-0.17.1/src/fault.rs:289:21
    |
289 |         let fault = get_fault_info(siginfo as _, ucontext);
    |                     ^^^^^^^^^^^^^^ not found in this scope

An online search for this error string suggested that this might be an issue with the wasm package requiring rust 'nightly' instead of 'stable'. But 'nightly' wasn't able to compile or test the build.

myklemykle avatar Feb 04 '22 01:02 myklemykle

I built successfully on an Intel mac (Mojave 10.14.6) so this is looking like an M1 issue.

In the erroring file wasmer-runtime-core-near-0.17.1/src/fault.rs , get_fault_info() is defined for macos+x86_64, but not for macos+arm. That's a big clue.

I suspect this is more an issue with building the local NEAR runtime (used for testing?) than the example NFT contract. So probably this issue belongs in a different repo, but I'm not sure which one. Please advise. Thx!

myklemykle avatar Feb 05 '22 21:02 myklemykle

Yes, I also face this error when run cargo test -- --nocapture on Mac M1:

error[E0425]: cannot find function `get_fault_info` in this scope
   --> /Users/nhamchithanh/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-runtime-core-near-0.17.1/src/fault.rs:289:21
    |
289 |         let fault = get_fault_info(siginfo as _, ucontext);
    |                     ^^^^^^^^^^^^^^ not found in this scope

Please help us to check this issue.

nhamthanh avatar Mar 01 '22 03:03 nhamthanh

Dropping by to confirm that I'm running into this issue as well, on an M1 mac trying to build one of the indexer examples.

Cargo.toml for this is using https://github.com/near/nearcore/tree/25b000ae, which is a version from about a year ago.

ad0ll avatar Oct 30 '22 14:10 ad0ll

should be fixed by now since SDK is compatible with M1 (I am in an M1 now)

gagdiez avatar Oct 21 '23 14:10 gagdiez