Skip to content
Draft
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
13 changes: 7 additions & 6 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:engflow_common --disk_cache=
build:engflow_common --incompatible_strict_action_env=true
build:engflow_common --remote_timeout=3600
build:engflow_common --grpc_keepalive_time=30s
build:engflow_common --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:engflow_common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

# Options for continuous testing.
build:ci --color=yes
Expand All @@ -33,7 +33,7 @@ build:clang --host_cxxopt="-fvisibility=hidden"
# iOS setup
build:ios --ios_multi_cpus=sim_arm64
build:ios --macos_cpus=arm64
build:ios --@rules_apple//apple/build_settings:ios_simulator_device="iPhone 16 Pro"
build:ios --@rules_apple//apple/build_settings:ios_simulator_device="iPhone 17"

# Platform-specific options for each supported platform.
build:remote_linux_x64 --extra_execution_platforms=//platform/linux_x64
Expand All @@ -45,15 +45,16 @@ build:remote_macos_arm64 --config=clang
build:remote_macos_arm64 --host_platform=//platform/macos_arm64
build:remote_macos_arm64 --platforms=//platform/macos_arm64
build:remote_macos_arm64 --macos_minimum_os=14
build:remote_macos_arm64 --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote_macos_arm64 --host_action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote_macos_arm64 --xcode_version_config=//platform/macos_arm64:installed_xcodes
build:remote_macos_arm64 --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote_macos_arm64 --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1
build:remote_macos_arm64 --xcode_version_config=//platform/macos_arm64/xcode:installed_xcodes
build:remote_macos_arm64 --extra_toolchains=//platform/macos_arm64/cc:all
# Disable workers: Builds fail with remote swift workers
build:remote_macos_arm64 --experimental_remote_mark_tool_inputs=false

build:remote_windows_x64 --host_platform=//platform/windows_x64
build:remote_windows_x64 --platforms=//platform/windows_x64
build:remote_windows_x64 --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote_windows_x64 --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:remote_windows_x64 --extra_execution_platforms=//platform/windows_x64
build:remote_windows_x64 --extra_toolchains=//platform/windows_x64:cc-toolchain

Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ scala_deps.scala()
scala_deps.scalatest()

bazel_dep(name = "rules_shell", version = "0.8.0")
bazel_dep(name = "bazel_features", version = "1.54.1")
3 changes: 2 additions & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion ios/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_apple//apple:ios.bzl", "ios_application", "ios_ui_test", "ios_unit_test")
load("@rules_apple//apple:macos.bzl", "macos_unit_test")
load("@rules_apple//apple:macos.bzl", "macos_build_test", "macos_unit_test")
load("@rules_apple//apple:resources.bzl", "apple_metal_library")
load("@rules_swift//swift:swift.bzl", "swift_library")

swift_library(
Expand Down Expand Up @@ -63,3 +64,21 @@ macos_unit_test(
],
deps = [":HelloTestLib"],
)

apple_metal_library(
name = "SampleMetal",
srcs = ["sample.metal"],
out = "Sample.metallib",
hdrs = ["shader_defines.h"],
)

macos_build_test(
name = "SampleMetalBuildTest",
minimum_os_version = "14.0",
targets = [
":SampleMetal",
],
tags = [
"no-local-macos-ci", # Mac local will fail (metal not installed)
],
)
5 changes: 5 additions & 0 deletions ios/sample.metal
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <metal_stdlib>

using namespace metal;

// Just exists to make the compiler do some work.
6 changes: 6 additions & 0 deletions ios/shader_defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef SHADER_DEFINES_H
#define SHADER_DEFINES_H

// Just exists to make the compiler do some work.

#endif
56 changes: 0 additions & 56 deletions platform/macos_arm64/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
load("@apple_support//xcode:available_xcodes.bzl", "available_xcodes")
load("@apple_support//xcode:xcode_config.bzl", "xcode_config")
load("@apple_support//xcode:xcode_version.bzl", "xcode_version")

package(default_visibility = ["//visibility:public"])

# The platform definition for a remote mac worker.
Expand All @@ -17,55 +13,3 @@ platform(
},
)

# The XCode installed on the remote worker.
xcode_version(
name = "version26_5_0_17F42",
aliases = [
"26.5.0",
"26.5",
"17F42",
"26.5.0.17F42",
"26",
],
default_ios_sdk_version = "26.5",
default_macos_sdk_version = "26.5",
default_tvos_sdk_version = "26.5",
default_visionos_sdk_version = "26.5",
default_watchos_sdk_version = "26.5",
version = "26.5.0.17F42",
)

xcode_version(
name = "version27_2_0_27B52",
aliases = [
"27.2.0",
"27.2.0.27B52",
"27B52",
"27.2",
"27",
],
default_ios_sdk_version = "27.2",
default_macos_sdk_version = "27.2",
default_tvos_sdk_version = "27.2",
default_visionos_sdk_version = "27.2",
default_watchos_sdk_version = "27.2",
version = "27.2.0.27B52",
)

xcode_config(
name = "installed_xcodes",
default = ":version26_5_0_17F42",
versions = [
":version26_5_0_17F42",
":version27_2_0_27B52",
],
)

available_xcodes(
name = "available_xcodes",
default = ":version26_5_0_17F42",
versions = [
":version26_5_0_17F42",
":version27_2_0_27B52",
],
)
125 changes: 125 additions & 0 deletions platform/macos_arm64/cc/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Copied from `bazel info output_base`/external/apple_support++apple_cc_configure_extension+local_config_apple_cc_toolchains/BUILD

package(default_visibility = ["//visibility:public"])

load("@apple_support//configs:platforms.bzl", "APPLE_PLATFORMS_CONSTRAINTS")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load("@apple_support//configs:platforms.bzl", "APPLE_PLATFORMS_CONSTRAINTS")
load(":cc_toolchain_config.bzl", "cc_toolchain_config")

_APPLE_ARCHS = APPLE_PLATFORMS_CONSTRAINTS.keys()

CC_TOOLCHAINS = [(
cpu + "|clang",
":cc-compiler-" + cpu,
) for cpu in _APPLE_ARCHS] + [(
cpu,
":cc-compiler-" + cpu,
) for cpu in _APPLE_ARCHS] + [
("k8|clang", ":cc-compiler-darwin_x86_64"),
("darwin|clang", ":cc-compiler-darwin_x86_64"),
("k8", ":cc-compiler-darwin_x86_64"),
("darwin", ":cc-compiler-darwin_x86_64"),
]

cc_library(
name = "link_extra_lib",
)

cc_library(
name = "malloc",
)

filegroup(
name = "empty",
srcs = [],
)

cc_toolchain_suite(
name = "toolchain",
toolchains = dict(CC_TOOLCHAINS),
)

filegroup(
name = "modulemap",
srcs = [
"@apple_support//crosstool:exec_layering_check_modulemap",
],
)

filegroup(
name = "tools",
srcs = [
"@apple_support//crosstool:exec_libtool",
"@apple_support//crosstool:exec_wrapped_clang",
"@apple_support//crosstool:exec_wrapped_clang_pp",
":modulemap",
],
)

[
cc_toolchain(
name = "cc-compiler-" + arch,
all_files = ":tools",
ar_files = ":tools",
as_files = ":tools",
compiler_files = ":tools",
dwp_files = ":empty",
linker_files = ":tools",
objcopy_files = ":empty",
strip_files = ":tools",
supports_header_parsing = 1,
supports_param_files = 1,
toolchain_config = arch,
toolchain_identifier = arch,
module_map = "@apple_support//crosstool:module.modulemap",
)
for arch in _APPLE_ARCHS
]

[
cc_toolchain_config(
name = arch,
cpu = arch,
features = [
"no_warn_duplicate_libraries",
"reproducible_linker_flag",
],
cxx_builtin_include_directories = [
"/Applications/",
"/Library/",
],
libtool = "@apple_support//crosstool:exec_libtool",
tool_paths_overrides = {},
c_flags = [],
conly_flags = [],
cxx_flags = ["-std=c++17"],
link_flags = [],
module_map = ":modulemap",
wrapped_clang = "@apple_support//crosstool:exec_wrapped_clang",
wrapped_clang_pp = "@apple_support//crosstool:exec_wrapped_clang_pp",
)
for arch in _APPLE_ARCHS
]

_OSX_DEVELOPER_PLATFORM_CPUS = [
"arm64",
"x86_64",
]

[
toolchain(
name = "cc-toolchain-" + arch + "-" + cpu,
exec_compatible_with = [
# These only execute on macOS.
"@platforms//os:macos",
"@platforms//cpu:" + cpu,
],
target_compatible_with = APPLE_PLATFORMS_CONSTRAINTS[arch],
toolchain = "@apple_support//toolchain".format(arch),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
visibility = ["//visibility:public"],
)
for arch in APPLE_PLATFORMS_CONSTRAINTS.keys()
for cpu in _OSX_DEVELOPER_PLATFORM_CPUS
]
Loading