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

Use CGO_ENABLED=1 when building natively on darwin #11976

Merged
merged 1 commit into from
Oct 15, 2021

Conversation

jwhonce
Copy link
Member

@jwhonce jwhonce commented Oct 14, 2021

Need to use CGO for mDNS resolution, but cross builds need CGO disabled
See golang/go#12524 for details

Note: Homebrew forumla will need to be updated to pick up this change

Fixes #10737

Signed-off-by: Jhon Honce [email protected]

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

@jwhonce jwhonce added kind/bug Categorizes issue or PR as related to a bug. Packaging Bug is in a Podman package labels Oct 14, 2021
@jwhonce jwhonce requested review from cevich and ashley-cui October 14, 2021 17:49
@jwhonce jwhonce self-assigned this Oct 14, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 14, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jwhonce

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 14, 2021
@jwhonce jwhonce marked this pull request as draft October 14, 2021 17:49
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 14, 2021
@rhatdan
Copy link
Member

rhatdan commented Oct 14, 2021

LGTM

@ashley-cui
Copy link
Member

CI :'(

@cevich
Copy link
Member

cevich commented Oct 14, 2021

Yeah, this is what I was afraid of. And the sentiment I've run into generally is that CGO is evil and bad and should be avoided at all costs 😕

Looking at the diff, I wonder if the conditional is needed at all. I think you can simply set CGO_ENABLED=1 in podman-remote-darwin since that target will never ever be used for anything but darwin. In other words, I question if CGO_ENABLED=whatever has any impact based on if we're cross-compiling or not.

In case it helps you cycle faster: You can temporarily trick CI into only running certain tasks by making them skip: $CI == $CI. You'll need to fight with the YAML anchors/aliases a bit. But this will let you (for example) only run the "OSX Cross" and "Alt Arch. Cross" tasks instead of waiting for everything else.

@cevich
Copy link
Member

cevich commented Oct 14, 2021

Maybe it doesn't help, but there is a native mDNS package available: https://pkg.go.dev/github.com/hashicorp/mdns

S'pose a call to it would need to be grafted in every single damn place a name-lookup is made 😕

But then at least CGO isn't needed 😁

Need to use CGO for mDNS resolution, but cross builds need CGO disabled
See golang/go#12524 for details

Note: Homebrew forumla will need to be updated to pick up this change

Fixes containers#10737

Signed-off-by: Jhon Honce <[email protected]>
@jwhonce jwhonce removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 14, 2021
@TomSweeneyRedHat
Copy link
Member

LGTM
once the CI is righted.

@jwhonce jwhonce marked this pull request as ready for review October 14, 2021 21:31
@rhatdan
Copy link
Member

rhatdan commented Oct 15, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2021
@openshift-merge-robot openshift-merge-robot merged commit 5ac617a into containers:main Oct 15, 2021
@rhatdan
Copy link
Member

rhatdan commented Oct 15, 2021

@ashley-cui Can we get a new brew build done of podman for MAC?

@zeha
Copy link

zeha commented Nov 16, 2021

@jwhonce could we get this backported into 3.4 please?

@rhatdan
Copy link
Member

rhatdan commented Nov 16, 2021

@zeha open a PR.

@zeha zeha mentioned this pull request Nov 17, 2021
openshift-merge-robot added a commit that referenced this pull request Nov 17, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. Packaging Bug is in a Podman package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman remote bypass system resolver and fails to resolve mDNS hostnames.
7 participants