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

Enable C language support in meson.build #11

Closed
wants to merge 1 commit into from

Conversation

jtbandes
Copy link

When I tried creating a Dockerfile to build hdoc, I found that the CMake steps failed because C language support was not enabled. Adding 'c' to this list makes things work.

Example failure: https://gist.github.com/jtbandes/b5eea7b8543fa3c1681dda1837e6a0a0

Determining dependency 'LLVM' with CMake executable '/usr/bin/cmake'
Try CMake generator: Ninja

...

CMake failed for generator Ninja and package LLVM with error code 1
OUT:

...

-- Could NOT find FFI (missing: HAVE_FFI_CALL) 
-- Could NOT find Terminfo (missing: Terminfo_LINKABLE) 
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
-- Found LibXml2: /usr/lib/aarch64-linux-gnu/libxml2.so (found version "2.9.13") 
-- Configuring incomplete, errors occurred!
See also "/hdoc/build/meson-private/cmake_LLVM/CMakeFiles/CMakeOutput.log".

ERR:
CMake Error at /usr/share/cmake-3.22/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
  check_source_compiles: C: needs to be enabled before use.
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
  /usr/lib/llvm-14/cmake/FindFFI.cmake:44 (check_c_source_compiles)
  /usr/lib/llvm-14/cmake/LLVMConfig.cmake:242 (find_package)
  CMakeLists.txt:9 (find_package)


CMake Error at /usr/share/cmake-3.22/Modules/Internal/CheckSourceCompiles.cmake:44 (message):
  check_source_compiles: C: needs to be enabled before use.
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/CheckCSourceCompiles.cmake:76 (cmake_check_source_compiles)
  /usr/lib/llvm-14/cmake/FindTerminfo.cmake:21 (check_c_source_compiles)
  /usr/lib/llvm-14/cmake/LLVMConfig.cmake:249 (find_package)
  CMakeLists.txt:9 (find_package)

@hdoc
Copy link
Owner

hdoc commented Mar 26, 2022

This is bizarre and unexpected behavior. Let me see if I can reproduce this locally before I kindly ask you to sign a CAA and merge this. I will get back to you.

@hdoc
Copy link
Owner

hdoc commented Apr 13, 2022

I am unable to replicate this issue locally using my non-Ubuntu development setup. This seems to be related to how Ubuntu packages the LLVM dependencies and we recommend using our prebuilt binaries available at hdoc.io. The frequent dependency breakage introduced by the myriad of distributions out there is precisely why we prefer people use our prebuilt binaries. However, I think it makes sense to accept this patch to reduce the workload on downstream users given that the patch is so small.

For this patch to be accepted I will kindly ask you to sign our Contributor Assignment Agreement (CAA) and email it to cla@hdoc.io so that this can be merged into our repository. This is unfortunately necessary for legal reasons. I have attached the CAA to this comment. Once we've received the CAA we can include this patch into the next release and give you the appropriate credit.

Thank you!

meson-log.txt
hdoc-individual-caa.pdf

@eli-schwartz
Copy link

Relevant: mesonbuild/meson#10249

Probably an LLVM 14 bug: llvm/llvm-project#53950

@hdoc
Copy link
Owner

hdoc commented Apr 13, 2022

Nice! In that case it makes sense to wait for upstream to fix, and users who want to use LLVM 14 should apply this patch on their own or use the prebuilt binaries.

Thank you for finding and linking those issues @eli-schwartz!

@hdoc hdoc closed this Apr 13, 2022
@jtbandes jtbandes deleted the patch-1 branch April 13, 2022 04:17
@hdoc
Copy link
Owner

hdoc commented Jul 23, 2022

This was fixed in the latest release where C language support was added to the meson build configuration. Hopefully this can be removed once it's fixed in upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants