Skip to content

libclang.so becomes difficult to get hold of (and completely missing for x86_64 Windows/Linux/Apple in the latest 18.1.2 clang distro) (LLVM-420) #108

@ivmarkov

Description

@ivmarkov

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

I expect the <ESP-IDF-DIR>/tools/tools.json to have a tool ("clang" or "clang-libs" or similar) that does contain the libclang.so/.dll for all major operating systems, including Windows.

Actual behavior (suspected bug)

Good:
Versions of ESP-IDF <= 5.3 contain the "esp-clang" tool (for versions < 5.1 it is named differently - "xtensa-clang" but is still OK), which - inside - the TGZ tarball does contain both the clang binaries (which we don't need) as well as the libclang.so/dll library. So by downloading this tool, esp-idf-sys can make sure it does have a proper clang library for Rust "bindgen" ("bindgen" uses the library, not the binary)

Not good:
Versions of ESP IDF >= 5.4 still contain the "esp-clang" tool as per above, however with version updated to clang-esp-18.1.2_20240912. This clang version has multiple issues:

  1. It does not contain the libclang.so lib, which makes it backwards incompatible, as found out here. Now, if there is a separate "libs" tarball introduced, the minimum I would expect from such a backwards incompatible change is that there would be a new "tool" in tools.json which is named esp-clang-libs or something, which I can instruct esp-idf-sys to download for newer ESP-IDF versions

  2. However, what is worse is that there is no "libs" tarball for Windows/Linux/Mac x86_64 in the current 18.1.2_20240912 clang distro. How are we supposed to build esp-idf-sys + ESP IDF >= 5.4 then? Sure, I can use an external "clang" for the RiscV targets (though that's very suboptimal as we otherwise use all the ESP IDF tooling for everything else) but what about the xtensa chips?

See also:

Error logs or terminal output

No response

Steps to reproduce the behavior

  1. Look at the tools.json of the cited ESP-IDF versions
  2. Look at this download location for the Espressif clang toolchains: https://github.com/espressif/llvm-project/releases/

Project release version

ESP IDF 5.4 or higher

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Windows/Linux/Mac x86_64

Operating system version

All

Shell

ZSH

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions