Skip to content

Commit

Permalink
Update fetch option documentation
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 601517575
Change-Id: I29e42582b6a6fc06506473a53d85370bd0288c19
  • Loading branch information
SalmaSamy authored and copybara-github committed Jan 25, 2024
1 parent e13e0a2 commit e1a5419
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
12 changes: 12 additions & 0 deletions site/en/external/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ Normally, Bazel only fetches a repo when it needs something from the repo,
and the repo hasn't already been fetched. If the repo has already been fetched
before, Bazel only re-fetches it if its definition has changed.

The `fetch` command can be used to initiate a pre-fetch for a repository,
target, or all necessary repositories to perform any build. This capability
enables offline builds using the `--nofetch` option.

The `--fetch` option serves to manage network access. Its default value is true.
However, when set to false (`--nofetch`), the command will utilize any cached
version of the dependency, and if none exists, the command will result in
failure.

See [fetch options](/reference/command-line-reference#fetch-options) for more
information about controlling fetch.

### Directory layout {:#directory-layout}

After being fetched, the repo can be found in the subdirectory `external` in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ public ParallelismConverter() throws OptionsParsingException {
public int maxDirectoriesToEagerlyVisitInGlobbing;

@Option(
name = "fetch",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.UNKNOWN},
help = "Allows the command to fetch external dependencies"
)
name = "fetch",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
help =
"Allows the command to fetch external dependencies. If set to false, the command will"
+ " utilize any cached version of the dependency, and if none exists, the command"
+ " will result in failure.")
public boolean fetch;

@Option(
Expand Down

0 comments on commit e1a5419

Please sign in to comment.