Skip to content

Commit

Permalink
Ensure buildroot substitution is correct (#80)
Browse files Browse the repository at this point in the history
In Pants 2.20, the workdir changed to `<buildroot>/pants.d/workdir`, so
switch to using `pants_distdir` option for `buildroot` substitution.

Fixes #60
  • Loading branch information
thejcannon authored Jan 9, 2024
1 parent ac77cad commit d4a68ac
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 100 deletions.
4 changes: 2 additions & 2 deletions reference_codegen/generate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ function generateTomlRepr(option, scope) {
let buildroot = "";
let cachedir = "";
helpAll.scope_to_help_info[globalScopeInternal].advanced.forEach((option) => {
if (option.config_key === "pants_workdir") {
buildroot = option.default.split("/").slice(0, -2).join("/");
if (option.config_key === "pants_distdir") {
buildroot = option.default.split("/").slice(0, -1).join("/");
}
if (option.config_key === "local_store_dir") {
cachedir = option.default.split("/").slice(0, -2).join("/");
Expand Down
12 changes: 6 additions & 6 deletions versioned_docs/version-2.0/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Unused. Will be deprecated in 2.1.0.
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -353,7 +353,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_SUPPORTDIR'
toml_repr={`[GLOBAL]
pants_supportdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/build-support`}
default_repr={`<buildroot>/build-support`}
>

Unused. Will be deprecated in 2.1.0.
Expand All @@ -367,7 +367,7 @@ Unused. Will be deprecated in 2.1.0.
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `./pants package`, to this dir.
Expand Down Expand Up @@ -395,7 +395,7 @@ Whether to write binaries to the pre-2.0 paths under distdir. These legacy paths
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -413,7 +413,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down Expand Up @@ -695,7 +695,7 @@ Directory to use for named global caches for tools and processes with trusted, c
env_repr='PANTS_LOCAL_EXECUTION_ROOT_DIR'
toml_repr={`[GLOBAL]
local_execution_root_dir = <str>`}
default_repr={`<buildroot>`}
default_repr={`/tmp`}
>

Directory to use for local process execution sandboxing. The path may be absolute or relative. If the directory is within the build root, be sure to include it in `--pants-ignore`.
Expand Down
12 changes: 6 additions & 6 deletions versioned_docs/version-2.1/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Unused. Will be deprecated in 2.2.0.
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -353,7 +353,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_SUPPORTDIR'
toml_repr={`[GLOBAL]
pants_supportdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/build-support`}
default_repr={`<buildroot>/build-support`}
>

Unused. Will be deprecated in 2.2.0.
Expand All @@ -367,7 +367,7 @@ Unused. Will be deprecated in 2.2.0.
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `./pants package`, to this dir.
Expand All @@ -381,7 +381,7 @@ Write end products, such as the results of `./pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -399,7 +399,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down Expand Up @@ -681,7 +681,7 @@ Directory to use for named global caches for tools and processes with trusted, c
env_repr='PANTS_LOCAL_EXECUTION_ROOT_DIR'
toml_repr={`[GLOBAL]
local_execution_root_dir = <str>`}
default_repr={`<buildroot>`}
default_repr={`/tmp`}
>

Directory to use for local process execution sandboxing. The path may be absolute or relative. If the directory is within the build root, be sure to include it in `--pants-ignore`.
Expand Down
10 changes: 5 additions & 5 deletions versioned_docs/version-2.10/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ The name of the script or binary used to invoke Pants. Useful when printing help
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -441,7 +441,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `./pants package`, to this dir.
Expand All @@ -455,7 +455,7 @@ Write end products, such as the results of `./pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -473,7 +473,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down Expand Up @@ -837,7 +837,7 @@ The path may be absolute or relative. If the directory is within the build root,
env_repr='PANTS_LOCAL_EXECUTION_ROOT_DIR'
toml_repr={`[GLOBAL]
local_execution_root_dir = <str>`}
default_repr={`<buildroot>`}
default_repr={`/tmp`}
>

Directory to use for local process execution sandboxing.
Expand Down
10 changes: 5 additions & 5 deletions versioned_docs/version-2.11/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ The name of the script or binary used to invoke Pants. Useful when printing help
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -441,7 +441,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `./pants package`, to this dir.
Expand All @@ -455,7 +455,7 @@ Write end products, such as the results of `./pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -473,7 +473,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down Expand Up @@ -837,7 +837,7 @@ The path may be absolute or relative. If the directory is within the build root,
env_repr='PANTS_LOCAL_EXECUTION_ROOT_DIR'
toml_repr={`[GLOBAL]
local_execution_root_dir = <str>`}
default_repr={`<buildroot>`}
default_repr={`/tmp`}
>

Directory to use for local process execution sandboxing.
Expand Down
10 changes: 5 additions & 5 deletions versioned_docs/version-2.12/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ The name of the script or binary used to invoke Pants. Useful when printing help
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -441,7 +441,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `./pants package`, to this dir.
Expand All @@ -455,7 +455,7 @@ Write end products, such as the results of `./pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -473,7 +473,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down Expand Up @@ -837,7 +837,7 @@ The path may be absolute or relative. If the directory is within the build root,
env_repr='PANTS_LOCAL_EXECUTION_ROOT_DIR'
toml_repr={`[GLOBAL]
local_execution_root_dir = <str>`}
default_repr={`<buildroot>`}
default_repr={`/tmp`}
>

Directory to use for local process execution sandboxing.
Expand Down
8 changes: 4 additions & 4 deletions versioned_docs/version-2.13/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ The name of the script or binary used to invoke Pants. Useful when printing help
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -480,7 +480,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `./pants package`, to this dir.
Expand All @@ -494,7 +494,7 @@ Write end products, such as the results of `./pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -512,7 +512,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down
8 changes: 4 additions & 4 deletions versioned_docs/version-2.14/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ The name of the script or binary used to invoke Pants. Useful when printing help
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -442,7 +442,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `./pants package`, to this dir.
Expand All @@ -456,7 +456,7 @@ Write end products, such as the results of `./pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -474,7 +474,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down
8 changes: 4 additions & 4 deletions versioned_docs/version-2.15/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ The name of the script or binary used to invoke Pants. Useful when printing help
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -440,7 +440,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `pants package`, to this dir.
Expand All @@ -454,7 +454,7 @@ Write end products, such as the results of `pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -472,7 +472,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down
8 changes: 4 additions & 4 deletions versioned_docs/version-2.16/reference/global-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ The name of the script or binary used to invoke Pants. Useful when printing help
env_repr='PANTS_WORKDIR'
toml_repr={`[GLOBAL]
pants_workdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pants.d`}
default_repr={`<buildroot>/.pants.d`}
>

Write intermediate logs and output files to this dir.
Expand Down Expand Up @@ -440,7 +440,7 @@ When set, a base directory in which to store `--pants-workdir` contents. If this
env_repr='PANTS_DISTDIR'
toml_repr={`[GLOBAL]
pants_distdir = <dir>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/dist`}
default_repr={`<buildroot>/dist`}
>

Write end products, such as the results of `pants package`, to this dir.
Expand All @@ -454,7 +454,7 @@ Write end products, such as the results of `pants package`, to this dir.
env_repr='PANTS_SUBPROCESSDIR'
toml_repr={`[GLOBAL]
pants_subprocessdir = <str>`}
default_repr={`<buildroot>/tmp.MpwSc5OGVo/.pids`}
default_repr={`<buildroot>/.pids`}
>

The directory to use for tracking subprocess metadata. This should live outside of the dir used by `pants_workdir` to allow for tracking subprocesses that outlive the workdir data.
Expand All @@ -472,7 +472,7 @@ pants_config_files = [
'<str>',
...,
]`}
default_repr={`[\n "<buildroot>/tmp.MpwSc5OGVo/pants.toml"\n]`}
default_repr={`[\n "<buildroot>/pants.toml"\n]`}
>

Paths to Pants config files. This may only be set through the environment variable `PANTS_CONFIG_FILES` and the command line argument `--pants-config-files`; it will be ignored if in a config file like `pants.toml`.
Expand Down
Loading

0 comments on commit d4a68ac

Please sign in to comment.