[llvm-dev] Improving deb packages

Paweł Bylica via llvm-dev llvm-dev at lists.llvm.org
Sat Jul 23 14:42:20 PDT 2016


I complained about the deb packages couple of times previously, even fixed
some issues in packaging. I'm mostly interested in having reliable share
cmake files available in llvm-dev packages. The version 3.7 was fine, but
3.8+ have regressions.

I'm not here to blame anybody. I would like to identify the issues and
discuss long term solutions.

I started with building very simple test framework that checks different
Ubuntu/Debian versions and currently supported LLVM versions. The first and
only test just checks find_package(LLVM CONFIG) cmake function.

I've tested {3.8, 3.9, 4.0} x {xenial, jessie} using docker images and
Travis CI.
As you can see, only the 3.8 on Jessie passed the test.

Issues I've identified:

   1. Packaging adds version prefix to binaries, directories, etc. -- eg.
   llc is renamed to llc-3.8. I'm not sure how it is done, but maybe we should
   add support for such feature to LLVM's cmake?
   2. Default install location for cmake shared files is
   <prefix>/lib/llvm/share/llvm/cmake. find_package() is not able to find them
   there as it is non-standard path. find_package() needs a hint, like setting
   LLVM_DIR variable as in
   If we moved the cmake shared files to <prefix>/lib/llvm/cmake no hint
   would be needed.
   3. On Ubuntu, packaging script moves cmake shared files to
   <prefix>/share/llvm-X.Y/cmake. I'm guessing to solve the issue (2).
   find_package() is able to find LLVMConfig.cmake file without any hint, but
   this file contains absolute paths referencing previous locations of other
   files. You usually get issues like this one:

   CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:181 (include):
   include could not find load file:

   Maybe it is good idea to include other cmake files assuming there are
   located next to the main file instead of relying on absolute paths.
   4. It's a bit weird Debian and Ubuntu packages has different layout of
   installed shared files.
   5. Packages 3.9+ does not have any cmake's shared files, just empty dirs
   where those files are supposed to be. That might be a bug in the latest
   packaging script.

- Paweł
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160723/20a00bb0/attachment.html>

More information about the llvm-dev mailing list