bazelbuild / rules_perl

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

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

Closed lberki closed 1 month ago

lberki commented 2 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 1 month ago

Friendly ping?

skeletonkey commented 1 month ago

Thank you for your patience.

lberki commented 1 month ago

No worries, thanks for merging it :)