Public API
Implementation of patching an already extracted repository.
This rule is intended to be used in the implementation function of a repository rule. If the parameters patches
, patch_tool
, patch_args
, patch_cmds
and patch_cmds_win
are not specified then they are taken from ctx.attr
.
PARAMETERS
Name | Description | Default Value |
---|---|---|
ctx | The repository context of the repository rule calling this utility function. | none |
patches | The patch files to apply. List of strings, Labels, or paths. | None |
patch_cmds | Bash commands to run for patching, passed one at a time to bash -c. List of strings | None |
patch_cmds_win | Powershell commands to run for patching, passed one at a time to powershell /c. List of strings. If the boolean value of this parameter is false, patch_cmds will be used and this parameter will be ignored. | None |
patch_tool | Path of the patch tool to execute for applying patches. String. | None |
patch_args | Arguments to pass to the patch tool. List of strings. | None |
auth | An optional dict specifying authentication information for some of the URLs. | None |
patch_directory | Directory to apply the patches in | None |
Find an environment variable in system. Doesn't %-escape the value!
PARAMETERS
Name | Description | Default Value |
---|---|---|
rctx | rctx | none |
name | environment variable name | none |
default | default value to return if env var is not set in system | none |
RETURNS
The environment variable value or the default if it is not set
PARAMETERS
Name | Description | Default Value |
---|---|---|
rctx | - | none |
Returns true if the host operating system is Darwin
PARAMETERS
Name | Description | Default Value |
---|---|---|
rctx | - | none |
Returns true if the host operating system is Linux
PARAMETERS
Name | Description | Default Value |
---|---|---|
rctx | - | none |
Returns true if the host operating system is Windows
PARAMETERS
Name | Description | Default Value |
---|---|---|
rctx | - | none |
Returns the name of the host operating system
PARAMETERS
Name | Description | Default Value |
---|---|---|
rctx | rctx | none |
RETURNS
The string “windows”, “linux”, “freebsd” or “darwin” that describes the host os
Returns a normalized name of the host os and CPU architecture.
Alias archictures names are normalized:
x86_64 => amd64 aarch64 => arm64
The result can be used to generate repository names for host toolchain repositories for toolchains that use these normalized names.
Common os & architecture pairs that are returned are,
PARAMETERS
Name | Description | Default Value |
---|---|---|
rctx | rctx | none |
RETURNS
The normalized “_” string of the host os and CPU architecture.