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

Ensure build works on macOS even with overlapping dependencies in /usr/local/include #450

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Exclude all system include directories on macOS.
# TODO: Use {compiler_version} variable.
build:macos --copt=-nostdinc
build:macos --copt=-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
build:macos --copt=-isystem/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include
build:macos --copt=-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
build:macos --copt=-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include

# Enable configurations specific to the host platform.
common --enable_platform_specific_config

Expand Down
2 changes: 2 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ versioned_http_file(
versioned_http_archive(
name = "curl",
build_file = "//bazel/third_party/curl:curl.BUILD",
patch_args = ["-p1"],
patches = ["//bazel/third_party/curl:{version}.patch"],
sha256 = "78a06f918bd5fde3c4573ef4f9806f56372b32ec1829c9ec474799eeee641c27",
strip_prefix = "curl-{version}",
url = "https://curl.se/download/curl-{version}.tar.gz",
Expand Down
16 changes: 16 additions & 0 deletions bazel/third_party/curl/7.85.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/lib/easy_lock.h b/lib/easy_lock.h
index d96e56b8d..92e963240 100644
--- a/lib/easy_lock.h
+++ b/lib/easy_lock.h
@@ -24,6 +24,11 @@

#include "curl_setup.h"

+#if defined(URBIT_RUNTIME_CPU_AARCH64) && defined(URBIT_RUNTIME_OS_DARWIN)
+#undef HAVE_ATOMIC
+#undef HAVE_STDATOMIC_H
+#endif
+
#define GLOBAL_INIT_IS_THREADSAFE

#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x600
Loading