multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Issues with 3rd party compilation order

Open lars18th opened this issue 1 year ago • 7 comments

Describe the bug Manually compiling Multipass the build process stops at some point.

To Reproduce Inside one Ubuntu 20.04 container, the build process compiling with CLang stops with this error:

-- Looking for openssl/des.h - not found
CMake Error at 3rd-party/libssh/libssh/ConfigureChecks.cmake:80 (message):
  Could not detect openssl/des.h
Call Stack (most recent call first):
  3rd-party/libssh/CMakeLists.txt:51 (include)

Expected behavior The problem seems to be related to the order of the 3rd party components: https://github.com/canonical/multipass/blob/6c4b8b4f23462a58c81b708808782e682627bf9b/CMakeLists.txt#L125-L138

If you check the pre-builded vcpkg-ports 3rd party package, it includes custom grpc and poco packages as well. However, the configuration is not using these libs to compile other 3rd party packages. And the same is true for the libssh.

The idea is then: compile first custom libssh, grpc and poco; and after use only these versions to compile all the other dependencies.

I hope you want to improve the compilation process to reduce dependencies and use only the custom build 3rd party libraries. This could facilitate compilation in other environments and reduce compilation time.

lars18th avatar Dec 02 '24 07:12 lars18th

Hi @lars18th , thanks for bringing this to our attention, it's definitely worth exploring further to simplify and improve the build process and, possibly, the build instructions. Since you seem to have investigated the problem and possible solutions, feel free to open a PR and suggest a fix, we're always happy to review and incorporate contributions from the community.

giuliazanchi avatar Dec 03 '24 08:12 giuliazanchi

Hello! Is there any way I could contribute to this issue?

ljonathan0719 avatar Jan 29 '25 01:01 ljonathan0719

Hi @ljonathan0719. Yes, we welcome community contributions, so you can submit a pull request! I suggest starting by finding a simple recipe to reproduce the issue and take it from there (if you haven't yet). Thank you for your interest and let us know if you need further guidance.

ricab avatar Jan 29 '25 11:01 ricab

Hi @ricab , is this issue still up for grabs? Or is someone working on it?

SuhasHareesh avatar Mar 05 '25 01:03 SuhasHareesh

@ljonathan0719 do you mean to pursue #3939 any further? If not, I guess this would be free @SuhasHareesh.

ricab avatar Mar 05 '25 15:03 ricab

I think you need to use add_dependencies(...) to build in a specific order add_dependencies

zizeca avatar Mar 29 '25 21:03 zizeca

I don't see movement here for a while. I'm working on this.

vicdeveloperr avatar May 30 '25 17:05 vicdeveloperr

Why this issue is relevant? I don't have this problem compiling in the latest ubuntu LTS. And this is a no longer supported version.

vicdeveloperr avatar Jun 28 '25 18:06 vicdeveloperr

Why this issue is relevant?

Because we want to compile in any Linux (compatible) environment, not only in supported versions.

Please, try to think on this:

  • Why do we need 3party libraries if we compile for a specific Linux distribution? In this case, the correct strategy would be to install the 3party library on the system and compile with it.

lars18th avatar Jun 29 '25 11:06 lars18th

I understand now. Thanks @lars18th

vicdeveloperr avatar Jun 29 '25 13:06 vicdeveloperr

I have the following error, trying to generate the build system in Ubuntu 20.04:

CMake Error at 3rd-party/vcpkg/scripts/buildsystems/vcpkg.cmake:893 (_find_package):
  By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt6", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt6" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake

  Add the installation prefix of "Qt6" to CMAKE_PREFIX_PATH or set "Qt6_DIR"
  to a directory containing one of the above files.  If "Qt6" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:182 (find_package)

I'm not sure if it's related to this issue.

vicdeveloperr avatar Jul 01 '25 18:07 vicdeveloperr

No, this is related to cmake not being able to find your qt6 installation. How did you install qt and where is that installation? It is possible to tell cmake about the Qt6 installation with a flag.

Edit: it is -DCMAKE_PREFIX_PATH=

tobe2098 avatar Oct 13 '25 07:10 tobe2098