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
Merged

Conversation

t43rr7
Copy link
Contributor

@t43rr7 t43rr7 commented Jul 2, 2024

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.
Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

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

Please reduce the indent to 4 spaces.

ports/libcgroup/portfile.cmake Outdated Show resolved Hide resolved
ports/libcgroup/usage Outdated Show resolved Hide resolved
--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

@t43rr7 t43rr7 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.

@MonicaLiu0311 MonicaLiu0311 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jul 2, 2024
@t43rr7 t43rr7 requested a review from dg0yt July 3, 2024 12:40
"version-semver": "3.1.0",
"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.)

ports/libcgroup/vcpkg.json Outdated Show resolved Hide resolved
@t43rr7 t43rr7 mentioned this pull request Jul 3, 2024
11 tasks
@MonicaLiu0311
Copy link
Contributor

The header files can be found via .pc file.

@MonicaLiu0311 MonicaLiu0311 added the info:reviewed Pull Request changes follow basic guidelines label Jul 5, 2024
@JavierMatosD JavierMatosD merged commit 5763791 into microsoft:master Jul 5, 2024
17 checks passed
Copy link

@GO-NFT-GO GO-NFT-GO left a comment

Choose a reason for hiding this comment

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

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
5 participants