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

Option to use copies of input files rather than symlinks in genrule, sh_test, etc #18383

Open
njlr opened this issue May 12, 2023 · 3 comments
Open
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request

Comments

@njlr
Copy link

njlr commented May 12, 2023

Description of the feature request:

Some tools (such as Docker) work differently when a file is symlink rather than just the file.

Bazel creates symlinks as an optimization, but sometimes this changes the behaviour of the rule.

Bazel should provide the option to disable symlinks and copy the files on a rule-basis.

sh_test(
  name = "test",
  srcs = [ "test.sh" ],
  args = [
    "$(location :docker-compose.yaml)",
  ],
  data = [
    "docker-compose.yaml",
  ],
  # Input files will be copied into the sandbox rather than placed as symlinks
  disable_sandbox_symlinks = True, # Defaults to false, so this is a non-breaking change
)

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

Make it easier to work with tools from Bazel.

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

release 5.4.0

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 ?

N/A

Have you found anything relevant by searching the web?

Maybe related: #4320

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

No response

@tjgq
Copy link
Contributor

tjgq commented May 12, 2023

FYI, there's also a sandbox implementation based on hardlinks (which uses hardlinks when on the same fs, and makes a copy otherwise). You can enable it with --experimental_use_hermetic_linux_sandbox, but note the caveat in #18377. But you can only set it for the entire invocation, not for individual actions.

@tjgq tjgq added the team-Local-Exec Issues and PRs for the Execution (Local) team label May 12, 2023
@coeuvre coeuvre added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels May 16, 2023
Copy link

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.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jul 20, 2024
@njlr
Copy link
Author

njlr commented Aug 16, 2024

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.

Still relevant

@sgowroji sgowroji removed the stale Issues or PRs that are stale (no activity for 30 days) label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request
Projects
None yet
Development

No branches or pull requests

5 participants