From 3e86721f243a7d135d5b41261dd219b15cff1576 Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Thu, 26 Sep 2024 12:53:21 +0200 Subject: [PATCH 1/6] fix: mac os x aarch64 sidecar compilation --- build.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.rs b/build.rs index f05712bd862e..604ef7764c33 100644 --- a/build.rs +++ b/build.rs @@ -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 + std::env::set_var("GOFLAGS", "-tags=netgo -lresolv"); rust2go::Builder::default() .with_go_src("./f3-sidecar") // the generated Go file has been commited to the git repository, @@ -30,14 +32,9 @@ fn is_docs_rs() -> bool { } fn is_sidecar_ffi_enabled() -> bool { - // Note: arm64 is disabled on MacOS for now as it's reported rust2go build does not work there - if cfg!(all(target_arch = "aarch64", target_os = "macos")) { - false - } else { - // Opt-out building the F3 sidecar staticlib - match std::env::var("FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT") { - Ok(value) => !matches!(value.to_lowercase().as_str(), "1" | "true"), - _ => true, - } + // Opt-out building the F3 sidecar staticlib + match std::env::var("FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT") { + Ok(value) => !matches!(value.to_lowercase().as_str(), "1" | "true"), + _ => true, } } From 82fd7d83f70a6b297b908ee22ab6910bb81000ee Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Thu, 26 Sep 2024 14:04:37 +0200 Subject: [PATCH 2/6] only netgo --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 604ef7764c33..305e95a4dc24 100644 --- a/build.rs +++ b/build.rs @@ -11,7 +11,7 @@ fn main() { println!("cargo:rustc-cfg=f3sidecar"); std::env::set_var("GOWORK", "off"); // See - std::env::set_var("GOFLAGS", "-tags=netgo -lresolv"); + std::env::set_var("GOFLAGS", "-tags=netgo"); rust2go::Builder::default() .with_go_src("./f3-sidecar") // the generated Go file has been commited to the git repository, From b3ca5fe5881d33b7b8daac970e647635a79b557f Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Thu, 26 Sep 2024 14:48:11 +0200 Subject: [PATCH 3/6] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0df5a79325a6..11079022dfcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,9 @@ ### Fixed +- [#4809](https://github.com/ChainSafe/forest/issues/4777) the Mac OS X build on + Apple silicons is now working again. + ## Forest 0.20.0 "Brexit" Non-mandatory release including a number of new RPC methods, fixes, and other From a9072164ba30a0fffe95d7ee20dcb0eca8091a70 Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Thu, 26 Sep 2024 14:49:18 +0200 Subject: [PATCH 4/6] rephrase --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11079022dfcc..da3b10f39246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ ### Fixed - [#4809](https://github.com/ChainSafe/forest/issues/4777) the Mac OS X build on - Apple silicons is now working again. + Apple silicons works ## Forest 0.20.0 "Brexit" From 41af25734dd25dddffd22ef9a2076da4a0691044 Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Thu, 26 Sep 2024 14:57:42 +0200 Subject: [PATCH 5/6] add a comment --- build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.rs b/build.rs index 305e95a4dc24..1ecaf11282c7 100644 --- a/build.rs +++ b/build.rs @@ -10,6 +10,9 @@ fn main() { if !is_docs_rs() && is_sidecar_ffi_enabled() { println!("cargo:rustc-cfg=f3sidecar"); std::env::set_var("GOWORK", "off"); + // `Netgo` is enabled for all the platforms to be consistent across different builds. It + // is using pure Go implementation for functionality like name resolution. In the case of + // sidecar it does not make much difference, but it does fix the Apple silicons builds. // See std::env::set_var("GOFLAGS", "-tags=netgo"); rust2go::Builder::default() From ebe2a3404a1fcac596141f0e220029e0794f2117 Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Thu, 26 Sep 2024 15:11:03 +0200 Subject: [PATCH 6/6] better link --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 1ecaf11282c7..d69b540f4f56 100644 --- a/build.rs +++ b/build.rs @@ -13,7 +13,7 @@ fn main() { // `Netgo` is enabled for all the platforms to be consistent across different builds. It // is using pure Go implementation for functionality like name resolution. In the case of // sidecar it does not make much difference, but it does fix the Apple silicons builds. - // See + // See std::env::set_var("GOFLAGS", "-tags=netgo"); rust2go::Builder::default() .with_go_src("./f3-sidecar")