Skip to content

Add private-B-change-removes-B-to-A-dep#1

Merged
guw merged 1 commit intoguw:mainfrom
rsalvador:private-B-change-removes-B-to-A-dep
Aug 28, 2023
Merged

Add private-B-change-removes-B-to-A-dep#1
guw merged 1 commit intoguw:mainfrom
rsalvador:private-B-change-removes-B-to-A-dep

Conversation

@rsalvador
Copy link
Copy Markdown

@rsalvador rsalvador commented Aug 28, 2023

Makes a private change in B that removes the dependency of B on A, this causes and change in the jdeps of B and thus a java compiler classpath change when recompiling C, thus C is recompiled:

$ ./script.sh private-B-change-removes-B-to-A-dep
...
INFO: Elapsed time: 0.709s, Critical Path: 0.21s
INFO: 4 processes: 1 internal, 1 darwin-sandbox, 2 worker.
INFO: Build completed successfully, 4 total actions
...
$ cat patches/private-B-change-removes-B-to-A-dep.explain.log
Executing action 'BazelWorkspaceStatusAction stable-status.txt': unconditional execution is requested.
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.

Those are the rebuilds for this scenario:

  • default: recompiles B
  • classpath=bazel: recompiles B/C (C recompiled because compile classpath changed)
  • classpath=bazel + empty jdeps (direct deps only): recompiles B

@guw
Copy link
Copy Markdown
Owner

guw commented Aug 28, 2023

@rsalvador You need to provide the output of the bazel binary.

I confirmed in fmeum#1 that the message in the explain.log is misleading. In your case, Building libC.jar (1 source file) will not be a rebuild but a disk cache hit.

@rsalvador
Copy link
Copy Markdown
Author

I confirmed in fmeum#1 that the message in the explain.log is misleading. In your case, Building libC.jar (1 source file) will not be a rebuild but a disk cache hit.

there is no cache hit because the java compiler classpath changed (libA.jar is no longer in the classpath when compiling C)

@guw guw merged commit f292d50 into guw:main Aug 28, 2023
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.

2 participants