Skip to content

Commit

Permalink
Respect --set=target.platform during build
Browse files Browse the repository at this point in the history
Avoid quoting targets that do not contain a period.
See 1532fd8

`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.
Undo parts of d1291dc
  • Loading branch information
MarcusCalhoun-Lopez committed Dec 29, 2022
1 parent 29d76cc commit 480297d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,9 @@ def build_bootstrap(self, color):
target_features += ["-crt-static"]
if target_features:
env["RUSTFLAGS"] += " -C target-feature=" + (",".join(target_features))
target_linker = self.get_toml("linker", build_section)
if target_linker is not None:
env["RUSTFLAGS"] += " -C linker=" + target_linker
env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes"
env["RUSTFLAGS"] += " -Wsemicolon_in_expressions_from_macros"
if self.get_toml("deny-warnings", "rust") != "false":
Expand Down
4 changes: 3 additions & 1 deletion src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ def set(key, value):
configured_targets.append(target)
for target in configured_targets:
targets[target] = sections['target'][:]
targets[target][0] = targets[target][0].replace("x86_64-unknown-linux-gnu", "'{}'".format(target))
# For `.` to be valid TOML, it needs to be quoted. But `bootstrap.py` doesn't use a proper TOML parser and fails to parse the target.
# Avoid using quotes unless it's necessary.
targets[target][0] = targets[target][0].replace("x86_64-unknown-linux-gnu", "'{}'".format(target) if "." in target else target)


def is_number(value):
Expand Down

0 comments on commit 480297d

Please sign in to comment.