experiment: env vars only
diff --git a/lib/private/run_binary.bzl b/lib/private/run_binary.bzl index 3016790..1eb8074 100644 --- a/lib/private/run_binary.bzl +++ b/lib/private/run_binary.bzl
@@ -59,13 +59,14 @@ for k, v in ctx.attr.env.items(): envs[k] = " ".join([expand_variables(ctx, e, outs = outputs, attribute_name = "env") for e in expand_locations(ctx, v, ctx.attr.srcs).split(" ")]) + inputs = ctx.files.srcs + stamp = maybe_stamp(ctx) if stamp: - inputs = ctx.files.srcs + [stamp.volatile_status_file, stamp.stable_status_file] - envs["BAZEL_STABLE_STATUS_FILE"] = stamp.stable_status_file.path envs["BAZEL_VOLATILE_STATUS_FILE"] = stamp.volatile_status_file.path - else: - inputs = ctx.files.srcs + envs["BAZEL_STABLE_STATUS_FILE"] = stamp.stable_status_file.path + if not stamp.env_vars_only: + inputs = inputs + [stamp.stable_status_file, stamp.volatile_status_file] ctx.actions.run( outputs = outputs,
diff --git a/lib/stamping.bzl b/lib/stamping.bzl index b54977d..ff777a2 100644 --- a/lib/stamping.bzl +++ b/lib/stamping.bzl
@@ -103,6 +103,7 @@ return struct( volatile_status_file = ctx.version_file, stable_status_file = ctx.info_file, + stamp_volatile_only = ctx.attr.stamp_volatile_only, ) return None @@ -126,6 +127,7 @@ default = -1, values = [1, 0, -1], ), + "env_vars_only": attr.bool(), "_stamp_flag": attr.label( doc = "Internal use only. A setting used to determine whether or not the `--stamp` flag is enabled.", default = Label("//lib:stamp"),