bp2build to convert $(genDir) to $(RULEDIR) in genrule's cmd
`statslog.cpp` with cmd `"$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp"` produces `out/.intermediates/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp/gen/statslog.cpp`. Hence, $(genDir) is equivalent to `<package-dir>/<module-name>/gen`. Currently, bp2buld converts `$(genDir)` to `$(GENDIR)`. In Bazel, `$(GENDIR)` is only the base of the generated code (e.g. `bazel-bin`). ``` genrule( name = "statslog.cpp", cmd = "$(location :stats-log-api-gen) --cpp $(GENDIR)/statslog.cpp", outs = ["statslog.cpp"], tools = [":stats-log-api-gen"], ) ``` produces `bazel-bin/statslog.cpp` but expects to have `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp`. By converting to `$(RULEDIR)` which is `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen`. There had not been any genrule module allowlisted with genDir yet. So this should not cause any issue with modules converted before this CL. Bug: 247536535 Test: go tests Test: presubmit builds and tests Change-Id: I65c6aafadab6b180b7ef700427e041547ae7e98a
Loading
Please register or sign in to comment