Skip to content

Use CGO_ENABLED=1 when building natively on darwin - #11976

Merged
openshift-merge-robot merged 1 commit into
podman-container-tools:mainfrom
jwhonce:issues/10737
Oct 15, 2021
Merged

Use CGO_ENABLED=1 when building natively on darwin#11976
openshift-merge-robot merged 1 commit into
podman-container-tools:mainfrom
jwhonce:issues/10737

Conversation

@jwhonce

@jwhonce jwhonce commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

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 jhonce@redhat.com

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 ashley-cui and cevich October 14, 2021 17:49
@jwhonce jwhonce self-assigned this Oct 14, 2021
@openshift-ci

openshift-ci Bot commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

[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

Details 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

rhatdan commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

LGTM

@ashley-cui

Copy link
Copy Markdown
Contributor

CI :'(

@cevich

cevich commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

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

cevich commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

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 podman-container-tools#10737

Signed-off-by: Jhon Honce <jhonce@redhat.com>
@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
Copy Markdown
Contributor

LGTM
once the CI is righted.

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

rhatdan commented Oct 15, 2021

Copy link
Copy Markdown
Contributor

/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 podman-container-tools:main Oct 15, 2021
@rhatdan

rhatdan commented Oct 15, 2021

Copy link
Copy Markdown
Contributor

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

@zeha

zeha commented Nov 16, 2021

Copy link
Copy Markdown
Contributor

@jwhonce could we get this backported into 3.4 please?

@rhatdan

rhatdan commented Nov 16, 2021

Copy link
Copy Markdown
Contributor

@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