bazelbuild / rules_perl

Perl rules for Bazel
Apache License 2.0
25 stars 38 forks source link

Fix windows path incompatibility #58

Closed jsun-splunk closed 5 months ago

jsun-splunk commented 6 months ago

When using rules_perl with nmake on windows, the exported path to PERL has / instead of \. This causes nmake targets to break.

For example when nmake need to execute a target that needs to run:

C:\users\jsun\_bazel_jsun\2pzzqzw2\execroot\splcore\external/perl_windows_x86_64/perl/bin/perl.exe util/mkdir-p.pl

It returns the error

'C:\users\jsun\_bazel_jsun\2pzzqzw2\execroot\splcore\external' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:\users\jsun\_bazel_jsun\2pzzqzw2\execroot\splcore\external' : return code '0x1'
Stop.

This PR fixes this by checking for the appropriate windows platform constraint and replacing the path separator as needed. The method is documented here

jsun-splunk commented 5 months ago

@skeletonkey are you ok to give this a review?