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

Add ldd-check test to several packages #45433

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

murraybd
Copy link
Member

@murraybd murraybd commented Mar 9, 2025

No description provided.

@murraybd murraybd requested a review from a team as a code owner March 9, 2025 00:36
Copy link
Contributor

octo-sts bot commented Mar 9, 2025

⚠️ EXPERIMENTAL

Please use 👍 or 👎 on this comment to indicate if you agree or disagree with the recommendation.

To provide more detailed feedback please comment on the recommendation prefixed with /ai-verify:

e.g. /ai-verify partially helpful but I also added bash to the build environment

Gen AI suggestions to solve the build error:

Based on the build error, I'll provide a detailed analysis and solution:

• Detected Error:

fatal error: '__config_site' file not found
   13 | #include <__config_site>

• Error Category: Build Configuration/Dependency

• Failure Point: Compiling starter/privileged_service_protocol.cc with clang-17 and libc++

• Root Cause Analysis:
The build is failing because libc++ can't find its configuration file. This typically happens when the libc++ development files are not properly installed or configured in the build environment.

• Suggested Fix:
Add these dependencies to the environment.contents.packages section:

environment:
  contents:
    packages:
      # Add these entries
      - libcxx-17-dev
      - libcxx-17 
      - libcxxabi-17-dev
      - libcxxabi-17

And modify the build flags in the bazel command:

  - runs: |
      # Add these environment variables
      export CXXFLAGS="-stdlib=libc++ -I/usr/include/c++/v1"
      export LDFLAGS="-stdlib=libc++ -L/usr/lib"
      
      bazel build --fission=no --config=clang \
        --cxxopt="-stdlib=libc++" \
        --cxxopt="-I/usr/include/c++/v1" \
        --linkopt="-L/usr/lib" \
        ... # rest of the flags

• Explanation:
The error indicates that clang cannot find the libc++ configuration files. The fix ensures that:

  1. All necessary libc++ development packages are installed
  2. Compiler knows where to find the libc++ headers
  3. Linker knows where to find the libc++ libraries

• Additional Notes:

  • This is a common issue when building with clang + libc++ on systems where gcc/libstdc++ is the default
  • The version numbers of libc++ packages should match the clang version (17 in this case)
  • Make sure the paths match your system's actual library locations

• References:

@octo-sts octo-sts bot added ai/skip-comment Stop AI from commenting on PR bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. labels Mar 9, 2025
@murraybd murraybd enabled auto-merge (squash) March 10, 2025 15:13
Signed-off-by: Brian Murray <brian.murray@chainguard.dev>
Copy link
Member

@smoser smoser left a comment

Choose a reason for hiding this comment

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

How willing would you be to wait for a ldd-check update that included chainguard-dev/tw#20 ?

If we have the ability to use ${{context.name}} , then that means all of these:

    - uses: test/tw/ldd-check
      with:
        packages: abseil-cpp

Turn into:

    - uses: test/tw/ldd-check

It would require

  1. an included change pipelines/test/tw/ldd-check.yaml to use ${{context.name}}
  2. support to be in all necessary places for ${{context.name}} use , which landed Add ${{context.name}} string substitution chainguard-dev/melange#1810

@dannf do you know if 1810 made it into all necesary places?

@murraybd
Copy link
Member Author

How willing would you be to wait for a ldd-check update that included chainguard-dev/tw#20 ?

While I'm not in a hurry I've changes similar to this PR to 225 yaml files and would prefer not to have to redo the work.

@murraybd murraybd merged commit 454fa1a into wolfi-dev:main Mar 11, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/skip-comment Stop AI from commenting on PR bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants