Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger committed Jan 2, 2025
1 parent 74f7678 commit dc6d118
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion toolchains/configure_cross_compiler.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def configure_cross_compiler_impl(repository_ctx):

BINARIES = [
"ar",
"as",
"cpp",
"gcc",
"gcov",
Expand All @@ -51,15 +52,22 @@ def configure_cross_compiler_impl(repository_ctx):
compiler_workspace = Label("@" + substitutions["{compiler_repo}"]).workspace_name
substitutions["{actual_compiler_path}"] = compiler_workspace

print(substitutions["{compiler_repo}"])
print(substitutions["{bin_subfolder}"])
print(substitutions)

dist_rel_path = "../../external/" + compiler_workspace + "/" + substitutions["{bin_subfolder}"] + "/"
for binary in BINARIES:
bin_substitution = dict(substitutions)
bin_substitution["{binary_target}"] = binary
bin_substitution["{compiler_workspace}"] = compiler_workspace
repository_ctx.template(
"bin/" + binary + substitutions["{wrapper_extension}"],
"bin/" + binary + "2" + substitutions["{wrapper_extension}"],
repository_ctx.path(Label("@rules_bzlmodrio_toolchains//toolchains/cross_compiler:command_wrapper.tpl")),
substitutions = bin_substitution,
)

repository_ctx.symlink(dist_rel_path + substitutions["{binary_prefix}"] + binary, "bin/" + binary + substitutions["{wrapper_extension}"],)

repository_ctx.template(
"BUILD.bazel",
Expand Down

0 comments on commit dc6d118

Please sign in to comment.