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

[libcgroup] added new port #39647

Merged
merged 13 commits into from
Jul 5, 2024
37 changes: 37 additions & 0 deletions ports/libcgroup/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
T3RR7 marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libcgroup/libcgroup
SHA512 29fb7f5c795080cafc27ab99f2f3d7683933515840226564e047605e41a76f7ca31b48c8c9e8e1963eb808e3fc82206ea6ad550c80dcfb745b5cb7425e2875a9
REF "v${VERSION}"
HEAD_REF master
)

message(STATUS "${PORT} currently requires the following libraries from the system package manager:\n"
"\t- <autoconf>\n"
"\t- <automake>\n"
"\t- <libtool>\n\n"
"It can be installed with your package manager"
)

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
OPTIONS
--enable-tools=no
--enable-python=no
--enable-tests=no
--enable-samples=no
--enable-systemd=no
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR there is a systemd port in vcpkg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me, that I tried to link systemd from port and encountered some troubles.

But I'll take a look later and give you know about results, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to include systemd support to this port as a feature?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is okay to have it explicitly turned off if it simplifies initial port acceptance.
Much better than auto-detection!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to include systemd support to this port as a feature?

This is an option. But vcpkg CI will normally build only one configuration.
(What is upstream's default? What is the general expectation?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some nuances with systemd. It's an upstream default.

Build with systemd from vcpkg causes some error that I cannot remember now and need to reproduce.

But the build without one breaks an umbrella header. Unfortunately, libcgroup allow to include only this one via include guards in another headers. This error is caused non-installed systemd.h if systemd is disabled.

My attempts to quickly fix this issue in the upstream today were failed because this header (systemd.h) is used from umbrella include (libcgroup.h) by lex/yacc, that has no ifdefs check.

The solutions I see:

  1. Try again to use systemd from vcpkg and fix encountered errors (if ones will reproduce)
  2. Explicitly disable systemd and place a patch with removing include guard to allow to include other headers explicitly, but not an umbrella header. As the initial solution.

Copy link
Contributor Author

@T3RR7 T3RR7 Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dg0yt I found a commit, that fixes a bug I described above. It's not included to v3.1.0 release.

I think it's better to make this port without systemd support and add it later. For now I'll just include this patch in port as initial solution.

Also I reproduced error with building systemd from vcpkg, it's caused by my local setup: CentOS 7 + clang, and it's enough :) On systemd with:

  • Python lower than 3.7
  • Old automake, autoconf, libtool
  • Old stdc++

It's impossible to build libsystemd given in vcpkg's port.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. It is properly turned off.

--enable-pam=no
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
3 changes: 3 additions & 0 deletions ports/libcgroup/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libcgroup provides pkg-config modules:
# Libraries needed for apps that want to control cgroups
libcgroup
T3RR7 marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions ports/libcgroup/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "libcgroup",
"version-semver": "3.1.0",
MonicaLiu0311 marked this conversation as resolved.
Show resolved Hide resolved
"description": "Library for working with cgroup",
"homepage": "https://github.com/libcgroup/libcgroup",
"license": "LGPL-2.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"license": "LGPL-2.1",
"license": "LGPL-2.1-only",

Do not just apply my suggestion. Also run vcpkg format-manifest ports/libcgroup/vcpkg.json.
(There is a GH action for this, and it would flag certain issues. But it didn't run yet.)

"supports": "linux"
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4268,6 +4268,10 @@
"baseline": "1.13",
"port-version": 4
},
"libcgroup": {
"baseline": "3.1.0",
"port-version": 0
},
"libconfig": {
"baseline": "1.7.3",
"port-version": 5
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libcgroup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "fb3123c574a96bf24c7ca705787c44e230e17235",
"version-semver": "3.1.0",
"port-version": 0
}
]
}
Loading