canonical / canonical/multipass

Issues with 3rd party compilation order

Open
#3,802 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
C++
Stars
9.2k
Forks
829
Avg merge
3d 2h
Merged PRs (30d)
45

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CMakeLists.txt around lines 125-138 and trace how the 3rd-party components are configured. Read 3rd-party/libssh/CMakeLists.txt and ConfigureChecks.cmake, then reproduce the Ubuntu 20.04 container build with Clang. Done means the custom libssh, grpc, and poco builds are available in the required order and the dependency compilation no longer fails to find openssl/des.h.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, grpc
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.