Treat source directories as directories#29340
Treat source directories as directories#29340cameron-martin wants to merge 1 commit intobazelbuild:masterfrom
Conversation
Treat source directories as directories in analysis by carrying a directory bit on SourceArtifact instead of classifying all source artifacts as files. This fixes two related bugs: - source directories now report File.is_directory == True - ctx.actions.symlink(target_file=...) now accepts source directories with declare_directory() outputs Fixes bazelbuild#12954 Fixes bazelbuild#26705
| expect_symlink bazel-bin/a/a.link | ||
| } | ||
|
|
||
| function test_source_directory_is_directory_from_glob() { |
There was a problem hiding this comment.
This likely isn't the best location for this test because it doesn't have anything to do with symlinks as the test below does. Are there any better places for this?
|
I'm supportive of this PR, but as currently written, this incurs in an extra Nevertheless, it would be worthwhile (for someone at Google) to run a benchmark on this PR as written, just to get a sense of the performance hit. I can't volunteer to do so at this time, though. |
|
@tjgq Presumably we have to do a stat when globbing, so it should be possible to feed this info through from that when the source of the input is a glob. Would just covering glob inputs be sufficient? How many source inputs come from globs vs not? Do you know of anyone who can do this internal benchmarking? |
Description
Treat source directories as directories in analysis by carrying a directory bit on SourceArtifact instead of classifying all source artifacts as files.
This fixes two related bugs:
Motivation
Fixes #12954
Fixes #26705
Build API Changes
No
Checklist
Release Notes
RELNOTES: None