bazel-contrib / rules_perl

Perl rules for Bazel
Apache License 2.0
26 stars 37 forks source link

Makes rules_perl work with `--experimental_sibling_repository_layout`. #60

Closed lberki closed 5 months ago

lberki commented 6 months ago

The reason it did not work was that the code assumed that the execpath of any artifact can be passed to ctx.actions.declare_file(), but that's not the case for artifacts not in the main repository when sibling repository layout is in effect: their paths start with ../ which would make them ascend above the package directory.

This also triggered a bug in Bazel (https://github.com/bazelbuild/bazel/issues/22362), but even if that bug didn't exist, this would still not work.

Serendipitously, the principled fix for --experimental_sibling_repository_layout is also a workaround for the above bug. It adds two path segments to the package-relative path of the .o file, akin to how c++ rules work.

lberki commented 5 months ago

Friendly ping?

skeletonkey commented 5 months ago

Thank you for your patience.

lberki commented 5 months ago

No worries, thanks for merging it :)