Skip to content

Support C compiler build #269

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

Merged

Conversation

ityuhui
Copy link
Member

@ityuhui ityuhui commented Jun 7, 2025

Because the upstream repo changes the compiler to C by OpenAPITools/openapi-generator#20289 , the build failed by default:

CMake Error at /usr/local/share/cmake-3.31/Modules/CheckSymbolExists.cmake:163 (try_compile):
  Unknown extension ".cxx" for file

    /home/runner/work/c/c/kubernetes/build/CMakeFiles/CMakeScratch/TryCompile-NwLhCQ/CheckSymbolExists.cxx

  try_compile() works only for enabled languages.  Currently these are:

    C

We can fix the build error by the following 2 solutions:

  1. Add C++ support to CMakeList.txt
enable_language(CXX)

This change needs to be committed to the upstream repository. Otherwise it will be overwritten every time this client is regenerated.

  1. Change the CheckCXXSymbolExists to CheckSymbolExists to support C compiler.

Now, I would recommend solution 2, since we can support C compiler to compile this project.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 7, 2025
@ityuhui ityuhui changed the title Support pure C compiler build Support C compiler build Jun 7, 2025
@brendandburns
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 7, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, ityuhui

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [brendandburns,ityuhui]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit a1e9776 into kubernetes-client:master Jun 7, 2025
7 of 8 checks passed
@ityuhui ityuhui deleted the yh-c-compiler-20250607 branch June 8, 2025 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants