mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
build: remove MSVC from Windows Bazel build actions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_script.bzl
|
||||
--- a/cargo/private/cargo_build_script.bzl
|
||||
+++ b/cargo/private/cargo_build_script.bzl
|
||||
@@ -144,9 +144,14 @@ def _rewrite_windows_exec_msvc_cc_args(toolchain, args):
|
||||
@@ -125,9 +125,14 @@ def _rewrite_windows_exec_msvc_cc_args(toolchain, args):
|
||||
if toolchain.target_flag_value != toolchain.exec_triple.str or not toolchain.exec_triple.str.endswith("-pc-windows-msvc"):
|
||||
return args
|
||||
|
||||
@@ -18,7 +18,7 @@ diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_sc
|
||||
if skip_next:
|
||||
skip_next = False
|
||||
continue
|
||||
@@ -161,21 +166,58 @@ def _rewrite_windows_exec_msvc_cc_args(toolchain, args):
|
||||
@@ -142,21 +147,58 @@ def _rewrite_windows_exec_msvc_cc_args(toolchain, args):
|
||||
if arg == "-nostdlibinc" or arg.startswith("--sysroot"):
|
||||
continue
|
||||
|
||||
@@ -84,7 +84,7 @@ diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_sc
|
||||
|
||||
def get_cc_compile_args_and_env(cc_toolchain, feature_configuration):
|
||||
"""Gather cc environment variables from the given `cc_toolchain`
|
||||
@@ -508,15 +550,23 @@ def _cargo_build_script_impl(ctx):
|
||||
@@ -487,15 +529,23 @@ def _cargo_build_script_impl(ctx):
|
||||
cc_toolchain, feature_configuration = find_cc_toolchain(ctx)
|
||||
linker, _, link_args, linker_env = get_linker_and_args(ctx, "bin", toolchain, cc_toolchain, feature_configuration, None)
|
||||
env.update(**linker_env)
|
||||
@@ -114,7 +114,7 @@ diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_sc
|
||||
fallbacks = {
|
||||
"AR": "_fallback_ar",
|
||||
"CC": "_fallback_cc",
|
||||
@@ -542,36 +592,37 @@ def _cargo_build_script_impl(ctx):
|
||||
@@ -521,34 +571,35 @@ def _cargo_build_script_impl(ctx):
|
||||
|
||||
toolchain_tools.append(cc_toolchain.all_files)
|
||||
|
||||
@@ -136,8 +136,6 @@ diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_sc
|
||||
- if not env["AR"]:
|
||||
- env["AR"] = cc_toolchain.ar_executable
|
||||
-
|
||||
- cc_c_args = _strip_stack_protector_for_windows_llvm_mingw(toolchain, cc_c_args)
|
||||
- cc_cxx_args = _strip_stack_protector_for_windows_llvm_mingw(toolchain, cc_cxx_args)
|
||||
- cc_c_args = _rewrite_windows_exec_msvc_cc_args(toolchain, cc_c_args)
|
||||
- cc_cxx_args = _rewrite_windows_exec_msvc_cc_args(toolchain, cc_cxx_args)
|
||||
- # Populate CFLAGS and CXXFLAGS that cc-rs relies on when building from source, in particular
|
||||
@@ -167,8 +165,6 @@ diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_sc
|
||||
+ if not env["AR"]:
|
||||
+ env["AR"] = cc_toolchain.ar_executable
|
||||
+
|
||||
+ cc_c_args = _strip_stack_protector_for_windows_llvm_mingw(toolchain, cc_c_args)
|
||||
+ cc_cxx_args = _strip_stack_protector_for_windows_llvm_mingw(toolchain, cc_cxx_args)
|
||||
+ cc_c_args = _rewrite_windows_exec_msvc_cc_args(toolchain, cc_c_args)
|
||||
+ cc_cxx_args = _rewrite_windows_exec_msvc_cc_args(toolchain, cc_cxx_args)
|
||||
+ # Populate CFLAGS and CXXFLAGS that cc-rs relies on when building from source, in particular
|
||||
|
||||
Reference in New Issue
Block a user