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

Unable to install Rust Library targets #10

Open
neachdainn opened this issue Feb 26, 2019 · 4 comments
Open

Unable to install Rust Library targets #10

neachdainn opened this issue Feb 26, 2019 · 4 comments
Assignees

Comments

@neachdainn
Copy link

neachdainn commented Feb 26, 2019

I'm not sure if this is beyond the scope of this project.


Trying to install a Rust library as part of a CMake project does not work. A (relatively) minimal example can be found here, where CMake crashes with the following message:

-- Configuring done
cmake: /build/cmake/src/cmake-3.13.4/Source/cmGeneratorTarget.cxx:1893: void cmGeneratorTarget::ComputeLinkClosure(const string&, cmGeneratorTarget::LinkClosure&) const: Assertion `impl' failed.
Aborted (core dumped)

I have the following environment:

  • cmake version 3.13.4
  • Rustc 1.32.0
  • Cargo 1.32.0
  • GCC version 8.2.1
  • Linux 4.20.10-arch1-1-ARCH
@neachdainn
Copy link
Author

I can try looking into this myself sometime soon but I'm not sure how much progress I'll be able to make on it.

@ekse
Copy link

ekse commented Feb 27, 2019

Hi Nathan, thanks for the report.

I first tested your minimized case with cmake 3.12.1, it prints the following error:

CMake Error at ffi/CMakeLists.txt:32 (install):
  install TARGETS given target "banyan-ffi" which does not exist in this
  directory.

I get your error with both cmake 3.13 and from the cmake git master branch. There is an open issue (https://gitlab.kitware.com/cmake/cmake/issues/18791) with this exact error message. Unless @awakecoding has an idea what the issue could be, this is probably an issue that has to be fixed upstream.

@neachdainn
Copy link
Author

Based on quickly looking over the CMake issue, that definitely does seem to be like an upstream issue. That being said, is it within the scope of this project to make Rust libraries installable? I would like to be able to install Rust libraries via CMake1 but I understand if that isn't something you wish to support.

1: Really, I want to be able to ExternalProject_Add a Rust library.

@awakecoding
Copy link
Contributor

We currently define an imported cmake target with the library file, but cmake unfortunately forbids the installation of imported targets. The proper way to fix this would be to figure out a way to create the target without defining it as IMPORTED, which could be tricky: https://github.com/Devolutions/CMakeRust/blob/master/cmake/CMakeCargo.cmake#L67

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

No branches or pull requests

3 participants