Stream: git-wasmtime

Topic: wasmtime / issue #7194 error: failed to run custom build ...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2023 at 05:41):

blue-freedom-technologies opened issue #7194:

Problem

Not able to build the rust application using the command "cargo build --bin test-app".
After adding this crate subxt to the cargo.toml.

Steps

1)adding this crate subxt to the cargo.toml.
2)cargo build --bin test-app
3) error.

Possible Solution(s)

Probably the subxt crate has something that is confusing the compiler.

Notes

This is an test application for a ESP32-c6 microcontroller. We are using the esp-idf-hal.
We have the test-app code in here.

Version

cargo 1.75.0-nightly (794d0a825 2023-10-03)
release: 1.75.0-nightly
commit-hash: 794d0a82547f3081044c0aca7b6083733ce51344
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.3.0-DEV (sys:0.4.66+curl-8.3.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Ubuntu 22.04 (jammy) [64-bit]

Error

Running `/home/silveira/bluefreedom/test-app/target/debug/build/wasmtime-runtime-af8c978cc181d296/build-script-build`
The following warnings were emitted during compilation:

warning: cc: error: unrecognized argument in option ‘-mabi=ilp32’
warning: cc: note: valid arguments to ‘-mabi=’ are: ms sysv
warning: cc: error: unrecognized argument in option ‘-mcmodel=medany’
warning: cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small

error: failed to run custom build command for `wasmtime-runtime v8.0.1`

Caused by:
  process didn't exit successfully: `/home/silveira/bluefreedom/test-app/target/debug/build/wasmtime-runtime-af8c978cc181d296/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src/helpers.c
  TARGET = Some("riscv32imac-esp-espidf")
  OPT_LEVEL = Some("z")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_riscv32imac-esp-espidf
  CC_riscv32imac-esp-espidf = None
  cargo:rerun-if-env-changed=CC_riscv32imac_esp_espidf
  CC_riscv32imac_esp_espidf = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  RUSTC_LINKER = Some("ldproxy")
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("a,c,m")
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac-esp-espidf
  CFLAGS_riscv32imac-esp-espidf = None
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac_esp_espidf
  CFLAGS_riscv32imac_esp_espidf = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-Wall" "-Wextra" "-DCFG_TARGET_OS_espidf" "-DCFG_TARGET_ARCH_riscv32" "-o" "/home/silveira/bluefreedom/test-app/target/riscv32imac-esp-espidf/debug/build/wasmtime-runtime-d75f6ee2ec7ef9d7/out/src/helpers.o" "-c" "src/helpers.c"
  cargo:warning=cc: error: unrecognized argument in option ‘-mabi=ilp32’

  cargo:warning=cc: note: valid arguments to ‘-mabi=’ are: ms sysv

  cargo:warning=cc: error: unrecognized argument in option ‘-mcmodel=medany’

  cargo:warning=cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small

  exit status: 1

  --- stderr


  error occurred: Command "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-Wall" "-Wextra" "-DCFG_TARGET_OS_espidf" "-DCFG_TARGET_ARCH_riscv32" "-o" "/home/silveira/bluefreedom/test-app/target/riscv32imac-esp-espidf/debug/build/wasmtime-runtime-d75f6ee2ec7ef9d7/out/src/helpers.o" "-c" "src/helpers.c" with args "cc" did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish...

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2023 at 06:11):

bjorn3 commented on issue #7194:

Wasmtime currently doesn't support any 32bit architectures.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2023 at 10:40):

blue-freedom-technologies commented on issue #7194:

That's right, sorry for the trouble.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 09 2023 at 10:40):

blue-freedom-technologies closed issue #7194:

Problem

Not able to build the rust application using the command "cargo build --bin test-app".
After adding this crate subxt to the cargo.toml.

Steps

1)adding this crate subxt to the cargo.toml.
2)cargo build --bin test-app
3) error.

Possible Solution(s)

Probably the subxt crate has something that is confusing the compiler.

Notes

This is an test application for a ESP32-c6 microcontroller. We are using the esp-idf-hal.
We have the test-app code in here.

Version

cargo 1.75.0-nightly (794d0a825 2023-10-03)
release: 1.75.0-nightly
commit-hash: 794d0a82547f3081044c0aca7b6083733ce51344
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.3.0-DEV (sys:0.4.66+curl-8.3.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Ubuntu 22.04 (jammy) [64-bit]

Error

Running `/home/silveira/bluefreedom/test-app/target/debug/build/wasmtime-runtime-af8c978cc181d296/build-script-build`
The following warnings were emitted during compilation:

warning: cc: error: unrecognized argument in option ‘-mabi=ilp32’
warning: cc: note: valid arguments to ‘-mabi=’ are: ms sysv
warning: cc: error: unrecognized argument in option ‘-mcmodel=medany’
warning: cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small

error: failed to run custom build command for `wasmtime-runtime v8.0.1`

Caused by:
  process didn't exit successfully: `/home/silveira/bluefreedom/test-app/target/debug/build/wasmtime-runtime-af8c978cc181d296/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src/helpers.c
  TARGET = Some("riscv32imac-esp-espidf")
  OPT_LEVEL = Some("z")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_riscv32imac-esp-espidf
  CC_riscv32imac-esp-espidf = None
  cargo:rerun-if-env-changed=CC_riscv32imac_esp_espidf
  CC_riscv32imac_esp_espidf = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  RUSTC_LINKER = Some("ldproxy")
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("a,c,m")
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac-esp-espidf
  CFLAGS_riscv32imac-esp-espidf = None
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac_esp_espidf
  CFLAGS_riscv32imac_esp_espidf = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-Wall" "-Wextra" "-DCFG_TARGET_OS_espidf" "-DCFG_TARGET_ARCH_riscv32" "-o" "/home/silveira/bluefreedom/test-app/target/riscv32imac-esp-espidf/debug/build/wasmtime-runtime-d75f6ee2ec7ef9d7/out/src/helpers.o" "-c" "src/helpers.c"
  cargo:warning=cc: error: unrecognized argument in option ‘-mabi=ilp32’

  cargo:warning=cc: note: valid arguments to ‘-mabi=’ are: ms sysv

  cargo:warning=cc: error: unrecognized argument in option ‘-mcmodel=medany’

  cargo:warning=cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small

  exit status: 1

  --- stderr


  error occurred: Command "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-Wall" "-Wextra" "-DCFG_TARGET_OS_espidf" "-DCFG_TARGET_ARCH_riscv32" "-o" "/home/silveira/bluefreedom/test-app/target/riscv32imac-esp-espidf/debug/build/wasmtime-runtime-d75f6ee2ec7ef9d7/out/src/helpers.o" "-c" "src/helpers.c" with args "cc" did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish...

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2023 at 04:37):

blue-freedom-technologies edited issue #7194.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2023 at 17:03):

harry2855 commented on issue #7194:

@bjorn3 I am using Macbook Air M1, still getting this error. Do you have an idea of possible reasons?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2023 at 17:10):

bjorn3 commented on issue #7194:

Can you post the full error message?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2023 at 18:16):

harry2855 commented on issue #7194:

The following warnings were emitted during compilation:

warning: wasmtime-runtime@8.0.1: src/helpers.c:1:10: fatal error: 'setjmp.h' file not found
warning: wasmtime-runtime@8.0.1: #include <setjmp.h>
warning: wasmtime-runtime@8.0.1:          ^~~~~~~~~~
warning: wasmtime-runtime@8.0.1: 1 error generated.

error: failed to run custom build command for `wasmtime-runtime v8.0.1`

Caused by:
  process didn't exit successfully: `/Users/harry/Desktop/blockchain/ink-Stable-Coin/contracts/stable-coin/target/ink/release/build/wasmtime-runtime-90f91f7d3dfa62f2/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src/helpers.c
  TARGET = Some("wasm32-unknown-unknown")
  OPT_LEVEL = Some("z")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "clang" "-Oz" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-Wall" "-Wextra" "-DCFG_TARGET_OS_unknown" "-DCFG_TARGET_ARCH_wasm32" "-o" "/Users/harry/Desktop/blockchain/ink-Stable-Coin/contracts/stable-coin/target/ink/wasm32-unknown-unknown/release/build/wasmtime-runtime-4f7b010b9427d08c/out/src/helpers.o" "-c" "src/helpers.c"
  cargo:warning=src/helpers.c:1:10: fatal error: 'setjmp.h' file not found

  cargo:warning=#include <setjmp.h>

  cargo:warning=         ^~~~~~~~~~

  cargo:warning=1 error generated.

  exit status: 1

  --- stderr


  error occurred: Command "clang" "-Oz" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-Wall" "-Wextra" "-DCFG_TARGET_OS_unknown" "-DCFG_TARGET_ARCH_wasm32" "-o" "/Users/harry/Desktop/blockchain/ink-Stable-Coin/contracts/stable-coin/target/ink/wasm32-unknown-unknown/release/build/wasmtime-runtime-4f7b010b9427d08c/out/src/helpers.o" "-c" "src/helpers.c" with args "clang" did not execute successfully (status code exit status: 1).
 ```

And below is my cargo.toml file:
```code
[package]
name = "stable_coin_contract"
version= "4.0.0-beta.1"
authors = ["Brushfam <dominik.krizo@727.ventures>"]
edition = "2021"

[dependencies]
ink = { version = "4.3.0", default-features = false}

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
dia-oracle-getter = { path = "../oracle-contracts/oracle-getter", default-features = false }
# These dependencies
openbrush = { tag = "4.0.0-beta", git = "https://github.com/Brushfam/openbrush-contracts", default-features = false, features = ["ownable", "psp22"] }
drink = { version = "0.6" }
[dev-dependencies]
dia-oracle = { path = "../oracle-contracts/oracle", default-features = false }
dia-oracle-setter = { path = "../oracle-contracts/oracle-setter", default-features = false }
[lib]
name = "stable_coin_contract"
path = "lib.rs"

[features]
default = ["std"]
std = [
    "ink/std",
    "scale/std",
    "scale-info/std",
    # These dependencies
    "openbrush/std",
    "dia-oracle-getter/std",
]
ink-as-dependency = []

[profile.dev]
codegen-units = 16

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2023 at 18:16):

harry2855 edited a comment on issue #7194:

I got this error

The following warnings were emitted during compilation:

warning: wasmtime-runtime@8.0.1: src/helpers.c:1:10: fatal error: 'setjmp.h' file not found
warning: wasmtime-runtime@8.0.1: #include <setjmp.h>
warning: wasmtime-runtime@8.0.1:          ^~~~~~~~~~
warning: wasmtime-runtime@8.0.1: 1 error generated.

error: failed to run custom build command for `wasmtime-runtime v8.0.1`

Caused by:
  process didn't exit successfully: `/Users/harry/Desktop/blockchain/ink-Stable-Coin/contracts/stable-coin/target/ink/release/build/wasmtime-runtime-90f91f7d3dfa62f2/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=src/helpers.c
  TARGET = Some("wasm32-unknown-unknown")
  OPT_LEVEL = Some("z")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_wasm32-unknown-unknown
  CC_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CC_wasm32_unknown_unknown
  CC_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_wasm32-unknown-unknown
  CFLAGS_wasm32-unknown-unknown = None
  cargo:rerun-if-env-changed=CFLAGS_wasm32_unknown_unknown
  CFLAGS_wasm32_unknown_unknown = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "clang" "-Oz" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-Wall" "-Wextra" "-DCFG_TARGET_OS_unknown" "-DCFG_TARGET_ARCH_wasm32" "-o" "/Users/harry/Desktop/blockchain/ink-Stable-Coin/contracts/stable-coin/target/ink/wasm32-unknown-unknown/release/build/wasmtime-runtime-4f7b010b9427d08c/out/src/helpers.o" "-c" "src/helpers.c"
  cargo:warning=src/helpers.c:1:10: fatal error: 'setjmp.h' file not found

  cargo:warning=#include <setjmp.h>

  cargo:warning=         ^~~~~~~~~~

  cargo:warning=1 error generated.

  exit status: 1

  --- stderr


  error occurred: Command "clang" "-Oz" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-Wall" "-Wextra" "-DCFG_TARGET_OS_unknown" "-DCFG_TARGET_ARCH_wasm32" "-o" "/Users/harry/Desktop/blockchain/ink-Stable-Coin/contracts/stable-coin/target/ink/wasm32-unknown-unknown/release/build/wasmtime-runtime-4f7b010b9427d08c/out/src/helpers.o" "-c" "src/helpers.c" with args "clang" did not execute successfully (status code exit status: 1).
 ```

And below is my cargo.toml file:
```code
[package]
name = "stable_coin_contract"
version= "4.0.0-beta.1"
authors = ["Brushfam <dominik.krizo@727.ventures>"]
edition = "2021"

[dependencies]
ink = { version = "4.3.0", default-features = false}

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
dia-oracle-getter = { path = "../oracle-contracts/oracle-getter", default-features = false }
# These dependencies
openbrush = { tag = "4.0.0-beta", git = "https://github.com/Brushfam/openbrush-contracts", default-features = false, features = ["ownable", "psp22"] }
drink = { version = "0.6" }
[dev-dependencies]
dia-oracle = { path = "../oracle-contracts/oracle", default-features = false }
dia-oracle-setter = { path = "../oracle-contracts/oracle-setter", default-features = false }
[lib]
name = "stable_coin_contract"
path = "lib.rs"

[features]
default = ["std"]
std = [
    "ink/std",
    "scale/std",
    "scale-info/std",
    # These dependencies
    "openbrush/std",
    "dia-oracle-getter/std",
]
ink-as-dependency = []

[profile.dev]
codegen-units = 16

view this post on Zulip Wasmtime GitHub notifications bot (Nov 12 2023 at 20:42):

alexcrichton commented on issue #7194:

@harry2855 it looks like you're building Wasmtime for the wasm32-unknown-unknown target itself which is not supported.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 13 2023 at 19:55):

harry2855 commented on issue #7194:

@alexcrichton What are the alternatives then? Should I have to change it to wasm64-unknown-unknown?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 13 2023 at 20:40):

alexcrichton commented on issue #7194:

No, at this time Wasmtime cannot itself be compiled to WebAssembly, it's not a supported target. (either wasm32 or wasm64)

view this post on Zulip Wasmtime GitHub notifications bot (Nov 13 2023 at 21:03):

harry2855 commented on issue #7194:

Okay, thanks for your time.


Last updated: Nov 22 2024 at 16:03 UTC