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

apt packages have exports for FileCheck but don't ship it #42380

Closed
weliveindetail opened this issue Aug 18, 2019 · 21 comments
Closed

apt packages have exports for FileCheck but don't ship it #42380

weliveindetail opened this issue Aug 18, 2019 · 21 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular

Comments

@weliveindetail
Copy link
Contributor

Bugzilla Link 43035
Resolution FIXED
Resolved on Aug 28, 2019 06:04
Version 9.0
OS Linux
CC @zmodem,@sylvestre
@weliveindetail
Copy link
Contributor Author

assigned to @sylvestre

@weliveindetail
Copy link
Contributor Author

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 .

@weliveindetail
Copy link
Contributor Author

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.

@weliveindetail
Copy link
Contributor Author

LLVM_INSTALL_UTILS=ON causes FileCheck and others to be listed in LLVMExports.cmake

Was it used to build the apt packages?

@zmodem
Copy link
Collaborator

zmodem commented Aug 20, 2019

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.

@weliveindetail
Copy link
Contributor Author

Still reproducible

@sylvestre
Copy link
Collaborator

Yeah, I have been on holidays.
Don't hesitate to submit a patch next time ;)

@sylvestre
Copy link
Collaborator

I am not sure what you mean by "Don't ship it"

FileCheck is installed in the llvm-{7,8,9,...}-tools packages

@weliveindetail
Copy link
Contributor Author

LLVMExports.cmake from the llvm-9-dev package lists FileCheck & co, but doesn't include the binaries for them.

@sylvestre
Copy link
Collaborator

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

@zmodem
Copy link
Collaborator

zmodem commented Aug 27, 2019

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.

@weliveindetail
Copy link
Contributor Author

@weliveindetail
Copy link
Contributor Author

@weliveindetail
Copy link
Contributor Author

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.

@sylvestre
Copy link
Collaborator

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 ?

@weliveindetail
Copy link
Contributor Author

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(#43035 )

find_package(LLVM)

@sylvestre
Copy link
Collaborator

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?

@weliveindetail
Copy link
Contributor Author

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..

@sylvestre
Copy link
Collaborator

I had user requests to provide FileCheck.

See:
#28320
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

@weliveindetail
Copy link
Contributor Author

I explained the problem and the solution in all possible ways. Don't know what else to say.

@sylvestre
Copy link
Collaborator

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

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular
Projects
None yet
Development

No branches or pull requests

3 participants