Skip to content

Commit

Permalink
Fix windows path incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun-splunk committed Jan 28, 2024
1 parent 366b6aa commit 9679970
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion perl/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def _perl_toolchain_impl(ctx):
xsubpp_cmd = _find_tool(ctx, "xsubpp")
xs_headers = _find_xs_headers(ctx)

interpreter_cmd_path = interpreter_cmd.path
if ctx.target_platform_has_constraint(ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]):
interpreter_cmd_path = interpreter_cmd.path.replace("/", "\\")

return [
platform_common.ToolchainInfo(
name = ctx.label.name,
Expand All @@ -51,7 +55,7 @@ def _perl_toolchain_impl(ctx):
perlopt = ctx.attr.perlopt,
),
make_variables = platform_common.TemplateVariableInfo({
"PERL": interpreter_cmd.path,
"PERL": interpreter_cmd_path,
}),
),
]
Expand All @@ -67,6 +71,7 @@ perl_toolchain = rule(
allow_files = True,
cfg = "target",
),
"_windows_constraint": attr.label(default = "@platforms//os:windows"),
},
doc = "Gathers functions and file lists needed for a Perl toolchain",
)
Expand Down

0 comments on commit 9679970

Please sign in to comment.