From ba3fce17df72408e8289ddc7f07ef607be1b426e Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Wed, 29 Jul 2026 14:50:21 +0200 Subject: [PATCH] Add `posix` convenience to os_select `posix` sets the shared value for both `linux` and `macos`. It is mutually exclusive with either of them and fails if supplied together with `linux` or `macos`. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c5c5b0bf-4afa-468c-b2dd-197d80932b4b --- misc/bazel/os.bzl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/bazel/os.bzl b/misc/bazel/os.bzl index a3fee479dbc..6b9b71cb016 100644 --- a/misc/bazel/os.bzl +++ b/misc/bazel/os.bzl @@ -57,12 +57,19 @@ def os_select( linux = None, windows = None, macos = None, + posix = None, default = None): """ Choose a value based on the target OS, ignoring the architecture. This is a thin, OS-only wrapper around `codeql_platform_select` (Linux gets the same value on both x86_64 and arm64). - See `codeql_platform_select` for macro vs rule usage. + `posix` is a convenience for the value shared by `linux` and `macos`; it is mutually exclusive + with both. See `codeql_platform_select` for macro vs rule usage. """ + if posix != None: + if linux != None or macos != None: + fail("`posix` is mutually exclusive with `linux` and `macos`") + linux = posix + macos = posix return codeql_platform_select( ctx, linux64 = linux,