microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.06k stars 6.36k forks source link

[many ports] Respect `VCPKG_LIBRARY_LINKAGE` on Linux #26551

Open Thomas1664 opened 2 years ago

Thomas1664 commented 2 years ago

References: #25077, #26545, #26549

Many ports are building shared libraries although our Linux triplet requests static libraries and the ports are capable of building static libraries.

Background

Many ports don't support shared libraries on Windows because they have nothing to dllexport. However, Linux .so files don't require that symbols are marked as "exportable". Consequently, many ports default to static libraries on Windows and shared libraries on Linux. Unfortunately, they often don't respect BUILD_SHARED_LIBS and introduce their own flag (e.g. this patch). Consequently, they build .so files and store them in /lib.

Reproduce

Search in the file lists of Linux world rebuilds for .so. Keep in mind that there are some false positives.

Proposed solution

Maybe we should add a post build check that disallows .so files in the lib folder and add a flag to disable this check for ports that only support shared libraries. Obviously, we need to fix affected ports to align with our VCPKG_LIBRARY_LINKAGE setting.

github-actions[bot] commented 11 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Thomas1664 commented 11 months ago

no stale

github-actions[bot] commented 5 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Thomas1664 commented 5 months ago

No stale