Skip to content

Commit f67d96d

Browse files
authored
Updated internal documentation (#823)
1 parent dd1c73e commit f67d96d

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

rust/private/repository_utils.bzl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,14 @@ def produce_tool_path(tool_name, target_triple, version):
484484
def load_arbitrary_tool(ctx, tool_name, tool_subdirectories, version, iso_date, target_triple, sha256 = ""):
485485
"""Loads a Rust tool, downloads, and extracts into the common workspace.
486486
487-
This function sources the tool from the Rust-lang static file server. The index is available
488-
at: https://static.rust-lang.org/dist/index.html (or the path specified by
489-
"${STATIC_RUST_URL}/dist/index.html" if the STATIC_RUST_URL envinronment variable is set).
487+
This function sources the tool from the Rust-lang static file server. The index is available at:
488+
- https://static.rust-lang.org/dist/channel-rust-stable.toml
489+
- https://static.rust-lang.org/dist/channel-rust-beta.toml
490+
- https://static.rust-lang.org/dist/channel-rust-nightly.toml
491+
492+
The environment variable `STATIC_RUST_URL` can be used to replace the schema and hostname of
493+
the URLs used for fetching assets. `https://static.rust-lang.org/dist/channel-rust-stable.toml`
494+
becomes `${STATIC_RUST_URL}/dist/channel-rust-stable.toml`
490495
491496
Args:
492497
ctx (repository_ctx): A repository_ctx (no attrs required).
@@ -511,7 +516,7 @@ def load_arbitrary_tool(ctx, tool_name, tool_subdirectories, version, iso_date,
511516

512517
check_version_valid(version, iso_date, param_prefix = tool_name + "_")
513518

514-
# N.B. See https://static.rust-lang.org/dist/index.html to find the tool_suburl for a given
519+
# View the indices mentioned in the docstring to find the tool_suburl for a given
515520
# tool.
516521
tool_suburl = produce_tool_suburl(tool_name, target_triple, version, iso_date)
517522
static_rust = ctx.os.environ.get("STATIC_RUST_URL", "https://static.rust-lang.org")

rust/toolchain.bzl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ rust_stdlib_filegroup = rule(
8383
)
8484

8585
def _ltl(library, ctx, cc_toolchain, feature_configuration):
86+
"""A helper to generate `LibraryToLink` objects
87+
88+
Args:
89+
library (File): A rust library file to link.
90+
ctx (ctx): The rule's context object.
91+
cc_toolchain (CcToolchainInfo): A cc toolchain provider to be used.
92+
feature_configuration (feature_configuration): feature_configuration to be queried.
93+
94+
Returns:
95+
LibraryToLink: A provider containing information about libraries to link.
96+
"""
8697
return cc_common.create_library_to_link(
8798
actions = ctx.actions,
8899
feature_configuration = feature_configuration,

0 commit comments

Comments
 (0)