I can't remember seeing any cc_test target at Google that ran with realistic release optimizations (AutoFDO/SamplePGO+LTO) and even if they did it's still not the release binary because it links in the test case and the test main function.
Re:You don’t need reproducible builds
by joshuamorton on Wednesday August 05, 2020 @01:12PM
(#24063128)
Did you look in the CI system for configurations there? I see FDO enabled in those tests. (Speaking at a high level, configurations can be modified in bazelrc and with flags without being explicitly listed in the cc_test rule itself)
> release binary because it links in the test case and the test main function.
Sure, but it's verifiably the same object files as get put into the release artifact.
Re:You don’t need reproducible builds
by tomjakubowski on Wednesday August 05, 2020 @03:03PM
(#24064307)
> Sure, but it's verifiably the same object files as get put into the release artifact.
Well, not if you use LTO.
Of course.
> I would say that hardly anyone runs unit tests on release build artifacts just because it takes forever to produce them.
I don't know that this follows: just because 99% of the invocations of your unit test are in fastbuild doesn't mean that you don't also test everything in opt at least once.