Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow execpath to refer to a directory #23015

Open
allsey87 opened this issue Jul 15, 2024 · 0 comments
Open

Allow execpath to refer to a directory #23015

allsey87 opened this issue Jul 15, 2024 · 0 comments
Labels
team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols type: feature request untriaged

Comments

@allsey87
Copy link

allsey87 commented Jul 15, 2024

Description of the feature request:

In Bazel 7, referring to directories in execroot gives this warning:

WARNING: /workspaces/builder-bazel/testing/BUILD:131:6: input 'resource_dir' of //testing:my_test is a directory; dependency checking of directories is unsound

However, there are no good alternative for solving this problem:

cc_binary(
   ...
   env = {
       "RESOURCES": "$(execpath @resources//:resource_dir)"
   }
   ...
)

Which category does this issue belong to?

Rules API, Starlark Integration

What underlying problem are you trying to solve with this feature?

I need to set an environment variable of a binary inside of Bazel to a directory.

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

release 7.2.1

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 HEAD ?

No response

Have you found anything relevant by searching the web?

I have looked at different approaches to solving this program (macros, rules, providers), all of which seem very verbose and do not solve the problem

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts team-Starlark-Integration Issues involving Bazel's integration with Starlark, excluding builtin symbols type: feature request untriaged
Projects
None yet
Development

No branches or pull requests

4 participants