Skip to content

Commit

Permalink
Bug 1831234 - Prepare the repack_rust.py script for rustc 1.70. r=fir…
Browse files Browse the repository at this point in the history
…efox-build-system-reviewers,andi

The configuration used to build rustc changed the ignore-git field to
omit-git-hash.

Differential Revision: https://phabricator.services.mozilla.com/D177428
  • Loading branch information
glandium committed May 15, 2023
1 parent 1b81493 commit 6c71732
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions taskcluster/scripts/misc/repack_rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,19 @@ def build_src(install_dir, host, targets, patches):

log("Building Rust...")

example_config = ""
for example_toml in ("config.example.toml", "config.toml.example"):
path = os.path.join(rust_dir, example_toml)
if os.path.exists(path):
with open(path) as file:
example_config = file.read()
break

if "ignore-git" in example_config:
omit_git_hash = "ignore-git"
else:
omit_git_hash = "omit-git-hash"

# Rust builds are configured primarily through a config.toml file.
#
# `sysconfdir` is overloaded to be relative instead of absolute.
Expand All @@ -401,7 +414,7 @@ def build_src(install_dir, host, targets, patches):
tools = ["analysis", "cargo", "rustfmt", "clippy", "src", "rust-analyzer"]
[rust]
ignore-git = false
{omit_git_hash} = false
use-lld = true
[install]
Expand All @@ -412,7 +425,8 @@ def build_src(install_dir, host, targets, patches):
missing-tools = true
""".format(
prefix=install_dir
prefix=install_dir,
omit_git_hash=omit_git_hash,
)
)

Expand Down

0 comments on commit 6c71732

Please sign in to comment.