Skip to content

//ll:actions.bzl

Actions wiring up inputs, outputs, and tools to emit output files.

Every function in this file wraps ctx.actions.run or ctx.actions.run_shell.

compile_object

compile_object(ctx, in_file, headers, defines, includes, angled_includes, bmis)

Create a compiled object.

parameters

Name Description
ctx The rule context.
in_file The input file to compile.
headers A depset of files made available to the compile action.
defines A depset of defines passed to the compile action.
includes A depset of includes passed to the compile action.
angled_includes A depset of angled includes passed to the compile action.
bmis A depset of tuples (interface, name), each consisting of a binary module interface interface and a module name name.

returns

A tuple (out_file, cdf), of an output file and a compilation database fragment.

compile_objects

compile_objects(ctx, headers, defines, includes, angled_includes, bmis, internal_bmis)

Create compiled objects emitted by the rule.

parameters

Name Description
ctx The rule context.
headers A depset of files made available to compile actions.
defines A depset of defines passed to compile actions.
includes A depset of includes passed to compile actions.
angled_includes A depset of angled includes passed to compile actions.
bmis A depset of tuples (interface, name), each consisting of a binary module interface interface and a module name name.
internal_bmis Like bmis, but can't see the files in bmis during compilation.

returns

A tuple (out_files, cdfs), of output files and compilation database fragments.

create_archive_library

create_archive_library(ctx, in_files)

Create an archive action for an archive.

parameters

Name Description
ctx The rule context.
in_files A depset of input files.

returns

An output file.

link_executable(ctx, in_files)

Create a link action for an executable.

parameters

Name Description
ctx The rule context.
in_files A depset of input files.

returns

An output file.

link_shared_object(ctx, in_files)

Create a link action for a shared object.

parameters

Name Description
ctx The rule context.
in_files A depset of input files.

returns

An output file.

precompile_interface

precompile_interface(ctx, in_file, headers, defines, includes, angled_includes, bmis)

parameters

Name Description
ctx
in_file
headers
defines
includes
angled_includes
bmis

precompile_interfaces

precompile_interfaces(ctx, headers, defines, includes, angled_includes, bmis, precompile_exposed)

Create precompiled module interfaces.

parameters

Name Description
ctx The rule context.
headers A depset of files made available to compile actions.
defines A depset of defines passed to compile actions.
includes A depset of includes passed to compile actions.
angled_includes A depset of angled includes passed to compile actions.
bmis A depset of tuples (interface, name), each consisting of a binary module interface interface and a module name name.
precompile_exposed A boolean indicating whether to precompile exposed BMIs. Set to True for libraries and to False for binaries.

returns

A tuple (internal_bmis, exposed_bmis, cdfs).