Quick repro: ``` > docker pull weliveindetail/llvm09-apt-exports-repro:19.04 > docker run -it weliveindetail/llvm09-apt-exports-repro:19.04 /bin/bash # cmake -G Ninja -B /home/jitfromscratch-release -DCMAKE_BUILD_TYPE=Release /home/jitfromscratch [...] CMake Error at /usr/lib/llvm-9/lib/cmake/llvm/LLVMExports.cmake:1335 (message): The imported target "FileCheck" references the file "/usr/lib/llvm-9/bin/FileCheck" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained "/usr/lib/llvm-9/lib/cmake/llvm/LLVMExports.cmake" but not all the files it references. Call Stack (most recent call first): /usr/lib/llvm-9/cmake/LLVMConfig.cmake:245 (include) CMakeLists.txt:31 (find_package) ``` I created the image like this: ``` > docker run -it ubuntu:19.04 # apt-get update # apt-get install -y --no-install-recommends ca-certificates wget gnupg software-properties-common # wget https://apt.llvm.org/llvm-snapshot.gpg.key # apt-key add llvm-snapshot.gpg.key # apt-add-repository "deb http://apt.llvm.org/disco/ llvm-toolchain-disco-9 main" # apt-get update # apt-get install -y --no-install-recommends build-essential git cmake cmake-data ninja-build zlib1g-dev llvm-9-dev # git clone https://github.com/weliveindetail/JitFromScratch.git /home/jitfromscratch # cd /home/jitfromscratch # git fetch origin llvm90/master # git checkout llvm90/master # cmake -G Ninja -B /home/jitfromscratch-release -DCMAKE_BUILD_TYPE=Release . ```
How were the releases in the apt packages built? I can reproduce this on Ubuntu 18.04 and 19.04. IIUC we shouldn't have FileCheck here (same for llvm-PerfectShuffle;count;not;yaml-bench?): lib/cmake/llvm/LLVMConfig.cmake 244: set(LLVM_EXPORTED_TARGETS ...;FileCheck;...) lib/cmake/llvm/LLVMExports.cmake 19:foreach(_expectedTarget ...;FileCheck;...) 1083:# Create imported target FileCheck 1084:add_executable(FileCheck IMPORTED) I remember having see this issue at some point. I can try to investigate for a few hours during the week.
LLVM_INSTALL_UTILS=ON causes FileCheck and others to be listed in LLVMExports.cmake Was it used to build the apt packages?
(In reply to Stefan Gränitz from comment #3) > LLVM_INSTALL_UTILS=ON causes FileCheck and others to be listed in > LLVMExports.cmake > > Was it used to build the apt packages? +Sylvestre who knows might know.
Still reproducible
Yeah, I have been on holidays. Don't hesitate to submit a patch next time ;)
I am not sure what you mean by "Don't ship it" FileCheck is installed in the llvm-{7,8,9,...}-tools packages
LLVMExports.cmake from the llvm-9-dev package lists FileCheck & co, but doesn't include the binaries for them.
Because it is shipped as part of llvm-9-tools % dpkg -S FileCheck [...] llvm-9-tools: /usr/lib/llvm-9/bin/FileCheck In command #1 just replace the install by # apt-get install -y --no-install-recommends build-essential git cmake cmake-data ninja-build zlib1g-dev llvm-9-dev llvm-9-tools
Sylvestre: it's unclear to me if there is a problem here. Should the bug be marked wonfix? Or is there a dependency between packages missing? In any case, I'm guessing this isn't a blocker for the release from the llvm side.
Created attachment 22441 [details] bionic llvm-8-dev (working)
Created attachment 22442 [details] bionic llvm-9-dev (broken)
I attached the file in question. Please compare yourself if you want. If the change is on purpose, please explain how external projects are supposed to import LLVM from the apt release.
I am sorry but what should I see in the llvm-*-dev-LLVMExports.cmake files ? Why don't you just add llvm-9-tools in the list of deps ?
(In reply to Sylvestre Ledru from comment #14) > I am sorry but what should I see in the llvm-*-dev-LLVMExports.cmake files ? Please search both files for one of the following terms: FileCheck llvm-PerfectShuffle count not yaml-bench > Why don't you just add llvm-9-tools in the list of deps ? This is a regression. Building any project against llvm-9-dev fails with a CMake configuration error in `find_package(LLVM)`, because it wants to import a target that doesn't exist on disk. It worked perferctly well with llvm-8-dev. If my project is too complicated, this CMakeLists.txt is enough to reproduce it: ``` cmake_minimum_required(VERSION 3.10) project(PR43035) find_package(LLVM) ```
OK Seems it was cause by a change that you made here: https://reviews.llvm.org/D56606 A fix would be indeed to add the deps llvm-9-dev => llvm-9-tools (the package is small - 1.1M installed, so, I don't mind) Stefan, would it make you happy?
Thanks for finding that change. As I mentioned earlier, the proper fix is: DO NOT BUILD the release with `LLVM_INSTALL_UTILS=ON` (default should be OFF). I tried that and it works as expected. Don't you think that's possible? Whenever you build with `LLVM_INSTALL_UTILS=ON`, ship the utils in the same package please. IMHO adding a package dependency is a last resort. I am on parental leave and I really can't spend more time here. I thought I'd report this quickly to avoid a release bug..
I had user requests to provide FileCheck. See: https://bugs.llvm.org/show_bug.cgi?id=27946 https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-3.8/+bug/1700630 And see this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098233.html (I removed them Tue, 08 Mar 2016 in 3.9~svn260851-1) Merging two packages is a pain. I would rather add a dep
I explained the problem and the solution in all possible ways. Don't know what else to say.
ok, thanks anyway, clearly not a blocker for 9.0 fixed by adding a dep: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/commit/cb79a639f54880bfe46167ea332210f3e3aac1a4