Skip to content

Commit

Permalink
Recommend checking the pantsup.sh script in. (pantsbuild#18120)
Browse files Browse the repository at this point in the history
Also update the CI caching recommendations to cache the nce cache.
  • Loading branch information
benjyw authored Jan 31, 2023
1 parent 738541d commit 7117bad
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ Some noteworthy features include:

Documentation: [www.pantsbuild.org](https://www.pantsbuild.org/).

# Requirements
# Getting started

To run Pants, you need:

* Linux or macOS.
* Python 3.7+ discoverable on your `PATH`.
* A C compiler, system headers and Python headers (to compile native Python modules).
* Internet access (so that Pants can fully bootstrap itself).
See the [getting started](https://www.pantsbuild.org/docs/getting-started) documentation.

# Credits

Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/classify_changed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Affected(enum.Enum):
other = "other"


_docs_globs = ["docs/*", "build-support/bin/generate_user_list.py"]
_docs_globs = ["README.md", "**/README.md", "docs/*", "build-support/bin/generate_user_list.py"]
_rust_globs = ["src/rust/engine/*", "rust-toolchain", "build-support/bin/rust/*"]
_release_globs = [
"pants.toml",
Expand Down
1 change: 1 addition & 0 deletions build-support/bin/classify_changed_files_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
["changed_files", "expected"],
(
[["docs/path/to/some/doc", "docs/path/to/some/other/doc"], {Affected.docs}],
[["README.md", "path/to/some/dir/README.md"], {Affected.docs}],
[["src/rust/engine/path/to/file.rs"], {Affected.rust}],
[["src/python/pants/VERSION"], {Affected.release}],
[["build-support/bin/generate_github_workflows.py"], {Affected.ci_config}],
Expand Down
8 changes: 5 additions & 3 deletions docs/markdown/Getting Started/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ createdAt: "2020-02-21T17:44:53.022Z"
updatedAt: "2022-07-12T00:00:00.000Z"
---

To install the `pants` binary you can use:
You can download an installer script that will install the Pants binary with this command:

```
/bin/bash -c "$(curl -fsSL https://static.pantsbuild.org/setup/pantsup.sh)"
curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/pantsup.sh
```

This will install `pants` into `~/bin`, which must be on your PATH. The installer script will warn you if it is not.
This script will install `pants` into `~/bin`, which must be on your PATH. The installer script will warn you if it is not.

For security reasons, we don't recommend frequently curling this script directly to `bash`, e.g., on every CI run. If the script were compromised during some time window, you'd be more likely to download it during that window and be impacted. Instead, for regular use, we recommend checking this script into your repo and pointing users and CI machines to that checked-in version. The script is very simple and need not be updated very often.

Alternatively, on macOS you can also use homebrew to install `pants`:

Expand Down
4 changes: 3 additions & 1 deletion docs/markdown/Using Pants/using-pants-in-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Directories to cache
In your CI's config file, we recommend caching these directories:

- `$HOME/.nce` (Linux) or `$HOME/Library/Caches/nce` (macOS)<br>
This is the cache directory used by the [Pants launcher binary](doc:installation) to cache its embedded interpreter. Cache this against some static key that you can modify if you want to purge that cache.
- `$HOME/.cache/pants/setup`<br>
This is the Pants bootstrap directory. Cache this against the version, as specified in `pants.toml`. See the [pantsbuild/example-python](https://github.com/pantsbuild/example-python/blob/main/.github/workflows/pants.yaml) repo for an example of how to generate an effective cache key for this directory in GitHub Actions.
- `$HOME/.cache/pants/named_caches`<br>
Expand Down Expand Up @@ -207,7 +209,7 @@ The default test runners for these CI providers have the following resources. If
Tip: store Pants logs as artifacts
----------------------------------
We recommend that you configure your CI system to store the pants log (`.pantd.d/pants.log`) as a build artifact, so that it is available in case you need to troubleshoot CI issues.
We recommend that you configure your CI system to store the pants log (`.pantsd.d/pants.log`) as a build artifact, so that it is available in case you need to troubleshoot CI issues.
Different CI providers and systems have different ways to configure build artifacts:
Expand Down

0 comments on commit 7117bad

Please sign in to comment.