Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexis Lothoré via buildroot" <buildroot@buildroot.org>
To: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Cc: <tim.hammer@nav-timing.safrangroup.com>,
	<nicolas.carrier@nav-timing.safrangroup.com>,
	<buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 3/4] package/openscap: add openscap package
Date: Thu, 31 Jul 2025 14:34:01 +0200	[thread overview]
Message-ID: <DBQ8SCGP37TS.2V8HRWA7RWPTW@bootlin.com> (raw)
In-Reply-To: <20250730190231.51e0715e@windsurf>

On Wed Jul 30, 2025 at 7:02 PM CEST, Thomas Petazzoni via buildroot wrote:
> Hello Alexis,

[...]

>> +		      -DENABLE_OSCAP_UTIL=ON \
>> +		      -DENABLE_OSCAP_UTIL_DOCKER=OFF \
>> +		      -DENABLE_OSCAP_UTIL_CHROOT=OFF \
>> +		      -DENABLE_OSCAP_UTIL_PODMAN=OFF \
>> +		      -DENABLE_OSCAP_UTIL_VM=OFF \
>> +		      -DENABLE_PROBES_WINDOWS=OFF \
>> +		      -DENABLE_TESTS=OFF \
>> +		      -DWITH_CRYPTO=gcrypt \
>> +		      -DENABLE_PYTHON3=ON
>
> Only one tab for the indentation.
>
> Questions:
>
> - You're using WITH_CRYPTO=gcrypt, but you also select
>   BR2_PACKAGE_OPENSSL. You need both?

So from the CMakeLists.txt:

find_package(OpenSSL REQUIRED)
[...]
# WITH_CRYPTO
set(WITH_CRYPTO "gcrypt" CACHE STRING "gcrypt|nss")
if(${WITH_CRYPTO} STREQUAL "nss")
        message("-- Using NSS")
        find_package(NSS)
else()
        message("-- Using GCrypt")
        find_package(GCrypt)
endif()
if(GCRYPT_FOUND OR NSS_FOUND)
        set(CRYPTO_FOUND TRUE)
endif()

it looks like gcrypt/nss is not mandatory. But if I try to configure and
run a build in an environment without libgcrypt, I got same late linkage
error, about some missing crapi_init (no, I am not making this function's
name up...) being missing. It appears that there are code paths
preprocessed conditionnaly on either libgcrypt or nss presence, without any
fallback if none is found. I am not sure if I am facing some optional
dependencies that are not "optional enough" in the code base, or some hard
dpendencies that are not sufficiently enforced in the cmake files. But in
the project current state, the software does not build without libgcrypt.

If I take a further look at the dev doc
(https://github.com/OpenSCAP/openscap/blob/main/docs/developer/developer.adoc),
it seems to hint that libgcrypt is actually needed in any case.

I'll remove the WITH_CRYPTO=gcrypt though, as it is the default value in
CMakeLists.txt.

> - You're setting ENABLE_PYTHON3=ON, but your target package does not
>   depend on host-python3 nor python3 in terms of build dependency.
>   Could you clarify what this ENABLE_PYTHON3 option does?

That's an omission on my side. This ENABLE_PYTHON3 allows building some
bindings (to write some python automation tools based on openscap ?) if the
interpreter is found. I'll remove it.

>> +
>> +HOST_OPENSCAP_CONF_OPTS = \
>> +		      -DENABLE_OSCAP_UTIL=ON \
>> +		      -DENABLE_OSCAP_UTIL_DOCKER=OFF \
>> +		      -DENABLE_OSCAP_UTIL_CHROOT=OFF \
>> +		      -DENABLE_OSCAP_UTIL_PODMAN=OFF \
>> +		      -DENABLE_OSCAP_UTIL_VM=OFF \
>> +		      -DENABLE_PROBES_WINDOWS=OFF \
>> +		      -DENABLE_TESTS=OFF \
>> +		      -DWITH_CRYPTO=gcrypt \
>> +		      -DENABLE_PYTHON3=ON
>> +
>> +ifeq ($(BR2_PACKAGE_ACL),y)
>> +OPENSCAP_DEPENDENCIES += acl
>> +endif
>
> No explicit option to enable/disable ACL support?

Unfortunately no, this is searched unconditionally:

find_package(ACL)
if(ACL_FOUND)
        check_library_exists("${ACL_LIBRARY}" acl_extended_file "" HAVE_ACL_EXTENDED_FILE)
        check_include_file(acl/libacl.h HAVE_ACL_LIBACL_H)
        check_include_file(sys/acl.h HAVE_SYS_ACL_H)
endif()

>> +
>> +ifeq ($(BR2_PACKAGE_LIBCAP),y)
>> +OPENSCAP_DEPENDENCIES += libcap
>> +endif
>
> Same question.

Ditto

Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2025-07-31 12:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 12:47 [Buildroot] [PATCH 0/4] package/compliance-as-code: introduce new package Alexis Lothoré via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 1/4] package/libxmlsec1: Add libxmlsec1 used by openSCAP Alexis Lothoré via buildroot
2025-07-30 16:53   ` Thomas Petazzoni via buildroot
2025-07-30 17:18     ` Alexis Lothoré via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 2/4] package/libcurl: Reapply "libcurl: add host variant" Alexis Lothoré via buildroot
2025-07-30 16:55   ` Thomas Petazzoni via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 3/4] package/openscap: add openscap package Alexis Lothoré via buildroot
2025-07-30 17:02   ` Thomas Petazzoni via buildroot
2025-07-31 12:34     ` Alexis Lothoré via buildroot [this message]
2025-07-31 12:48       ` Thomas Petazzoni via buildroot
2025-07-31 13:14         ` Alexis Lothoré via buildroot
2025-07-31 14:39           ` Thomas Petazzoni via buildroot
2025-07-30 12:47 ` [Buildroot] [PATCH 4/4] package/compliance-as-code: add new package Alexis Lothoré via buildroot
2025-07-30 17:18   ` Thomas Petazzoni via buildroot
2025-07-30 18:09     ` Alexis Lothoré via buildroot
2025-07-30 19:29       ` Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DBQ8SCGP37TS.2V8HRWA7RWPTW@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=alexis.lothore@bootlin.com \
    --cc=nicolas.carrier@nav-timing.safrangroup.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tim.hammer@nav-timing.safrangroup.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox