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

[audit] new port #39587

Merged
merged 27 commits into from
Jul 5, 2024
Merged

[audit] new port #39587

merged 27 commits into from
Jul 5, 2024

Conversation

t43rr7
Copy link
Contributor

@t43rr7 t43rr7 commented Jun 28, 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.
@t43rr7
Copy link
Contributor Author

t43rr7 commented Jun 28, 2024

@microsoft-github-policy-service agree company="F.A.C.C.T."

@t43rr7 t43rr7 changed the title Libaudit port Jun 29, 2024
@WangWeiLin-MV WangWeiLin-MV added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jul 1, 2024
ports/libaudit/vcpkg.json Outdated Show resolved Hide resolved
ports/libaudit/0000-add-missing-unistd-include.patch Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/vcpkg.json Outdated Show resolved Hide resolved
@WangWeiLin-MV
Copy link
Contributor

Note: I will be converting your PR to draft status. Please click "Ready for review" after making the fix and modifications.

@WangWeiLin-MV WangWeiLin-MV marked this pull request as draft July 1, 2024 07:21
t43rr7 and others added 5 commits July 1, 2024 12:24
Co-authored-by: WangWeiLin-MV <156736127+WangWeiLin-MV@users.noreply.github.com>
Co-authored-by: WangWeiLin-MV <156736127+WangWeiLin-MV@users.noreply.github.com>
Co-authored-by: WangWeiLin-MV <156736127+WangWeiLin-MV@users.noreply.github.com>
@t43rr7 t43rr7 requested a review from WangWeiLin-MV July 1, 2024 09:40
@t43rr7 t43rr7 marked this pull request as ready for review July 1, 2024 09:41
@WangWeiLin-MV
Copy link
Contributor

Run command vcpkg x-add-version --all --overwrite-version will fix the version database.

@t43rr7
Copy link
Contributor Author

t43rr7 commented Jul 1, 2024

@WangWeiLin-MV do you have any comments to this PR?

ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/portfile.cmake Outdated Show resolved Hide resolved
ports/libaudit/usage Outdated Show resolved Hide resolved
t43rr7 and others added 5 commits July 2, 2024 10:29
Co-authored-by: Kai Pastor <dg0yt@darc.de>
Co-authored-by: Kai Pastor <dg0yt@darc.de>
Co-authored-by: WangWeiLin-MV <156736127+WangWeiLin-MV@users.noreply.github.com>
Co-authored-by: Kai Pastor <dg0yt@darc.de>
Co-authored-by: WangWeiLin-MV <156736127+WangWeiLin-MV@users.noreply.github.com>
WangWeiLin-MV
WangWeiLin-MV previously approved these changes Jul 2, 2024
Copy link
Contributor

@WangWeiLin-MV WangWeiLin-MV left a comment

Choose a reason for hiding this comment

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

The port usage tests pass with the following triplets:

  • x64-linux
@t43rr7
Copy link
Contributor Author

t43rr7 commented Jul 2, 2024

@WangWeiLin-MV, do you think that removing the usage file is a good idea? It is usually not clear how to link the library and add the include and build flags to a CMake project with vcpkg for a port that is not a CMake target.

@WangWeiLin-MV
Copy link
Contributor

@t43rr7 After installed, vcpkg will give the heuristics usage #39587 (comment) like that:

libaudit provides pkg-config modules:
    # Libraries needed for apps that use the kernel audit framework
    audit
    # Library for apps that want to parse and interpret audit events
    auparse
@t43rr7
Copy link
Contributor Author

t43rr7 commented Jul 2, 2024

vcpkg will give the heuristics usage

@WangWeiLin-MV Can you explain how does it work? Just for information. Thanks

@WangWeiLin-MV WangWeiLin-MV added the info:reviewed Pull Request changes follow basic guidelines label Jul 2, 2024
@dg0yt
Copy link
Contributor

dg0yt commented Jul 2, 2024

Can you explain how does it work?

/share/<PORT>/usage is for vcpkg install <pkg>. If a port doesn't install that file, vcpkg has heuristics which look for CMake config and pkg-config files, and it prints generated usage info. For pkg-config, it is pretty accurate.

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.

(Community feedback)

Comment on lines 1 to 2
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

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
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

Similar to libcgroup, this shouldn't be there if it is not an upstream restriction.

OPTIONS
--with-python3=no
--with-golang=no
--with-io_uring=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 liburing 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.

I didn't try to build audit with io_uring support in this port, but I think that there may be same issues encountered as the were at libcgroup port. So let's keep io_uring unsupported in this port for now.

ports/libaudit/vcpkg.json Outdated Show resolved Hide resolved
@JavierMatosD
Copy link
Contributor

As @dg0yt mentioned, it appears that the package is named audit and vcpkg_check_linkage(ONLY_STATIC_LIBRARY) should only be used if it's an actual restriction.

@JavierMatosD JavierMatosD marked this pull request as draft July 2, 2024 19:30
@WangWeiLin-MV WangWeiLin-MV removed the info:reviewed Pull Request changes follow basic guidelines label Jul 3, 2024
@t43rr7 t43rr7 changed the title [libaudit] new port Jul 3, 2024
@t43rr7
Copy link
Contributor Author

t43rr7 commented Jul 3, 2024

@dg0yt @JavierMatosD

Port renamed: libaudit -> audit.
Removed static check.

See commit

@JavierMatosD JavierMatosD marked this pull request as ready for review July 3, 2024 16:39
Comment on lines 1 to 8
{
"name": "audit",
"version-semver": "4.0.1",
"description": "Library for working with audit subsystem",
"homepage": "https://github.com/linux-audit/audit-userspace",
"license": "GPL-2.0 OR LGPL-2.0",
"supports": "linux"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

As just noted in another port:
Run vcpkg format-manifest ports/audit/vcpkg.json. At least the license field uses deprecated identifiers.
Use version-semver it it can be verified that the project uses semantic versioning.

Everything else LGTM 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regard semver, I cannot find any proof that audit uses semver. Logically I can assume that it keeps backward compatibility through all versions, because commonly it's a system library-wrapper around kernel API. I also haven't found any notes about versioning system it uses. So, seems like you're right, I'll change version-semver to version.

Run vcpkg format-manifest ports/audit/vcpkg.json. At least the license field uses deprecated identifiers.

I don't understand, what output should I get from this command, but I got nothing.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Run vcpkg format-manifest ports/audit/vcpkg.json. At least the license field uses deprecated identifiers.

I don't understand, what output should I get from this command, but I got nothing.

It is primary effect is to create a standardized formatting, so it won't do anything to a properly formatted file.
... but I expected it to also check for deprected licence identifies. I see that this isn't implemented in the tool, only in the GH action at .github/workflows/untrustedPR.yml. You must wait for the workflow, or manually check "Deprecated License Identifiers" at https://spdx.org/licenses/.

Copy link
Contributor

@dg0yt dg0yt Jul 3, 2024

Choose a reason for hiding this comment

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

The GH action did run, but the output is neither complete nor forwarded...

Warning: You have modified or added at least one vcpkg.json where you should check the "license" field.
If you feel able to do so, please consider replacing the deprecated license identifiers in the following files:
ports/audit/vcpkg.json (has deprecated license "GPL-2.0")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The GH action did run, but the output is neither complete nor forwarded...

I fixed the licence

@t43rr7 t43rr7 requested a review from dg0yt July 4, 2024 10:54
Copy link
Contributor

@WangWeiLin-MV WangWeiLin-MV left a comment

Choose a reason for hiding this comment

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

The port usage tests pass with the following triplets:

  • x64-linux
  • x64-linux-dynamic
@WangWeiLin-MV WangWeiLin-MV added the info:reviewed Pull Request changes follow basic guidelines label Jul 5, 2024
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.

LGTM. 👍

@JavierMatosD JavierMatosD merged commit 5a9def9 into microsoft:master Jul 5, 2024
17 checks passed
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
4 participants