diff --git a/MODULE.bazel b/MODULE.bazel index 3eabec796..e9aec2da7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -7,7 +7,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.3.0") -bazel_dep(name = "apple_support", version = "1.9.0", repo_name = "build_bazel_apple_support") +bazel_dep(name = "apple_support", version = "1.10.1", repo_name = "build_bazel_apple_support") bazel_dep(name = "rules_cc", version = "0.0.2") bazel_dep(name = "platforms", version = "0.0.7") bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") diff --git a/platform_mappings_bzlmod b/platform_mappings_bzlmod index 449c861bc..f2a8d09af 100644 --- a/platform_mappings_bzlmod +++ b/platform_mappings_bzlmod @@ -1,137 +1,137 @@ platforms: - @@apple_support~1.9.0//platforms:macos_x86_64 + @@apple_support~1.10.1//platforms:macos_x86_64 --apple_platform_type=macos --cpu=darwin_x86_64 - @@apple_support~1.9.0//platforms:macos_arm64 + @@apple_support~1.10.1//platforms:macos_arm64 --apple_platform_type=macos --cpu=darwin_arm64 - @@apple_support~1.9.0//platforms:darwin_arm64e + @@apple_support~1.10.1//platforms:darwin_arm64e --apple_platform_type=macos --cpu=darwin_arm64e - @@apple_support~1.9.0//platforms:ios_i386 + @@apple_support~1.10.1//platforms:ios_i386 --apple_platform_type=ios --cpu=ios_i386 - @@apple_support~1.9.0//platforms:ios_x86_64 + @@apple_support~1.10.1//platforms:ios_x86_64 --apple_platform_type=ios --cpu=ios_x86_64 - @@apple_support~1.9.0//platforms:ios_sim_arm64 + @@apple_support~1.10.1//platforms:ios_sim_arm64 --apple_platform_type=ios --cpu=ios_sim_arm64 - @@apple_support~1.9.0//platforms:ios_armv7 + @@apple_support~1.10.1//platforms:ios_armv7 --apple_platform_type=ios --cpu=ios_armv7 - @@apple_support~1.9.0//platforms:ios_arm64 + @@apple_support~1.10.1//platforms:ios_arm64 --apple_platform_type=ios --cpu=ios_arm64 - @@apple_support~1.9.0//platforms:ios_arm64e + @@apple_support~1.10.1//platforms:ios_arm64e --apple_platform_type=ios --cpu=ios_arm64e - @@apple_support~1.9.0//platforms:tvos_x86_64 + @@apple_support~1.10.1//platforms:tvos_x86_64 --apple_platform_type=tvos --cpu=tvos_x86_64 - @@apple_support~1.9.0//platforms:tvos_sim_arm64 + @@apple_support~1.10.1//platforms:tvos_sim_arm64 --apple_platform_type=tvos --cpu=tvos_sim_arm64 - @@apple_support~1.9.0//platforms:tvos_arm64 + @@apple_support~1.10.1//platforms:tvos_arm64 --apple_platform_type=tvos --cpu=tvos_arm64 - @@apple_support~1.9.0//platforms:watchos_i386 + @@apple_support~1.10.1//platforms:watchos_i386 --apple_platform_type=watchos --cpu=watchos_i386 - @@apple_support~1.9.0//platforms:watchos_x86_64 + @@apple_support~1.10.1//platforms:watchos_x86_64 --apple_platform_type=watchos --cpu=watchos_x86_64 - @@apple_support~1.9.0//platforms:watchos_arm64 + @@apple_support~1.10.1//platforms:watchos_arm64 --apple_platform_type=watchos --cpu=watchos_arm64 - @@apple_support~1.9.0//platforms:watchos_armv7k + @@apple_support~1.10.1//platforms:watchos_armv7k --apple_platform_type=watchos --cpu=watchos_armv7k - @@apple_support~1.9.0//platforms:watchos_arm64_32 + @@apple_support~1.10.1//platforms:watchos_arm64_32 --apple_platform_type=watchos --cpu=watchos_arm64_32 flags: --cpu=darwin_x86_64 --apple_platform_type=macos - @@apple_support~1.9.0//platforms:macos_x86_64 + @@apple_support~1.10.1//platforms:macos_x86_64 --cpu=darwin_arm64 --apple_platform_type=macos - @@apple_support~1.9.0//platforms:macos_arm64 + @@apple_support~1.10.1//platforms:macos_arm64 --cpu=darwin_arm64e --apple_platform_type=macos - @@apple_support~1.9.0//platforms:darwin_arm64e + @@apple_support~1.10.1//platforms:darwin_arm64e --cpu=ios_i386 --apple_platform_type=ios - @@apple_support~1.9.0//platforms:ios_i386 + @@apple_support~1.10.1//platforms:ios_i386 --cpu=ios_x86_64 --apple_platform_type=ios - @@apple_support~1.9.0//platforms:ios_x86_64 + @@apple_support~1.10.1//platforms:ios_x86_64 --cpu=ios_sim_arm64 --apple_platform_type=ios - @@apple_support~1.9.0//platforms:ios_sim_arm64 + @@apple_support~1.10.1//platforms:ios_sim_arm64 --cpu=ios_armv7 --apple_platform_type=ios - @@apple_support~1.9.0//platforms:ios_armv7 + @@apple_support~1.10.1//platforms:ios_armv7 --cpu=ios_arm64 --apple_platform_type=ios - @@apple_support~1.9.0//platforms:ios_arm64 + @@apple_support~1.10.1//platforms:ios_arm64 --cpu=ios_arm64e --apple_platform_type=ios - @@apple_support~1.9.0//platforms:ios_arm64e + @@apple_support~1.10.1//platforms:ios_arm64e --cpu=tvos_x86_64 --apple_platform_type=tvos - @@apple_support~1.9.0//platforms:tvos_x86_64 + @@apple_support~1.10.1//platforms:tvos_x86_64 --cpu=tvos_sim_arm64 --apple_platform_type=tvos - @@apple_support~1.9.0//platforms:tvos_sim_arm64 + @@apple_support~1.10.1//platforms:tvos_sim_arm64 --cpu=tvos_arm64 --apple_platform_type=tvos - @@apple_support~1.9.0//platforms:tvos_arm64 + @@apple_support~1.10.1//platforms:tvos_arm64 --cpu=watchos_i386 --apple_platform_type=watchos - @@apple_support~1.9.0//platforms:watchos_i386 + @@apple_support~1.10.1//platforms:watchos_i386 --cpu=watchos_x86_64 --apple_platform_type=watchos - @@apple_support~1.9.0//platforms:watchos_x86_64 + @@apple_support~1.10.1//platforms:watchos_x86_64 --cpu=watchos_arm64 --apple_platform_type=watchos - @@apple_support~1.9.0//platforms:watchos_arm64 + @@apple_support~1.10.1//platforms:watchos_arm64 --cpu=watchos_armv7k --apple_platform_type=watchos - @@apple_support~1.9.0//platforms:watchos_armv7k + @@apple_support~1.10.1//platforms:watchos_armv7k --cpu=watchos_arm64_32 --apple_platform_type=watchos - @@apple_support~1.9.0//platforms:watchos_arm64_32 + @@apple_support~1.10.1//platforms:watchos_arm64_32 diff --git a/swift/internal/actions.bzl b/swift/internal/actions.bzl index cfc87f917..ddb067f9c 100644 --- a/swift/internal/actions.bzl +++ b/swift/internal/actions.bzl @@ -19,6 +19,10 @@ load("@bazel_skylib//lib:types.bzl", "types") load(":features.bzl", "are_all_features_enabled") load(":toolchain_config.bzl", "swift_toolchain_config") +# This is a proxy for being on bazel 7.x which has +# --incompatible_merge_fixed_and_default_shell_env enabled by default +USE_DEFAULT_SHELL_ENV = not hasattr(apple_common, "apple_crosstool_transition") + # The names of actions currently supported by the Swift build rules. swift_action_names = struct( # Extracts a linker input file containing libraries to link from a compiled @@ -269,5 +273,6 @@ def run_toolchain_action( ), mnemonic = mnemonic if mnemonic else action_name, tools = depset(tools, transitive = [tool_config.tool_inputs]), + use_default_shell_env = USE_DEFAULT_SHELL_ENV, **kwargs ) diff --git a/swift/internal/swift_grpc_library.bzl b/swift/internal/swift_grpc_library.bzl index a12a2bcd5..03458df34 100644 --- a/swift/internal/swift_grpc_library.bzl +++ b/swift/internal/swift_grpc_library.bzl @@ -37,6 +37,7 @@ load(":providers.bzl", "SwiftInfo", "SwiftProtoInfo", "SwiftToolchainInfo") load(":swift_common.bzl", "swift_common") load(":transitions.bzl", "proto_compiler_transition") load(":utils.bzl", "compact", "get_providers") +load(":actions.bzl", "USE_DEFAULT_SHELL_ENV") def _register_grpcswift_generate_action( label, @@ -187,6 +188,7 @@ def _register_grpcswift_generate_action( mnemonic = "ProtocGenSwiftGRPC", outputs = generated_files, progress_message = "Generating Swift sources for %{label}", + use_default_shell_env = USE_DEFAULT_SHELL_ENV, ) return generated_files diff --git a/swift/internal/swift_protoc_gen_aspect.bzl b/swift/internal/swift_protoc_gen_aspect.bzl index a36b1b474..06039c05c 100644 --- a/swift/internal/swift_protoc_gen_aspect.bzl +++ b/swift/internal/swift_protoc_gen_aspect.bzl @@ -38,6 +38,7 @@ load( load(":providers.bzl", "SwiftInfo", "SwiftProtoInfo", "SwiftToolchainInfo") load(":swift_common.bzl", "swift_common") load(":utils.bzl", "get_providers") +load(":actions.bzl", "USE_DEFAULT_SHELL_ENV") # The paths of proto files bundled with the runtime. This is mainly the well # known type protos, but also includes descriptor.proto to make generation of @@ -234,6 +235,7 @@ def _register_pbswift_generate_action( protoc_executable, protoc_plugin_executable, ], + use_default_shell_env = USE_DEFAULT_SHELL_ENV, ) return generated_files diff --git a/swift/module_name.bzl b/swift/module_name.bzl index 4fb0cec07..761ace000 100644 --- a/swift/module_name.bzl +++ b/swift/module_name.bzl @@ -16,8 +16,6 @@ load("@bazel_skylib//lib:types.bzl", "types") -visibility("public") - def derive_swift_module_name(*args): """Returns a derived module name from the given build label. diff --git a/swift/repositories.bzl b/swift/repositories.bzl index da973e1ae..42365c8b5 100644 --- a/swift/repositories.bzl +++ b/swift/repositories.bzl @@ -57,8 +57,8 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True): _maybe( http_archive, name = "build_bazel_apple_support", - url = "https://github.com/bazelbuild/apple_support/releases/download/1.9.0/apple_support.1.9.0.tar.gz", - sha256 = "b506c67200a6a64476b5615db20c887a0ff33128acaa3148a5c9e5167c4a075e", + url = "https://github.com/bazelbuild/apple_support/releases/download/1.10.1/apple_support.1.10.1.tar.gz", + sha256 = "62cb8c6658739d22986bbe4b025fe9f0f42cce91394096dc85d64b120ccde229", ) _maybe(