mirror of
https://github.com/openai/codex.git
synced 2026-12-01 00:20:48 +00:00
try to fix bazel 4
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
diff --git a/http_pkg_archive.bzl b/http_pkg_archive.bzl
|
||||
index 8822c51..a2c7f31 100644
|
||||
--- a/http_pkg_archive.bzl
|
||||
+++ b/http_pkg_archive.bzl
|
||||
@@ -1,9 +1,31 @@
|
||||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "get_auth")
|
||||
@@ -2,6 +2,49 @@
|
||||
load("@bazel_lib//lib:repo_utils.bzl", "repo_utils")
|
||||
|
||||
def _http_pkg_archive_impl(rctx):
|
||||
- rctx.download(
|
||||
- url = rctx.attr.urls,
|
||||
+ if repo_utils.is_darwin(rctx):
|
||||
+ host_xcrun = rctx.which("xcrun")
|
||||
+ if host_xcrun == None:
|
||||
@@ -23,16 +19,35 @@ index 8822c51..a2c7f31 100644
|
||||
+ fail("xcrun --show-sdk-path returned an empty SDK path")
|
||||
+
|
||||
+ rctx.file(rctx.attr.dst + "/BUILD.bazel", rctx.read(Label("//3rd_party/macos_sdk:CLTools_macOSNMOS_SDK.BUILD.bazel")))
|
||||
+ rctx.symlink(sdk_path + "/System", rctx.attr.dst + "/System")
|
||||
+ rctx.symlink(sdk_path + "/usr", rctx.attr.dst + "/usr")
|
||||
+ rctx.execute([
|
||||
+ "mkdir",
|
||||
+ "-p",
|
||||
+ rctx.attr.dst + "/System/Library/Frameworks",
|
||||
+ rctx.attr.dst + "/System/Library/PrivateFrameworks",
|
||||
+ rctx.attr.dst + "/usr",
|
||||
+ ])
|
||||
+ rctx.symlink(sdk_path + "/usr/include", rctx.attr.dst + "/usr/include")
|
||||
+ rctx.symlink(sdk_path + "/usr/lib", rctx.attr.dst + "/usr/lib")
|
||||
+ rctx.symlink(sdk_path + "/Entitlements.plist", rctx.attr.dst + "/Entitlements.plist")
|
||||
+ rctx.symlink(sdk_path + "/SDKSettings.json", rctx.attr.dst + "/SDKSettings.json")
|
||||
+ rctx.symlink(sdk_path + "/SDKSettings.plist", rctx.attr.dst + "/SDKSettings.plist")
|
||||
+
|
||||
+ for include in rctx.attr.includes:
|
||||
+ if include.startswith("System/Library/Frameworks/") and include.endswith("/*"):
|
||||
+ framework = include.removeprefix("System/Library/Frameworks/").removesuffix("/*")
|
||||
+ rctx.symlink(
|
||||
+ sdk_path + "/System/Library/Frameworks/" + framework,
|
||||
+ rctx.attr.dst + "/System/Library/Frameworks/" + framework,
|
||||
+ )
|
||||
+ if include.startswith("System/Library/PrivateFrameworks/") and include.endswith("/*"):
|
||||
+ framework = include.removeprefix("System/Library/PrivateFrameworks/").removesuffix("/*")
|
||||
+ rctx.symlink(
|
||||
+ sdk_path + "/System/Library/PrivateFrameworks/" + framework,
|
||||
+ rctx.attr.dst + "/System/Library/PrivateFrameworks/" + framework,
|
||||
+ )
|
||||
+
|
||||
+ return rctx.repo_metadata(reproducible = False)
|
||||
+
|
||||
+ rctx.download(
|
||||
+ url = rctx.attr.urls,
|
||||
rctx.download(
|
||||
url = rctx.attr.urls,
|
||||
output = ".downloaded.pkg",
|
||||
sha256 = rctx.attr.sha256,
|
||||
canonical_id = " ".join(rctx.attr.urls),
|
||||
|
||||
Reference in New Issue
Block a user