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

Unable to build with openssl #355

Closed
haraldkri opened this issue Dec 16, 2024 · 1 comment
Closed

Unable to build with openssl #355

haraldkri opened this issue Dec 16, 2024 · 1 comment

Comments

@haraldkri
Copy link

haraldkri commented Dec 16, 2024

For context i am quite new to rust. I am trying to run an opcua server on an esp32-c6.
I am currently failing to build the project after installing opcua. If i understood the docu correctly there should be not need to install riscv32imac-esp-espidf manually. So yeah, i am kinda stuck as to what to do here as i can't really find a solution online. Any help is appreciated!

error: failed to run custom build command for `openssl-sys v0.9.104`
Caused by:
  process didn't exit successfully: `/Users/confusedBeing/Development/rust-esp32-c6-blink/target/debug/build/openssl-sys-c5303785ae079004/build-script-main` (exit status: 1)
  --- stdout
  cargo:rustc-check-cfg=cfg(osslconf, values("OPENSSL_NO_OCB", "OPENSSL_NO_SM4", "OPENSSL_NO_SEED", "OPENSSL_NO_CHACHA", "OPENSSL_NO_CAST", "OPENSSL_NO_IDEA", "OPENSSL_NO_CAMELLIA", "OPENSSL_NO_RC4", "OPENSSL_NO_BF", "OPENSSL_NO_PSK", "OPENSSL_NO_DEPRECATED_3_0", "OPENSSL_NO_SCRYPT", "OPENSSL_NO_SM3", "OPENSSL_NO_RMD160", "OPENSSL_NO_EC2M", "OPENSSL_NO_OCSP", "OPENSSL_NO_CMS", "OPENSSL_NO_COMP", "OPENSSL_NO_SOCK", "OPENSSL_NO_STDIO", "OPENSSL_NO_EC", "OPENSSL_NO_SSL3_METHOD", "OPENSSL_NO_KRB5", "OPENSSL_NO_TLSEXT", "OPENSSL_NO_SRP", "OPENSSL_NO_RFC3779", "OPENSSL_NO_SHA", "OPENSSL_NO_NEXTPROTONEG", "OPENSSL_NO_ENGINE", "OPENSSL_NO_BUF_FREELISTS"))
  cargo:rustc-check-cfg=cfg(openssl)
  cargo:rustc-check-cfg=cfg(libressl)
  cargo:rustc-check-cfg=cfg(boringssl)
  cargo:rustc-check-cfg=cfg(libressl250)
  cargo:rustc-check-cfg=cfg(libressl251)
  cargo:rustc-check-cfg=cfg(libressl252)
  cargo:rustc-check-cfg=cfg(libressl261)
  cargo:rustc-check-cfg=cfg(libressl270)
  cargo:rustc-check-cfg=cfg(libressl271)
  cargo:rustc-check-cfg=cfg(libressl273)
  cargo:rustc-check-cfg=cfg(libressl280)
  cargo:rustc-check-cfg=cfg(libressl281)
  cargo:rustc-check-cfg=cfg(libressl291)
  cargo:rustc-check-cfg=cfg(libressl310)
  cargo:rustc-check-cfg=cfg(libressl321)
  cargo:rustc-check-cfg=cfg(libressl332)
  cargo:rustc-check-cfg=cfg(libressl340)
  cargo:rustc-check-cfg=cfg(libressl350)
  cargo:rustc-check-cfg=cfg(libressl360)
  cargo:rustc-check-cfg=cfg(libressl361)
  cargo:rustc-check-cfg=cfg(libressl370)
  cargo:rustc-check-cfg=cfg(libressl380)
  cargo:rustc-check-cfg=cfg(libressl381)
  cargo:rustc-check-cfg=cfg(libressl382)
  cargo:rustc-check-cfg=cfg(libressl390)
  cargo:rustc-check-cfg=cfg(libressl400)
  cargo:rustc-check-cfg=cfg(ossl101)
  cargo:rustc-check-cfg=cfg(ossl102)
  cargo:rustc-check-cfg=cfg(ossl102f)
  cargo:rustc-check-cfg=cfg(ossl102h)
  cargo:rustc-check-cfg=cfg(ossl110)
  cargo:rustc-check-cfg=cfg(ossl110f)
  cargo:rustc-check-cfg=cfg(ossl110g)
  cargo:rustc-check-cfg=cfg(ossl110h)
  cargo:rustc-check-cfg=cfg(ossl111)
  cargo:rustc-check-cfg=cfg(ossl111b)
  cargo:rustc-check-cfg=cfg(ossl111c)
  cargo:rustc-check-cfg=cfg(ossl111d)
  cargo:rustc-check-cfg=cfg(ossl300)
  cargo:rustc-check-cfg=cfg(ossl310)
  cargo:rustc-check-cfg=cfg(ossl320)
  cargo:rustc-check-cfg=cfg(ossl330)
  cargo:rustc-check-cfg=cfg(ossl340)
  cargo:rerun-if-env-changed=RISCV32IMAC_ESP_ESPIDF_OPENSSL_NO_VENDOR
  RISCV32IMAC_ESP_ESPIDF_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=RISCV32IMAC_ESP_ESPIDF_OPENSSL_CONFIG_DIR
  RISCV32IMAC_ESP_ESPIDF_OPENSSL_CONFIG_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_CONFIG_DIR
  OPENSSL_CONFIG_DIR unset
  cargo:warning=openssl-src: failed to build OpenSSL from source
  --- stderr
  don't know how to configure OpenSSL for riscv32imac-esp-espidf

my Cargo.toml

[package]
name = "confused-opcua"
version = "0.1.0"
edition = "2021"
resolver = "2"
rust-version = "1.77"

[[bin]]
name = "confused-opcua"
harness = false # do not use the built in cargo test harness -> resolve rust-analyzer errors

[profile.release]
opt-level = "s"

[profile.dev]
debug = true    # Symbols are nice and they don't increase the size on Flash
opt-level = "z"

[features]
default = []
pio = ["esp-idf-svc/pio"]
experimental = ["esp-idf-svc/experimental"]
vendored-openssl = ["opcua/vendored-openssl"]

[dependencies]
log = "0.4"
esp-idf-svc = { version = "0.49", features = ["critical-section", "embassy-time-driver", "embassy-sync"] }
esp-idf-sys = { version = "0.35.0", features = ["binstart"] }
esp-idf-hal = "0.44.1"
esp-println = { version = "0.12.0", features = ["esp32c6"] }
embedded-hal = "1.0.0"
embedded-svc = "0.28.0"
heapless = "0.8.0"
dotenv = "0.15.0"
opcua = { version = "0.12.0", features = ["server", "vendored-openssl"] }
openssl = { version = "0.10", features = ["vendored"] }

[build-dependencies]
embuild = "0.32.0"
cc = "1.2.4"

my rust-toolchain.toml

[toolchain]
channel = "esp" 
components = ["rust-src"]
@ivmarkov
Copy link
Collaborator

openssl is not supported with esp-idf-sys. mbedtls is.
Whatever you try to port to the esp, keep in mind that the chip has < 400KB RAM, of which available to you (after wifi and other stacks are initialized) will be 200 - 250?KB at most.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants