Skip to content

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

Open
guw wants to merge 12 commits intofmeum:mainfrom
guw:main
Open

Unnecessary compile with private-B-change-removes-B-to-A-dep.patch#2
guw wants to merge 12 commits intofmeum:mainfrom
guw:main

Conversation

@guw
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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