Skip to content

fix: silence expected net-snmp legacy provider warning - #1265

Closed
crazywhalecc wants to merge 1 commit into
v3from
fix/net-snmp-legacy-warning
Closed

crazywhalecc wants to merge 1 commit into
v3from
fix/net-snmp-legacy-warning

Conversation

@crazywhalecc

Copy link
Copy Markdown
Owner

Problem

The Linux snmp extension test fails in the CLI smoke test:

Failed to load OpenSSL legacy provider
hello
[ERROR] cli failed smoke test. code: 0, output: Failed to load OpenSSL legacy providerhello

This is not an actual failure: net-snmp 5.10 (snmplib/scapi.c) logs a warning at library init when OSSL_PROVIDER_load(NULL, "legacy") returns NULL. static-php builds OpenSSL with no-legacy, so the provider is intentionally absent.

The warning goes to stderr and the smoke test treats any extra output as a failure, which also makes unrelated PRs (e.g. #1263) red on Linux.

Fix

Patch snmplib/scapi.c to skip that expected warning while keeping the provider load fallback. The patch is a no-op on net-snmp versions without the legacy-provider code.

Validation

  • Local macOS arm64 snmp + CLI build: BUILD SUCCESSFUL; patched scapi.c confirmed.
  • composer test (468), composer analyse, composer cs-fix: clean.
  • Linux CI snmp ext test will verify the stderr output is gone.

net-snmp 5.10 logs "Failed to load OpenSSL legacy provider" from
snmplib/scapi.c during library init. static-php builds OpenSSL with
no-legacy, so the provider is intentionally absent; the warning lands on
stderr and breaks the PHP CLI smoke test in CI.

Drop the warning while keeping the provider load fallback.
@crazywhalecc crazywhalecc added the need-test This PR has not been tested yet, cannot merge now label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

StaticPHP Test Bot

Detected: Extensions: none | Libraries: net_snmp | Targets: none
Active labels: none
Available labels: need-test (gate), test/linux test/windows test/macos (platform), test/tier2 (extra arch), test/php-83 test/php-84 (PHP version), sapi/frankenphp (extra FrankenPHP SAPI build)
Config: Linux x86_64 + Windows x86_64 + macOS arm64 | PHP 8.5 NTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-test This PR has not been tested yet, cannot merge now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant