Skip to content

Build fails for dfinity_js_backend canister due to openssl-sys crate linking error #2

Description

@wirapratamaz

When attempting to deploy my canisters using dfx deploy, the build process fails for the dfinity_js_backend canister. The error message indicates that the openssl-sys crate is unable to find the required files to link OpenSSL.

Steps to Reproduce:

  1. Run dfx start --clean to start the local replica.
  2. Run dfx deploy to deploy all canisters.
  3. Observe the build error for the dfinity_js_backend canister.

The build process fails with the following error message:

Error: Command failed: cd .azle/dfinity_js_backend && /root/.config/azle/rust/1.73.0/bin/cargo build --target wasm32-wasi --manifest-path canister/Cargo.toml --release
...
thread 'main' panicked at /root/.config/azle/rust/1.73.0/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.99/build/main.rs:406:13:
OpenSSL libdir at `["/usr/lib64", "/usr/lib"]` does not contain the required files to either statically or dynamically link OpenSSL
...

**Environment:**
- Operating System: [e.g., Ubuntu 20.04]
- Rust Version: [output of `rustc --version`]
- OpenSSL Version: [output of `openssl version`]
- dfx Version: [output of `dfx --version`]

**Attempts to Resolve:**
- Installed `pkg-config` and `libssl-dev`.
- Verified that `pkg-config` is in the PATH.
- Set `OPENSSL_DIR` environment variable.
- Checked permissions and paths for OpenSSL libraries.

Has anyone experienced a similar issue or have any suggestions on what might be wrong with my configuration or build process? What is the best way to resolve this OpenSSL linking problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions