[dpdk] Disable optional dependencies.#51495
[dpdk] Disable optional dependencies.#51495BillyONeal wants to merge 2 commits intomicrosoft:masterfrom
Conversation
This fixes the CI failures https://dev.azure.com/vcpkg/public/_build/results?buildId=130806&view=results caused by optionally grabbing jansson which exposes unsupported C99 VLAs to MSVC. Also regenerated all patches where the line numbers changed. Co-authored-by: Copilot <copilot@github.com>
| endif | ||
|
|
||
| has_libfdt = false | ||
| -fdt_dep = cc.find_library('fdt', required: false) |
There was a problem hiding this comment.
I am not sure about some of these but they're dependencies not in vcpkg.json.
There was a problem hiding this comment.
AFAICT, libfdt is required to build the IFPGA Rawdev Driver, and the IPN3KE Poll Mode Driver. These drivers may well be important to a user of DPDK, depending on their use-case, and the devices they are looking to interact with.
There was a problem hiding this comment.
AFAICT,
libfdtis required to build the IFPGA Rawdev Driver, and the IPN3KE Poll Mode Driver. These drivers may well be important to a user of DPDK, depending on their use-case, and the devices they are looking to interact with.
Then the port needs to be fixed to arrange for those dependencies to be present.
There was a problem hiding this comment.
AFAIU the patch arranges for the package to not offer this capability. This is fine. No installation order dependency.
There was a problem hiding this comment.
It's fine from vcpkg's perspective but I'm not sure it's fine from dpdk users' perspective. For some of these vcpkg already has the dependency available and I could resolve it the other way (always turn the dependency on).
| endif | ||
|
|
||
| # check for OpenSSL | ||
| -openssl_dep = dependency('openssl', required: false, method: 'pkg-config') |
There was a problem hiding this comment.
The correct change may be to add openssl as a dependency instead?
There was a problem hiding this comment.
AFAICT, openssl is used by the OpenSSL Crypto Poll Mode Driver, and within examples.
|
@kreuzerkrieg @Rastaban @vicroms @ras0219-msft @ljishen |
|
|
||
| # Add a leading zero to the minor version if it consists of only one digit, otherwise the regex does nothing | ||
| string(REGEX REPLACE "^([0-9]+)\\.([0-9])(\\..*)$" "\\1.0\\2\\3" VERSION_REF "${VERSION}") | ||
| # Match both `X.Y` and `X.Y.Z...` forms (optional remainder). |
There was a problem hiding this comment.
That this was wrong and nobody noticed suggests that people don't actually care about this port :(
There was a problem hiding this comment.
Is this transformation even desirable? Would it not be preferable to store the canonical version, as defined by the dpdk project, within dpdk.json?
There was a problem hiding this comment.
I only added the regex in the last update, and during the last adjustment, I must have forgotten to make the group optional after I hadn't forced the period in the group at first ;-). So this issue is in this repo only since 5 days ;-)
There was a problem hiding this comment.
Is this transformation even desirable? Would it not be preferable to store the canonical version, as defined by the dpdk project, within
dpdk.json?
Desirable, yes. However, there is no suitable version scheme in vcpkg which allows 26.04 without loosing comparing for <.
There was a problem hiding this comment.
Pull request overview
This PR updates the dpdk vcpkg port to avoid non-deterministic optional dependency discovery (notably jansson) that breaks MSVC CI, and bumps the port version accordingly.
Changes:
- Bump
dpdktoport-version: 1and update the versions database/baseline. - Adjust the tag
REFformatting logic inportfile.cmaketo handle bothX.YandX.Y.Z...version forms. - Regenerate/update the DPDK patch set (including disabling several optional Meson dependencies to prevent accidental pickup from the environment).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| versions/d-/dpdk.json | Adds the new 26.3#1 git-tree entry. |
| versions/baseline.json | Bumps the dpdk baseline port-version to 1. |
| ports/dpdk/vcpkg.json | Bumps port-version to 1. |
| ports/dpdk/portfile.cmake | Updates version tag normalization regex used for vcpkg_from_github(REF ...). |
| ports/dpdk/0001-enable-either-static-or-shared-build.patch | Patch regenerated (offset/index updates). |
| ports/dpdk/0002-fix-dependencies.patch | Disables optional Meson deps (e.g., jansson) to avoid unintended discovery; other adjustments retained. |
| ports/dpdk/0003-remove-examples-src-from-datadir.patch | Patch regenerated (offset/index updates). |
| ports/dpdk/0004-stop-building-apps.patch | Patch regenerated (offset/index updates). |
| ports/dpdk/0005-no-absolute-driver-path.patch | Patch regenerated (offset/index updates). |
| ports/dpdk/0006-rename-sched.h.patch | Patch regenerated (offset/index updates). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pcap_lib = is_windows ? 'wpcap' : 'pcap' | ||
| if not pcap_dep.found() | ||
| # pcap got a pkg-config file only in 1.9.0 | ||
| - pcap_dep = cc.find_library(pcap_lib, required: false) | ||
| + pcap_dep = disabler() |
There was a problem hiding this comment.
That would make the patch longer so I do not want to do that.
I've added several comments, which hopefully add some context, although I will caveat this by saying that I am far from a dpdk expert. My experience of using this port, is that it currently pulls many of the dependencies it requires to build its drivers implicitly from the system on which it is built. This doesn't seem ideal, but probably requires substantial effort to resolve. I'd be wary of disabling dependencies entirely; this is likely to limit the utility of this port, as having the correct drivers available is key to being able to use dpdk effectively. |
|
|
||
| # Add a leading zero to the minor version if it consists of only one digit, otherwise the regex does nothing | ||
| string(REGEX REPLACE "^([0-9]+)\\.([0-9])(\\..*)$" "\\1.0\\2\\3" VERSION_REF "${VERSION}") | ||
| # Match both `X.Y` and `X.Y.Z...` forms (optional remainder). |
There was a problem hiding this comment.
Is this transformation even desirable? Would it not be preferable to store the canonical version, as defined by the dpdk project, within dpdk.json?
| endif | ||
|
|
||
| has_libfdt = false | ||
| -fdt_dep = cc.find_library('fdt', required: false) |
There was a problem hiding this comment.
AFAICT, libfdt is required to build the IFPGA Rawdev Driver, and the IPN3KE Poll Mode Driver. These drivers may well be important to a user of DPDK, depending on their use-case, and the devices they are looking to interact with.
|
|
||
| # check for libbsd | ||
| -libbsd = dependency('libbsd', required: false, method: 'pkg-config') | ||
| +libbsd = disabler() |
There was a problem hiding this comment.
AFAICT, removing the dependency on libbsd won't disable any functionality.
| endif | ||
|
|
||
| -jansson_dep = dependency('jansson', required: false, method: 'pkg-config') | ||
| +jansson_dep = disabler() |
There was a problem hiding this comment.
jansson appears to be used to support telemetry, and enables optional functionality in a number of drivers.
There was a problem hiding this comment.
The problem is that as currently set up it makes things path dependent. That is,
vcpkg install jansson
vcpkg install dpdk
gives a totally different result than
vcpkg install dpdk
vcpkg install jansson
which is why the most recent dpdk update PR landed fine but we have not seen a clean world rebuild since, because jansson happened to get installed first and trigger incompatibilities with MSVC.
The question for purposes of this PR to restore nightly runs is not "would someone like when these optional dependencies are used", but "is the port completely broken for all purposes and we need to try to get vcpkg to provide them instead".
There was a problem hiding this comment.
AFAIU the patch arranges for the package to not offer this capability. This is fine. No installation order dependency.
| endif | ||
|
|
||
| # check for OpenSSL | ||
| -openssl_dep = dependency('openssl', required: false, method: 'pkg-config') |
There was a problem hiding this comment.
AFAICT, openssl is used by the OpenSSL Crypto Poll Mode Driver, and within examples.
|
|
||
| # check for pcap | ||
| -pcap_dep = dependency('libpcap', required: false, method: 'pkg-config') | ||
| +pcap_dep = disabler() |
There was a problem hiding this comment.
AFAICT, libpcap is required by the Pcap Poll Mode Driver, and to enable several other pieces of optional functionality
|
It's worth noting that this port also has several implicit uncontrolled dependencies specified within the There are undoubtedly other uncontrolled dependencies. |
This fixes the CI failures https://dev.azure.com/vcpkg/public/_build/results?buildId=130806&view=results caused by optionally grabbing jansson which exposes unsupported C99 VLAs to MSVC.
Also regenerated all patches where the line numbers changed.