bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.97k stars 4.03k forks source link

Provide convenience symlinks information in `bazel info` #23035

Open tpasternak opened 1 month ago

tpasternak commented 1 month ago

Description of the feature request:

bazel info already provides a way to obtain output_base directory and some significant subdirectories.

Would it be also possible to provide similar information about the convenience symlinks? They can be manipulated with the --symlink_prefix flag, so we can't assume their names.

This would be useful for tools like IntelliJ to mark these folders as excluded (from indexing) as early as possible.

Which category does this issue belong to?

CLI

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

Mark the convenience symlinks as ignored as soon as possible during the IntelliJ sync process

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

haxorz commented 1 month ago

The ConvenienceSymlinksIdentified message in the BEP (https://bazel.build/remote/bep) has this information. Did you consider using that?

tpasternak commented 1 month ago

Indeed, works. However it would require yet another bazel build (empty) call. That might increase sync times by a few seconds. For IntelliJ it is important to mark folders as excluded before the actual build starts. Otherwise, there would be a race between directory scanning and exclusion marking

haxorz commented 1 month ago

However it would require yet another bazel build (empty) call. That might increase sync times by a few seconds.

What did you have in mind?

nharmata@nharmata:~/bazel-scratch$ for i in $(seq 5); do bazel info &> /dev/null; time bazel build &> /dev/null; done

real    0m0.066s
user    0m0.019s
sys 0m0.008s

real    0m0.073s
user    0m0.014s
sys 0m0.012s

real    0m0.062s
user    0m0.011s
sys 0m0.014s

real    0m0.066s
user    0m0.021s
sys 0m0.005s

real    0m0.064s
user    0m0.012s
sys 0m0.015s
nharmata@nharmata:~/bazel-scratch$

Are the long no-op bazel build invocations you're worried about maybe due to something else? E.g. Bazel checking for changes to external repos, etc. That seems like a separate issue to me, and I'd prefer you work around that more directly. That being said, I'm pragmatic and am willing to accept a contribution of this FR as long as it's well motivated.

Fyi I'm OOO for the next 1.5 weeks so if you need an urgent response please tag someone else.