-
Notifications
You must be signed in to change notification settings - Fork 157
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
fix: mac os x aarch64 sidecar compilation #4809
Conversation
build.rs
Outdated
@@ -10,6 +10,8 @@ fn main() { | |||
if !is_docs_rs() && is_sidecar_ffi_enabled() { | |||
println!("cargo:rustc-cfg=f3sidecar"); | |||
std::env::set_var("GOWORK", "off"); | |||
// See <https://github.com/golang/go/issues/58159> |
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.
Is this still relevant?
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.
It is relevant to see why netgo is enabled. If it weren't - we could use the linked implementation instead.
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.
The issue talks about -lresolv
which is not used here and I cannot find a mention of netgo
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.
This issue talks about both -lresolv
and -tags=netgo
. There isn't a pure issue as this has been mentioned for iOS
builds and mac builds. This gives some context into what's happening with the linking and is the most detailed issue I have seen on the subject, though I time-boxed this.
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.
Let me see if I can find a direct link to a relevant comment instead.
@@ -10,6 +10,8 @@ fn main() { | |||
if !is_docs_rs() && is_sidecar_ffi_enabled() { | |||
println!("cargo:rustc-cfg=f3sidecar"); | |||
std::env::set_var("GOWORK", "off"); | |||
// See <https://github.com/golang/go/issues/58159> | |||
std::env::set_var("GOFLAGS", "-tags=netgo"); |
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.
What's the pros and cons of using netgo
? Could you add some comments on why netgo
is needed for macos/arm64
and is used for linux/amd64
and linux/arm64
as well when it's not necessary
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.
done, the are no cons to this really, especially because the sidecar does not heavily rely on name resolution.
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes #4777
Other information and links
Has been tested running on calibnet. Works.
Change checklist