Subject: Re: [bug#42576] [PATCH 1/2] gnu: llvm: Move dynamic libraries to a separate "lib" output.

From: Sarah Morgensen <[email-masked]>
Date: Thu, 23 Sep 2021 17:41:27 -0700

Hello Pierre,

Thanks for your pioneering work on this!

Pierre Neidhardt <[email-masked]> writes:

> Hi Jakub,
>
> Jakub Kądziołka <[email-masked]> writes:
>
>> Pierre,
>>
>> please note that cmake seems to store a list of files installed by the
>> package, which broke cmake-using dependents of clang when we attempted
>> to change the set of files installed: http://issues.guix.gnu.org/41872
>>
>> Did you try building something that depends on LLVM and uses
>> cmake-build-system?
>
> It is broken indeed, this is one of the things that need to be fixed
> before we can merge this patch.
>
> In issue 41872 the problem is with missing .a files.
> A similar issue occurs here since we move files around, but the CMake
> files are not aware of the move.
>
> One possible fix would be to patch the CMake files with the new locations.
> This is rather inelegant though.
>
> A better fix would be to configure CMake to produce the various files
> directly to the right location, e.g. the binary files, the headers and
> the libraries to their own respective outputs.
>
> Any clue if we can do that?

There has been some recent work on this in the LLVM project [0] and in
Nix [1][2], based on the `GnuInstallDirs' CMake module.  It looks like
this would be doable for us, especially if we move in the direction of
'dev' outputs [3].

[0] https://reviews.llvm.org/D99484
[1] https://github.com/NixOS/nikpkgs/pull/111487
[2] https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/compilers/llvm/12
[3] https://lists.gnu.org/archive/html/guix-devel/2021-09/msg00107.html

Perhaps it's time to revive this effort (particularly for clang, which
is a behemoth)?

--
Sarah