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

cilium-1.16/1.16.4 package update #34699

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Nov 20, 2024

@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr P1 This label indicates our scanning found High, Medium or Low CVEs for these packages. labels Nov 20, 2024
Copy link
Contributor Author

octo-sts bot commented Nov 20, 2024

Gen AI suggestions to solve the build error:

Let me analyze the build error and provide specific recommendations:

• Detected Error: "Expected vars.CILIUM_PROXY_COMMIT to be 97edc2815e2c6a174d3d12e71731d54f5d32ea16. Please update"

• Error Category: Version/Configuration

• Failure Point: Proxy commit hash verification check in pipeline stage

• Root Cause Analysis: The vars.CILIUM_PROXY_COMMIT value in the melange YAML doesn't match the expected commit hash from the Cilium Dockerfile for version 1.16.4

• Suggested Fix:
Update the CILIUM_PROXY_COMMIT variable in the melange YAML:

vars:
  CILIUM_PROXY_COMMIT: "97edc2815e2c6a174d3d12e71731d54f5d32ea16"

• Explanation:
The build system verifies that the proxy commit hash matches what's expected by the Cilium version being built. This ensures compatibility between Cilium and its envoy proxy component. The current value "0d05e48bfbb8c4737ec40d5781d970a550ed2bbd" needs to be updated to "97edc2815e2c6a174d3d12e71731d54f5d32ea16" to match what's specified in the Cilium 1.16.4 release.

• Additional Notes:

  • This check helps ensure version compatibility between Cilium and its proxy component
  • The commit hash is extracted from the Cilium Dockerfile during build
  • Keeping these aligned is important for proper functionality
  • The error is a guard rail to prevent mismatched component versions

• References:

The fix is straightforward - just update the commit hash in the vars section of the melange YAML to match what's expected by Cilium 1.16.4.

@debasishbsws debasishbsws self-assigned this Nov 20, 2024
Signed-off-by: Debasish Biswas <[email protected]>
Copy link
Contributor Author

octo-sts bot commented Nov 20, 2024

Gen AI suggestions to solve the build error:

Based on the build error output, I'll analyze and provide specific fixes:

• Detected Error: "fatal: Could not parse object '97edc2815e2c6a174d3d12e71731d54f5d32ea16'"

• Error Category: Git/Version

• Failure Point: git-checkout step for cilium/proxy repository in the pipeline

• Root Cause Analysis: The build is failing because it cannot find the specified commit hash (97edc2815e2c6a174d3d12e71731d54f5d32ea16) in the proxy repository when checking out with a depth of 1000 commits

• Suggested Fix:

  1. Update the CILIUM_PROXY_COMMIT variable to match the correct commit hash for Cilium 1.16.4:
vars:
  CILIUM_PROXY_COMMIT: "2c13e1e06c848aeae988ba8e14b2a6608df9b2a5"
  1. Or increase the git clone depth:
- uses: git-checkout
  with:
    repository: https://github.com/cilium/proxy
    branch: v1.29
    depth: 2000  # Increase depth to ensure commit is included
    destination: envoy

• Explanation: The error occurs because the specified commit hash is not found within the fetched history depth. Either the commit hash needs to be updated to match the correct version for Cilium 1.16.4, or the clone depth needs to be increased to include the target commit.

• Additional Notes:

  • The current v1.29 branch HEAD is at 2c13e1e06c848aeae988ba8e14b2a6608df9b2a5
  • You may want to verify the correct commit hash from Cilium 1.16.4's release notes or source
  • Alternatively, you could remove the depth limit entirely, though this would increase clone time

• References:

The most reliable fix would be to update the CILIUM_PROXY_COMMIT to the correct hash for version 1.16.4, as this ensures exact version matching rather than relying on branch state.

Copy link
Contributor Author

octo-sts bot commented Nov 20, 2024

Gen AI suggestions to solve the build error:

Based on the error message and context provided, here's my analysis:

• Detected Error:

Error applying patch @//patches:55b0fc45cfdc2c0df002690606853540cf794fab.patch:
error: patch failed: bazel/repository_locations.bzl:1222
error: bazel/repository_locations.bzl: patch does not apply

• Error Category: Build Configuration/Patch

• Failure Point: Patch application during Bazel build setup

• Root Cause Analysis:
The patch 55b0fc45cfdc2c0df002690606853540cf794fab.patch is failing to apply cleanly to the Envoy repository. This is likely because the target file bazel/repository_locations.bzl has changed in the v1.30 branch of cilium/proxy and no longer matches the patch context.

• Suggested Fix:

  1. Update the patch file to match the current state of the v1.30 branch:
  - uses: patch
    with:
      patches: toolchains-paths.patch

  # Remove or update this patch
  # - uses: patch
  #   with:
  #     patches: envoy-55b0fc45cfdc2c0df002690606853540cf794fab.patch
  1. Or regenerate the patch against the current v1.30 branch:
cd envoy
git diff bazel/repository_locations.bzl > ../new-patch.patch

• Explanation:
The patch is failing because the Envoy codebase has evolved and the patch context no longer matches. This commonly happens when:

  1. The base version changed (v1.30 branch updates)
  2. Line numbers or surrounding context changed
  3. The file structure was modified

• Additional Notes:

  • The patch appears to modify Bazel repository locations
  • Check if the patch is still needed with newer Envoy versions
  • Consider using more robust patching mechanisms like git am
  • Review the v1.30 branch history for relevant changes

• References:

@debasishbsws
Copy link
Member

There is one upstream closed issue i can found envoyproxy/envoy#34368 repeated to this and it seems the problem is with the version of clang and llvm

Signed-off-by: Debasish Biswas <[email protected]>
Copy link
Contributor Author

octo-sts bot commented Nov 21, 2024

Gen AI suggestions to solve the build error:

Based on the build error, here's my analysis and suggested fix:

• Detected Error:

static assertion failed due to requirement 'std::__is_complete_or_unbounded(std::__type_identity<cel::JsonObject>{})': template argument must be a complete class or an unbounded array

• Error Category: Build/Configuration

• Failure Point: C++ template instantiation during compilation of CEL (Common Expression Language) components

• Root Cause Analysis:
The error occurs because the compiler is trying to use forward-declared classes (cel::JsonObject and cel::JsonArray) in contexts that require complete type definitions. This typically happens when the header files are included in incorrect order or missing necessary includes.

• Suggested Fix:
Add a compilation flag to work around the incomplete type issues when building with Bazel:

  - working-directory: envoy
    runs: |
      bazel build --fission=no --config=clang \
        --discard_analysis_cache \
        --nokeep_state_after_build \
        --notrack_incremental_state \
        --conlyopt="-Wno-strict-prototypes" \
        --cxxopt="-fno-strict-aliasing" \
        --verbose_failures -c opt //:cilium-envoy-starter

Add the --cxxopt="-fno-strict-aliasing" flag to the bazel build command.

• Explanation:
The error stems from C++ template instantiation issues with incomplete types. The forward declarations of JsonArray and JsonObject classes are causing problems with std::variant usage. Adding the -fno-strict-aliasing flag helps work around these template instantiation issues by relaxing some of the type checking requirements.

• Additional Notes:

  1. This is a known issue when building Envoy with certain C++ standard library implementations
  2. The fix is a workaround - ideally the code should be restructured to avoid incomplete type issues
  3. The change aligns with how Envoy is typically built in other environments

• References:

@debasishbsws
Copy link
Member

I break down the pipeline and found out the error is coming from running

bazel build --fission=no --config=clang \
        --discard_analysis_cache \
        --nokeep_state_after_build \
        --notrack_incremental_state \
        --conlyopt="-Wno-strict-prototypes" \
        --verbose_failures -c opt //:cilium-envoy

I tried to add --cxxopt="-fno-strict-aliasing" AI suggested did not work.

I found one upstream closed issue envoyproxy/envoy#34368 stating "the currently supported llvm version is 14" and we are using 17.

There is a closed PR envoyproxy/envoy#31894 we are applying as bazel patch while building. The upstream drop that PR after they merge this PR which changes ENVOY_STDLIB=libstdc++ to ENVOY_STDLIB=libc++

I have no clue why we having this error.
I love to sync up with who every picks this, want to learn more about the bazel debugging process.

@debasishbsws
Copy link
Member

All the other one have the same issue while building envoy proxy so marking all of those as blocked and let fix this one, which we can copy over to others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated pr help wanted Extra attention is needed P1 This label indicates our scanning found High, Medium or Low CVEs for these packages. request-version-update request for a newer version of a package squad:lifecycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants