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

Add the ability to install multiple versions (2.*, 3.*, 4.* ...) on the system simultaneously #8723

Open
winterheart opened this issue Jan 18, 2024 · 3 comments · May be fixed by #8800
Open
Labels
component-platform Portability layer and build scripts enhancement help-wanted This issue is not being actively worked on, but PRs welcome. size-s Estimated task size: small (~2d)

Comments

@winterheart
Copy link

Suggested enhancement

Hello, I'm maintaining the MbedTLS package on the Gentoo Linux system. We have multiple packages that still depend on MbedTLS 2, so in order to build them we need 2.* branches installed. Unfortunately, there are also a number of packages that already require newer version 3.*.
We need to enhance the CMake buildsystem in a way that will allow us to have both 2 and 3 versions. By default, 2 and 3 cannot be installed simultaneously due path conflicts in lib and include directories.

Justification

Mbed TLS needs this because many packages still stick or are unable to migrate to 3 versions. We need a way to install both versions and let packages decide what to choose between them.

See also https://bugs.gentoo.org/805011 for actual problem and rationale.

@davidhorstmann-arm
Copy link
Contributor

Hi,

I'm not familiar with the specifics of your situation , but would #8691 be relevant / solve this issue?

@winterheart
Copy link
Author

@davidhorstmann-arm #8691 is relevant and pc-files should be tweaked in order to find libraries in custom locations.

My proposal is install 2.* into mbedtls2 path while 3.* - into mbedtls3. It should look this:

# Mbed TLS 2
/usr/lib64/mbedtls2/libmbedtls.so.2.28.6
/usr/lib64/mbedtls2/libmbedcrypto.so.2.28.6
/usr/lib64/mbedtls2/libmbedx509.so.2.28.6
# ...
/usr/include/mbedtls2/mbedtls/*.h
/usr/include/mbedtls2/psa/*.h
# Mbed TLS 3
/usr/lib64/mbedtls3/libmbedcrypto.so.3.5.1
/usr/lib64/mbedtls3/libmbedx509.so.3.5.1
/usr/lib64/mbedtls3/libmbedtls.so.3.5.1
/usr/lib64/mbedtls3/libeverest.so
/usr/lib64/mbedtls3/libp256m.so
# ...
/usr/include/mbedtls3/mbedtls/*.h
/usr/include/mbedtls3/psa/*.h
/usr/include/mbedtls3/everest/*.h
# Cmake modules should be named as MbedTLS3
/usr/lib/cmake/MbedTLS3/

Packages can compiles and links with -I/usr/include/mbedtls2 and -L/usr/lib64/mbedtls2 for version 2 and FindPackage(MbedTLS3) for version 3 in cmake project.

@daverodgman daverodgman added enhancement help-wanted This issue is not being actively worked on, but PRs welcome. component-platform Portability layer and build scripts size-s Estimated task size: small (~2d) labels Jan 22, 2024
winterheart added a commit to winterheart/mbedtls that referenced this issue Feb 7, 2024
Define additional INSTALL_MBEDTLS_HEADERS variable in CMake to allow
installing headers to different location (like include/mbedtls2).

See Mbed-TLS#8723 for rationale.

Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
winterheart added a commit to winterheart/mbedtls that referenced this issue Feb 7, 2024
Use standard `CMAKE_INSTALL_INCLUDEDIR` and `CMAKE_INSTALL_LIBDIR` location
to define headers and library installation. This variable can be redefined on
configuration phase to allow install headers and libraries to different
location (like `include/mbedtls2`).

Additionally removing explicit permission rules as they may broke proper
permissions for system installation (like remove executable bit from
libraries). By default CMake sets permissions correctly on all files and
directories.

See Mbed-TLS#8723 for rationale.

Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
winterheart added a commit to winterheart/mbedtls that referenced this issue Feb 7, 2024
Use standard `CMAKE_INSTALL_INCLUDEDIR` location to define headers
installation. This variable can be redefined on configuration phase to
allow install headers to different location (like `include/mbedtls3`).

Additionally removing explicit permission rules as they may broke proper
permissions for system installation (like remove executable bit from
libraries). By default CMake sets permissions correctly on all files and
directories.

See Mbed-TLS#8723 for rationale.

Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
winterheart added a commit to winterheart/mbedtls that referenced this issue Feb 7, 2024
Use standard `CMAKE_INSTALL_INCLUDEDIR` and `CMAKE_INSTALL_LIBDIR`
location to define headers and library installation. This variable can be
redefined on configuration phase to allow install headers and libraries to
different location (like `include/mbedtls3`, Mbed-TLS#8723).

Additionally removing explicit permission rules as they may broke proper
permissions for system installation (like remove executable bit from
libraries). By default CMake sets permissions correctly on all files and
directories.

See Mbed-TLS#8723 for rationale.

Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
@winterheart winterheart linked a pull request Feb 7, 2024 that will close this issue
3 tasks
@VVD
Copy link

VVD commented Aug 24, 2024

Same here for FreeBSD.
www/hiawatha 11.5+ require 3.x, but many others still only support 2.x.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-platform Portability layer and build scripts enhancement help-wanted This issue is not being actively worked on, but PRs welcome. size-s Estimated task size: small (~2d)
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

4 participants