This adds a tool for managing pre-generated files, aligning our CMake and non-CMake builds. The plan is roughly: The source of truth for the file lists will (eventually) be build.json. This describes the build in terms of the files that we directly edit. However, we have a two-phase build. First a pregeneration step transforms some of the less convenient inputs into checked in files. Notably perlasm files get expanded. This produces an equivalent JSON structure with fewer inputs. The same tool then outputs that structure into whatever build systems we want. This initial version pre-generates err_data.c and perlasm files. I've not wired up the various build formats, except for CMake (for the CMake build to consume) and JSON (for generate_build_files.py to parse). build.json is also, for now, only a subset of the build. Later changes The upshot of all this is we no longer have a Perl build dependency! Perl is now only needed when working on BoringSSL. It nearly removes the Go one, but Go is still needed to run and (for now) build the tests. To keep the generated files up-to-date, once this lands, I'll update our CI to run `go run ./util/pregenerate -check` which asserts that all generated files are correct. From there we can land the later changes in this patch series that uses this more extensively. My eventual goal is to replace generate_build_files.py altogether and the "master-with-bazel" branch. Instead we'll just have sources.bzl, sources.gni, etc. all checked into the tree directly. And then the normal branch will just have both a CMake and Bazel build in it. Update-Note: generate_build_files.py no longer generates assembly files or err_data.c. Those are now checked into the tree directly. Bug: 542 Change-Id: I71f5ff7417be811f8b7888b345279474e6b38ee9 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67288 Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
1002 B
Pre-generated files
This directory contains a number of pre-generated build artifacts. To simplify downstream builds, they are checked into the repository, rather than dynamically generated as part of the build.
When developing on BoringSSL, if any inputs to these files are modified, callers must run the following command to update the generated files:
go run ./util/pregenerate
To check that files are up-to-date without updating files, run:
go run ./util/pregenerate -check
This is run on CI to ensure the generated files remain up-to-date.
To speed up local iteration, the tool accepts additional arguments to filter the
files generated. For example, if editing aesni-x86_64.pl, this
command will only update files with "aesni-x86_64" as a substring.
go run ./util/pregenerate aesni-x86_64
For convenience, all files in this directory, including this README, are managed by the tool. This means the whole directory may be deleted and regenerated from scratch at any time.