Build system backends should be reproducible and we should have automated testing to ensure this
Categories
(Firefox Build System :: General, task)
Tracking
(Not tracked)
People
(Reporter: rstewart, Unassigned)
References
Details
One would expect that running ./mach configure
/./mach build-backend
multiple times without changing any files in tree would always produce the same build backend files, but we haven't generally bothered to maintain this environment. I've tried to fix the majority of the major issues in bug 1617748 but 1) I may have missed some stuff and 2) there's no guarantee things won't regress in the future.
We should have something more robust in place to detect and prevent regressions in reproducibility in the future. Anything from additional unit tests to further integration/end-to-end tests that specifically check diffs between subsequent runs of build-backend
can work here.
Comment 1•5 years ago
|
||
Would it make sense to include 'export' as well? That would have helped avoid issues with sccache misses due to python3 re-ordering some header files, for example. Though it wouldn't catch all generated files, since some are done during the compile/misc tier.
Reporter | ||
Comment 2•5 years ago
|
||
Every generated file/export/etc. SHOULD be reproducible AFAIK, and it makes sense to include generated files under the purview of this bug where it makes sense.
I'm not really sure what this automated testing would look like right now, so if we come up with a design that works for that stuff as well as build backends, that would be great news :)
Comment 3•5 years ago
|
||
I think it could be similar to the reproducible-linux32 job, which depends on two build jobs and compares the tarballs. Only instead of comparing the output of 'mach package', we'd need to generate a separate artifact after build-backend (or export, to do it all at once) that bundles up the objdir. The equivalent of the reproducible-linux32 task would then be diffing the two objdirs instead of two packages. Testing locally, tarring the objdir after export is less than 4 seconds and makes a 26MB artifact, so it could probably be added to an existing build. Then the diff just needs to ignore some files:
diff -x ".pyc" -x last_log.json -x build_resources.json -x buildid.h -x config.log -x application.ini -x application.ini.h -x ".pp" -x "*.stub" -r objdir-1 objdir-2
Some of those only differ because of the buildid - if the reproducible-linux32 jobs already enforce the same buildids, then they don't need to be skipped.
Comment 4•5 years ago
|
||
That artifact exists in most part: target.generated-files. The reproducible-linux32 job even checks it... but only when the firefox package differs.
Comment 5•5 years ago
|
||
I think it would be reasonable to split the check of firefox package and generated files in two different tasks, and run both all the time.
Comment 6•5 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #4)
That artifact exists in most part: target.generated-files. The reproducible-linux32 job even checks it... but only when the firefox package differs.
Oh, awesome. Is there any reason we couldn't stuff the output from build-backend into that artifact as well?
Comment 7•5 years ago
|
||
(In reply to Michael Shal [:mshal] from comment #6)
(In reply to Mike Hommey [:glandium] from comment #4)
That artifact exists in most part: target.generated-files. The reproducible-linux32 job even checks it... but only when the firefox package differs.
Oh, awesome. Is there any reason we couldn't stuff the output from build-backend into that artifact as well?
It would be good to be sure it doesn't bother whatever else than the diff tasks consumes those artifacts. Worst case scenario, we create a separate artifact with the build system files only. BTW, we have config.status already, whichever we end up doing, it could stop being its own separate artifact.
Comment 8•5 years ago
|
||
The generated-files tarball comes from bug 1259832 and is consumed for crash reports.
Comment 9•5 years ago
|
||
They are used to generate things like https://crash-stats.mozilla.com/sources/highlight/?url=https://gecko-generated-sources.s3.amazonaws.com/7b7b2307b0b1ad9d9473b29b4ddd983c84dcaf12f414d6241e3a57f5c7e63861554c1a83411fdebc971bf0276a00b647014e5dcf8e4e7bf9e35e0045f696cbd5/x86_64-pc-windows-msvc/release/build/style-01c3fa3241b81090/out/properties.rs&line=78521#L-78521
So it might be better to stick things in a separate archive.
Updated•5 years ago
|
Updated•2 years ago
|
Description
•