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

Unnecessary compile with private-B-change-removes-B-to-A-dep.patch #2

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

guw
Copy link

@guw guw commented Aug 28, 2023

Thanks to @rsalvador we have a case of an unnecessary compilation which is no longer a cache hit due to a classpath change.

./script.sh private-B-change-removes-B-to-A-dep
...
INFO: 4 processes: 1 internal, 1 darwin-sandbox, 2 worker.

and the explain log:

Executing action 'Building libB.jar (1 source file)': One of the files has changed.
Executing action 'Extracting interface for jar bazel-out/darwin_x86_64-fastbuild/bin/libB.jar': One of the files has changed.
Executing action 'Building libC.jar (1 source file)': One of the files has changed.

So C is being rebuild although the ijar of B does not change.

@fmeum
Copy link
Owner

fmeum commented Aug 29, 2023

@guw I see that this disables Java header compilation in the .bazelrc. With --java_header_compilation, I get the expected outcome with no unnecessary rebuild:

INFO: 3 processes: 1 internal, 1 linux-sandbox, 1 worker.

Why do you disable Java header compilation? It is pretty much required with --experimental_java_classpath=bazel as it provides the list of "API deps" for a given target.

@guw
Copy link
Author

guw commented Aug 29, 2023

That's quite surprising, isn't it? Only directly declared deps should be responsible for re-compilation and not changes in the transitive list.

The header compilation had to be disabled because it's too expensive (much longer build times) and it's broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants