Skip to content

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

Merged
crazywhalecc merged 1 commit into
v3from
fix/net-snmp-legacy-warning
Oct 22, 2026
Merged

crazywhalecc merged 1 commit into
v3from
fix/net-snmp-legacy-warning

Conversation

@crazywhalecc

Copy link
Copy Markdown
Owner

Reopens #1265 (GitHub refuses to reopen it because the branch was deleted/recreated). Same change, rebased onto latest v3.

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 will verify the stderr output is gone (the test bot does not currently generate an ext test for library-only changes).

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

@henderkes henderkes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

didn't know that extension worked on linux

@crazywhalecc
crazywhalecc merged commit fd08f11 into v3 Oct 22, 2026
12 of 15 checks passed
@crazywhalecc
crazywhalecc deleted the fix/net-snmp-legacy-warning branch October 22, 2026 06:29
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.

2 participants