llvmenv: fatal error: mach-o/compact_unwind_encoding.h: No such file or directory

See: https://gist.github.com/eggplants/d590f1cb5d2d0ca19aa87e6ed83089f7 This log is the result of trying to run below code on GitHub Actions:

cargo install --git https://github.com/llvmenv/llvmenv -q
llvmenv init
llvmenv build-entry 12.0.0

But it was terminated because an error occurred:

...
2021-09-13T16:04:00.3544688Z [ 79%] Building CXX object tools/lld/MachO/CMakeFiles/lldMachO2.dir/UnwindInfoSection.cpp.o
2021-09-13T16:04:00.4650714Z In file included from /home/runner/.cache/llvmenv/12.0.0/tools/lld/MachO/UnwindInfoSection.cpp:9:
2021-09-13T16:04:00.4653439Z /home/runner/.cache/llvmenv/12.0.0/tools/lld/MachO/UnwindInfoSection.h:15:10: fatal error: mach-o/compact_unwind_encoding.h: No such file or directory
2021-09-13T16:04:00.4655035Z    15 | #include "mach-o/compact_unwind_encoding.h"
2021-09-13T16:04:00.4655865Z       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-09-13T16:04:00.4656632Z compilation terminated.
2021-09-13T16:04:00.4673305Z make[2]: *** [tools/lld/MachO/CMakeFiles/lldMachO2.dir/build.make:90: tools/lld/MachO/CMakeFiles/lldMachO2.dir/UnwindInfoSection.cpp.o] Error 1
2021-09-13T16:04:00.4675085Z make[1]: *** [CMakeFiles/Makefile2:96891: tools/lld/MachO/CMakeFiles/lldMachO2.dir/all] Error 2
2021-09-13T16:04:00.4683395Z make: *** [Makefile:156: all] Error 2
2021-09-13T16:04:00.4705078Z thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: CommandError { errno: 2, cmd: "\"cmake\" \"--build\" \"/home/runner/.cache/llvmenv/12.0.0/build\" \"--target\" \"install\"", stdout: None, stderr: None }', src/bin/llvmenv.rs:173:32
2021-09-13T16:04:00.4706978Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2021-09-13T16:04:00.4721146Z ##[error]Process completed with exit code 101.
2021-09-13T16:04:00.4854596Z Post job cleanup.
...

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 20

Most upvoted comments

I made this work for myself in arch by symlinking the containing folder:

llvmenv --version
llvmenv 0.3.2

# my build command that was failing:
llvmenv build-entry 13.0.0

# my hacky fix that made it work:
ln -s "$HOME/.cache/llvmenv/13.0.0/projects/libunwind/include/mach-o" \
      "$HOME/.cache/llvmenv/13.0.0/tools/lld/MachO/mach-o"

This is super hacky, but creating a “mach-o” folder in “llvm\tools\lld\MachO” and adding “compact_unwind_encoding.h” in it (google it) made it compile for me. No clue if that’s gonna work in the end!

EDIT : It ended up working, but we dont target MacOS, so this code is probably unused for us.

-Mat

I solved it with this apk add llvm-libunwind-dev.

ln -s "$HOME/.cache/llvmenv/13.0.0/projects/libunwind/include/mach-o" \
      "$HOME/.cache/llvmenv/13.0.0/tools/lld/MachO/mach-o"

worked for me. thank you @keywordsalad

Oh, without llvmenv… I’ll try to build with llvmenv based on your Dockerfile.

Thank you so much for your sharing!

@eggplants https://github.com/D3vl0per/zphinx-zerver-docker/blob/main/Dockerfile.essetials-builder Built images are available at these mirror:

  • r.zsibok.hu/zphinx-zerver-docker/essetials-builder:13.0.0
  • r.zsibok.hu/zphinx-zerver-docker/essetials-builder:13.0.1-rc1
  • ghcr.io/d3vl0per/zphinx-zerver-docker/essetials-builder:13.0.0
  • ghcr.io/d3vl0per/zphinx-zerver-docker/essetials-builder:13.0.1-rc1
  • d3vm/zphinx-zerver-docker:essetials-builder-13.0.1-rc1
  • d3vm/zphinx-zerver-docker:essetials-builder-13.0.0

Getting this as well on Ubuntu 21.10. See also https://groups.google.com/g/llvm-dev/c/gIY5COm6V5E.