From d9a550a7d5219e11bd8adb519a16d5a4d508d3c4 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Sat, 3 Aug 2024 20:00:40 -0700 Subject: [PATCH] Support 'bazel run //examples:sieve' (#4185) #4076 changed the rule setup and incidentally stopped supporting `bazel run`. This should make `bazel run` work again. --- bazel/carbon_rules/defs.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bazel/carbon_rules/defs.bzl b/bazel/carbon_rules/defs.bzl index fbe9bab5aa684..f83a3a73b1896 100644 --- a/bazel/carbon_rules/defs.bzl +++ b/bazel/carbon_rules/defs.bzl @@ -58,7 +58,7 @@ def _carbon_binary_impl(ctx): mnemonic = "CarbonLink", progress_message = "Linking " + bin.short_path, ) - return [DefaultInfo(files = depset([bin]))] + return [DefaultInfo(files = depset([bin]), executable = bin)] _carbon_binary_internal = rule( implementation = _carbon_binary_impl, @@ -92,6 +92,7 @@ _carbon_binary_internal = rule( ), "srcs": attr.label_list(allow_files = [".carbon"]), }, + executable = True, ) def carbon_binary(name, srcs):