Skip to content

Commit

Permalink
fix(rust): Use an env var to control rustdoc selectively only when bu…
Browse files Browse the repository at this point in the history
…ilding docs, not running doc tests
  • Loading branch information
stevenj committed Jan 3, 2025
1 parent 926f26e commit ff49d52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion earthly/rust/scripts/std_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ def cargo_bench(flags: str, verbose: bool = False) -> exec_manager.Result:


def cargo_doc(verbose: bool = False) -> exec_manager.Result:
# Add RUSTDOCFLAGS to the inherited environment so we can build an index page with nightly.
env = os.environ
env["RUSTDOCFLAGS"] = "-Z unstable-options --enable-index-page"
return exec_manager.cli_run(
"cargo +nightly docs -Z unstable-options --enable-index-page",
"cargo +nightly docs",
name="Documentation build",
verbose=verbose
)
Expand Down
2 changes: 2 additions & 0 deletions utilities/scripts/python/exec_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def cli_run(
log: bool = True,
timeout=None,
verbose=False,
env=None
) -> Result:
def procedure() -> ProcedureResult:
result = subprocess.run(
Expand All @@ -159,6 +160,7 @@ def procedure() -> ProcedureResult:
stderr=subprocess.STDOUT,
text=True,
timeout=timeout,
env=env
)
return ProcedureResult(result.returncode, command, result.stdout)

Expand Down

0 comments on commit ff49d52

Please sign in to comment.