Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Conversation

@ac000
Copy link
Member

@ac000 ac000 commented Dec 13, 2024

    auto/otel: Remove pkg-config check

    @thresheek reported an issue trying to configure OTEL support on Amazon
    Linux 2
    
      checking for OTEL requirements:
        - checking for rust compiler ... found
        - checking for cargo ... found
        - checking for OpenSSL library ... found
      Package openssl was not found in the pkg-config search path.
      Perhaps you should add the directory containing `openssl.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'openssl' found
    
    We successfully built the test program with '-lssl -lcrypto', but then
    tried to use 'pkg-config openssl --cflags --libs' to override
    NXT_OTEL_LIBS.
    
    On Amazon Linux2 there is no openssl.pc, they have a openssl11.pc.
    
    Let's just remove the pkg-config check, if we get here, we have
    successfully built with '-lssl -lcrypto', so just go with that (it also
    matches what we do in auto/ssltls).
    
    Closes: https://github.com/nginx/unit/issues/1510
    Signed-off-by: Andrew Clayton <a.clayton@nginx.com>

@ac000 ac000 added this to the 1.34 milestone Dec 13, 2024
@ac000 ac000 linked an issue Dec 13, 2024 that may be closed by this pull request
@ac000 ac000 marked this pull request as ready for review December 13, 2024 17:20
@ac000 ac000 requested a review from thresheek December 13, 2024 17:20
@thresheek reported an issue trying to configure OTEL support on Amazon
Linux 2

  checking for OTEL requirements:
    - checking for rust compiler ... found
    - checking for cargo ... found
    - checking for OpenSSL library ... found
  Package openssl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `openssl.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'openssl' found

We successfully built the test program with '-lssl -lcrypto', but then
tried to use 'pkg-config openssl --cflags --libs' to override
NXT_OTEL_LIBS.

On Amazon Linux2 there is no openssl.pc, they have a openssl11.pc.

Let's just remove the pkg-config check, if we get here, we have
successfully built with '-lssl -lcrypto', so just go with that (it also
matches what we do in auto/ssltls).

Reported-by: Konstantin Pavlov <thresh@nginx.com>
Closes: nginx#1510
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
@thresheek
Copy link
Member

I agree with reasoning in #1510 (comment) - this pkg-config call actually shouldnt be required if we already linked with openssl. And if we failed, a caller needs to provide proper --cc-opt and --ld-opt.

LGTM

@ac000 ac000 merged commit ae20ab0 into nginx:master Dec 17, 2024
23 checks passed
@ac000 ac000 deleted the auto-otel branch December 17, 2024 02:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

otel-enabled build fails on systems without openssl.pc

2 participants