GHA master->feature branch build prerequisites caching

Aleksey Shipilev shipilev at amazon.de
Tue Jul 8 17:29:28 UTC 2025


Hi there,

I would like to spotlight the recent GHA optimization we pushed into mainline this week:
   https://bugs.openjdk.org/browse/JDK-8343546

Read full details in the RFE above.

TL;DR: If you update your personal fork "master" branch every so often, a dry-run job would run on 
that "master" and populate the caches, and then the PR branches off that "master" would be able to 
reuse various cached build prerequisites (jtreg builds, build JDKs, sysroots), without creating them 
again. This is both faster, as this allows to skip quite a bit of setup, more reliable, as creating 
some of these prerequisites sporadically fails, and nicer, as we do not hit external systems too often.

I have been peeking in GHA runs this week, and it seems to work well. So some of you are using this 
improvement already. If this continues to go well, we will consider backports to update releases. 
Please report troubles, if any, to the original RFE:
   https://bugs.openjdk.org/browse/JDK-8343546

Caveat (and the major reason I write this note, really): this advanced caching scheme only works if 
the remote GH knows about pushes to your personal fork "master". It is a part of usual workflow for 
some folks, me included. But I know some just fetch/merge upstream "master" into their PR branches 
directly, without pushing personal "master" updates to remote. That workflow still works, and still 
does use per-branch caching, which is just not that efficient. If you are on the fence which way to 
work with your personal "master" branches, maybe this would give a nudge towards one of the ways.

Enjoy!

-- 
Thanks,
-Aleksey




Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597


More information about the jdk-dev mailing list