From 0dca953c099af241144dcda097b3f9c278c29d4f Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Sat, 19 Oct 2024 12:36:21 -0500 Subject: [PATCH] chore: update hidden params --- toolchains/rover/macros.bzl | 4 +--- toolchains/simple-pnpm/macros.bzl | 2 +- toolchains/workspace-pnpm/macros.bzl | 36 ++++++++++++++-------------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/toolchains/rover/macros.bzl b/toolchains/rover/macros.bzl index 10f0768ec3d..9c0f54bf4fc 100644 --- a/toolchains/rover/macros.bzl +++ b/toolchains/rover/macros.bzl @@ -129,6 +129,7 @@ def sdl_impl(ctx: AnalysisContext) -> list[DefaultInfo]: rover_toolchain.output_sdl[DefaultInfo].default_outputs, "--generator-bin", ctx.attrs.generator[RunInfo], + hidden = ctx.attrs.deps_srcs, ) for arg in ctx.attrs.args: cmd.add("--arg", arg) @@ -136,9 +137,6 @@ def sdl_impl(ctx: AnalysisContext) -> list[DefaultInfo]: out.as_output() ) - for deps_src in ctx.attrs.deps_srcs: - cmd.hidden(deps_src) - ctx.actions.run(cmd, category = "sdl") return [DefaultInfo(default_output = out)] diff --git a/toolchains/simple-pnpm/macros.bzl b/toolchains/simple-pnpm/macros.bzl index 04291cc29c9..63a7f86cda2 100644 --- a/toolchains/simple-pnpm/macros.bzl +++ b/toolchains/simple-pnpm/macros.bzl @@ -28,13 +28,13 @@ def build_node_modules_impl(ctx: AnalysisContext) -> list[DefaultInfo]: cmd = cmd_args( ctx.attrs._python_toolchain[PythonToolchainInfo].interpreter, simple_pnpm_toolchain.build_node_modules[DefaultInfo].default_outputs, + hidden = [ctx.attrs.pnpm_lock, ctx.attrs.package_json] ) cmd.add("--root-dir") cmd.add(package_dir) cmd.add(out.as_output()) - ctx.actions.run(cmd, category = "pnpm", identifier = "install") return [DefaultInfo(default_output = out)] diff --git a/toolchains/workspace-pnpm/macros.bzl b/toolchains/workspace-pnpm/macros.bzl index 2de0a77739e..b2e5e44ccbb 100644 --- a/toolchains/workspace-pnpm/macros.bzl +++ b/toolchains/workspace-pnpm/macros.bzl @@ -141,6 +141,7 @@ def build_workspace_node_modules_impl(ctx: AnalysisContext) -> list[DefaultInfo] cmd = cmd_args( ctx.attrs._python_toolchain[PythonToolchainInfo].interpreter, pnpm_toolchain.build_workspace_node_modules[DefaultInfo].default_outputs, + hidden = [ctx.attrs.pnpm_lock] ) if ctx.attrs.root_workspace: cmd.add("--package-dir") @@ -149,7 +150,6 @@ def build_workspace_node_modules_impl(ctx: AnalysisContext) -> list[DefaultInfo] cmd.add("--root-dir") cmd.add(package_dir) cmd.add(out.as_output()) - cmd.hidden([ctx.attrs.pnpm_lock]) ctx.actions.run(cmd, category = "pnpm", identifier = "install") @@ -187,6 +187,7 @@ def build_node_modules_impl(ctx: AnalysisContext) -> list[DefaultInfo]: pnpm_toolchain.build_node_modules[DefaultInfo].default_outputs, "--turbo-bin", ctx.attrs.turbo_bin[RunInfo], + hidden = [ctx.attrs.workspace] ) cmd.add("--package-dir") @@ -199,7 +200,6 @@ def build_node_modules_impl(ctx: AnalysisContext) -> list[DefaultInfo]: cmd.add(out.as_output()) - ctx.actions.run(cmd, category = "pnpm", identifier = identifier + ctx.label.package) return [DefaultInfo(default_output = out)] @@ -1200,13 +1200,13 @@ fi env_json = ctx.attrs.env_json if ctx.attrs.env_json else "" args = cmd_args([ - script, - ctx.label.package, - env_json, - ctx.attrs.command - ]) - args.hidden([ctx.attrs.deps]) - args.hidden([ctx.attrs.srcs]) + script, + ctx.label.package, + env_json, + ctx.attrs.command, + ], + hidden=ctx.attrs.deps + ctx.attrs.srcs + ) return [DefaultInfo(), RunInfo(args = args)] @@ -1249,13 +1249,13 @@ exec pnpm run --report-summary "$npm_run_command" env_json = ctx.attrs.env_json if ctx.attrs.env_json else "" run_cmd_args = cmd_args([ - script, - ctx.label.package, - env_json, - ctx.attrs.command, - ]) - run_cmd_args.hidden([ctx.attrs.deps]) - run_cmd_args.hidden([ctx.attrs.srcs]) + script, + ctx.label.package, + env_json, + ctx.attrs.command, + ], + hidden=ctx.attrs.deps + ctx.attrs.srcs + ) args_file = ctx.actions.write("args.txt", run_cmd_args) return inject_test_run_info( @@ -1392,14 +1392,14 @@ def graphql_codegen_impl(ctx: AnalysisContext) -> list[DefaultInfo]: "--package-dir", cmd_args([build_context.workspace_root, ctx.label.package], delimiter = "/"), "--config", - ctx.attrs.config + ctx.attrs.config, + hidden=ctx.attrs.srcs ) for schema in ctx.attrs.schemas: cmd.add( "--schema", cmd_args(schema), ) - cmd.hidden([ctx.attrs.srcs]) cmd.add(out.as_output()) ctx.actions.run(cmd, category = "codegen")