Support $(SRCS) replacement in copts
Description of the bug:
https://github.com/bazelbuild/bazel/issues/181
I think this issue should be revisited.
There is a crucial difference between copt and includes: For example, in lib A, target foo (foo's BUILD is not under root, but in "foo/src"), there is includes = ["foo/src"]. If lib A is depended by lib B as org_google_A, in lib B's compile command, there will be -Ibazel-B/org_google_A/foo/src. Such automatic conversion from "foo/src" to "bazel-B/org_google_A/foo/src" won't happen for a "-Ifoo/src" in copt, and such "-Ifoo/src" will become meaningless when compiling B's targets.
$(SRCS), which is available to genrule, should be available to copt, so that lib A could be relocatable to other libraries.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
No response
What is the output of bazel info release?
No response
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
Hi @PandaBlueYellow, Can you please update the title of the issue with relevant details and provide more details on your query. Thanks!
@sgowroji I updated the title. Please let me know what specific information you need in order to make decision. Thanks
Right now the problem is that we don't have a mechanism to expand those in Starlark. Current implementation calls into expand_location which works for source/output path variables.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
cc @pzembrod @comius in case there's new developments in the past year