Skip to main content
Version: 2024.39.54

aspect outputs

Print paths to declared output files

Synopsis

Queries for the outputs declared by actions generated by the given target or the target(s) in the given query expression.

Prints each output file on a line, with the mnemonic of the action that produces it, followed by a path to the file, relative to the workspace root.

You can optionally provide an extra argument, which is a filter on the mnemonic.

'ExecutableHash' is a special value for the mnemonic. This combines the ExecutableSymlink and SourceSymlinkManifest mnemonics, then hashes the outputs of these two. This provides a good hash for an executable target to determine if it has changed.

aspect outputs <expression> [mnemonic] [flags]

Examples

# Show all outputs of the //cli/pro target, which is a go_binary:

% aspect outputs //cli/pro

GoCompilePkg bazel-out/k8-fastbuild/bin/cli/pro/pro.a
GoCompilePkg bazel-out/k8-fastbuild/bin/cli/pro/pro.x
GoLink bazel-out/k8-fastbuild/bin/cli/pro/pro_/pro
SourceSymlinkManifest bazel-out/k8-fastbuild/bin/cli/pro/pro_/pro.runfiles_manifest
SymlinkTree bazel-out/k8-fastbuild/bin/cli/pro/pro_/pro.runfiles/MANIFEST
Middleman bazel-out/k8-fastbuild/internal/_middlemen/cli_Spro_Spro_U_Spro-runfiles

# Show just the output of the GoLink action, which is the executable produced by a go_binary:

% aspect outputs //cli/pro GoLink
bazel-out/k8-fastbuild/bin/cli/pro/pro_/pro

# Show the outputs of all targets that contain the 'deliverable' tag

% aspect outputs 'attr("tags", "\bdeliverable\b", //...)'

ExecutableSymlink bazel-out/darwin-fastbuild/bin/cli/release
SourceSymlinkManifest bazel-out/darwin-fastbuild/bin/cli/release.runfiles_manifest
SymlinkTree bazel-out/darwin-fastbuild/bin/cli/release.runfiles/MANIFEST
Middleman bazel-out/darwin-fastbuild/internal/_middlemen/cli_Srelease-runfiles

Options

  -h, --help   help for outputs

Options inherited from parent commands

      --aspect:config string   User-specified Aspect CLI config file. /dev/null indicates that all further --aspect:config flags will be ignored.
--aspect:interactive Interactive mode (e.g. prompts for user input)

SEE ALSO