summaryrefslogtreecommitdiff
path: root/kleaf/docs/api_reference/hermetic_tools.md
blob: 6075eaa98a933cfcc5571f0f23a246f9746bca25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

Provide tools for a hermetic build.

<a id="hermetic_exec"></a>

## hermetic_exec

<pre>
hermetic_exec(<a href="#hermetic_exec-name">name</a>, <a href="#hermetic_exec-script">script</a>, <a href="#hermetic_exec-data">data</a>, <a href="#hermetic_exec-kwargs">kwargs</a>)
</pre>

A exec that uses hermetic tools.

Hermetic tools are resolved from toolchain resolution. To replace it,
register a different hermetic toolchain.


**PARAMETERS**


| Name  | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="hermetic_exec-name"></a>name |  name of the target   |  none |
| <a id="hermetic_exec-script"></a>script |  See [exec.script]   |  none |
| <a id="hermetic_exec-data"></a>data |  See [exec.data]   |  `None` |
| <a id="hermetic_exec-kwargs"></a>kwargs |  See [exec]   |  none |


<a id="hermetic_exec_test"></a>

## hermetic_exec_test

<pre>
hermetic_exec_test(<a href="#hermetic_exec_test-name">name</a>, <a href="#hermetic_exec_test-script">script</a>, <a href="#hermetic_exec_test-data">data</a>, <a href="#hermetic_exec_test-kwargs">kwargs</a>)
</pre>

A exec_test that uses hermetic tools.

Hermetic tools are resolved from toolchain resolution. To replace it,
register a different hermetic toolchain.


**PARAMETERS**


| Name  | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="hermetic_exec_test-name"></a>name |  name of the target   |  none |
| <a id="hermetic_exec_test-script"></a>script |  See [exec_test.script]   |  none |
| <a id="hermetic_exec_test-data"></a>data |  See [exec_test.data]   |  `None` |
| <a id="hermetic_exec_test-kwargs"></a>kwargs |  See [exec_test]   |  none |


<a id="hermetic_genrule"></a>

## hermetic_genrule

<pre>
hermetic_genrule(<a href="#hermetic_genrule-name">name</a>, <a href="#hermetic_genrule-cmd">cmd</a>, <a href="#hermetic_genrule-tools">tools</a>, <a href="#hermetic_genrule-kwargs">kwargs</a>)
</pre>

A genrule that uses hermetic tools.

Hermetic tools are resolved from toolchain resolution. To replace it,
register a different hermetic toolchain.

Only `cmd` is expected and used. `cmd_bash`, `cmd_ps`, `cmd_bat` etc. are
ignored.


**PARAMETERS**


| Name  | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="hermetic_genrule-name"></a>name |  name of the target   |  none |
| <a id="hermetic_genrule-cmd"></a>cmd |  See [genrule.cmd](https://bazel.build/reference/be/general#genrule.cmd)   |  none |
| <a id="hermetic_genrule-tools"></a>tools |  See [genrule.tools](https://bazel.build/reference/be/general#genrule.tools)   |  `None` |
| <a id="hermetic_genrule-kwargs"></a>kwargs |  See [genrule](https://bazel.build/reference/be/general#genrule)   |  none |


<a id="hermetic_toolchain.get"></a>

## hermetic_toolchain.get

<pre>
hermetic_toolchain.get(<a href="#hermetic_toolchain.get-ctx">ctx</a>)
</pre>

Returns the resolved toolchain information.

**PARAMETERS**


| Name  | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="hermetic_toolchain.get-ctx"></a>ctx |  ctx. The rule must contain <pre><code>toolchains = [&#10;    hermetic_toolchain.type,&#10;]</code></pre>   |  none |

**RETURNS**

_HermeticToolchainInfo (see hermetic_tools.bzl).


<a id="hermetic_tools"></a>

## hermetic_tools

<pre>
hermetic_tools(<a href="#hermetic_tools-name">name</a>, <a href="#hermetic_tools-deps">deps</a>, <a href="#hermetic_tools-symlinks">symlinks</a>, <a href="#hermetic_tools-aliases">aliases</a>, <a href="#hermetic_tools-kwargs">kwargs</a>)
</pre>

Provide tools for a hermetic build.

**PARAMETERS**


| Name  | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="hermetic_tools-name"></a>name |  Name of the target.   |  none |
| <a id="hermetic_tools-deps"></a>deps |  additional dependencies. These aren't added to the `PATH`.   |  `None` |
| <a id="hermetic_tools-symlinks"></a>symlinks |  A dictionary, where keys are labels to an executable, and values are names to the tool, separated with `:`. e.g.<br><br><pre><code>{"//label/to:toybox": "cp:realpath"}</code></pre>   |  `None` |
| <a id="hermetic_tools-aliases"></a>aliases |  **Deprecated; do not use.**<br><br>[nonconfigurable](https://bazel.build/reference/be/common-definitions#configurable-attributes).<br><br>List of aliases to create to refer to a `fail_rule`.<br><br>For example, if `aliases = ["cp"],` then usage of `<name>/cp` will fail.<br><br>**Note**: It is not allowed to rely on these targets. Consider using the full hermetic toolchain with [`hermetic_toolchain`](#hermetic_toolchainget) or [`hermetic_genrule`](#hermetic_genrule), etc.   |  `None` |
| <a id="hermetic_tools-kwargs"></a>kwargs |  Additional attributes to the internal rule, e.g. [`visibility`](https://docs.bazel.build/versions/main/visibility.html). See complete list [here](https://docs.bazel.build/versions/main/be/common-definitions.html#common   |  none |