-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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 KUBE_CGO_OVERRIDES env var to force enabling CGO #64219
Add KUBE_CGO_OVERRIDES env var to force enabling CGO #64219
Conversation
why didn't that fail locally? |
Added one small commit to explicitly enable cgo when building kubectl for darwin from darwin, which would eliminate most/all of the homebrew patch. It'd still mean that the "official" kubectl binary for darwin would be statically linked without cgo, but it'd be easy for homebrew users to get a kubectl that works better. I don't have a mac handy to test this right now; can someone else verify that it actually works? e.g. run |
07bad51
to
25a87f0
Compare
25a87f0
to
e4ded2b
Compare
@ixdy on a macbook:
|
@BenTheElder hm, I have no idea if that's actually statically linked or not. Can you also run /retest |
/cc @pwittrock |
I am going to test this locally as well. |
( |
Since otool shows it linked to stuff I bet it will work, but the direct test is to run the binary with If you try this with the current, static builds, you will get this output:
If cgo is available, you'll get this output:
|
@bitglue good point, I checked the docs and it seems now you should use something like
(note: you have to trigger an actual DNS lookup, with kubectl pointed at GKE the control plane has a bare IP address which does not give any output for say |
so assuming I'm reading that right, this means this actually works? |
/retest |
looks like it! :-)
…On Wed, May 23, 2018 at 3:30 PM Jeff Grafton ***@***.***> wrote:
so assuming I'm reading that right, this means this actually works?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#64219 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA4Bq4nhKhm09XJa7CLDLRAvF6jEzvvUks5t1eLsgaJpZM4ULBQB>
.
|
@BenTheElder You shouldn't need to include the
In any case, the debug output does show that cgo is available, so I'm 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, ixdy 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:
Approvers can indicate their approval by writing |
/retest Review the full test history for this PR. Silence the bot with an |
/milestone v1.11 |
[MILESTONENOTIFIER] Milestone Pull Request Labels Incomplete Action required: This pull request requires label changes. If the required changes are not made within 3 days, the pull request will be moved out of the v1.11 milestone. kind: Must specify exactly one of |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 64338, 64219, 64486, 64495, 64347). If you want to cherry-pick this change to another branch, please follow the instructions here. |
@ixdy: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@warmchang see meaning here - https://emojipedia.org/shrug/ |
The original motivation for adding these environment variables (DNS resolution on macOS) has been fixed in Go 1.20 (golang/go#12524 (comment)) So, assuming that these environment variables aren't being used for something else, we can clean this up now. |
🤷 (shrug) |
Awesome!
This is a big assumption 5 years later, we don't know who else is using this and for what reasons. I imagine some distros will still want to build in cgo mode because of quirks between the resolvers though, even if the gap has closed. |
What this PR does / why we need it: as detailed in kubernetes/release#469 (and elsewhere), there is a desire to have
kubectl
built with CGO enabled on mac OS.There currently isn't a great way to do this in our official cross builds, but we should allow mac users to build their own kubectl with CGO enabled if they desire, e.g. through homebrew.
This change enables that; you can now do
KUBE_CGO_OVERRIDES=kubectl make WHAT=cmd/kubectl
and get a cgo-enabledkubectl
.The default build outputs remain unchanged.
Release note:
/assign @BenTheElder @cblecker
cc @bks7 @bitglue