Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto/otel: Remove pkg-config check #1513

Merged
merged 1 commit into from
Dec 17, 2024
Merged

auto/otel: Remove pkg-config check #1513

merged 1 commit into from
Dec 17, 2024

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 <[email protected]>

@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 <[email protected]>
Closes: nginx#1510
Signed-off-by: Andrew Clayton <[email protected]>
@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 join this conversation on GitHub. Already have an account? Sign in to comment
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