Add an OUT_DIR option for finding bindgen output for Android

Android are currently using a sed line to replace our include! to a
module import. As those don't quite behave the same, and we don't want
to carry patches (even as sed lines) downstream like this, we need to
find a convention that works for everyone.

Most of the Rust world uses environment variables to communicate between
the build system and source. However, rather than principled convention,
where each target was passed in a separate environment variable, Rust
picked an inflexible convention of setting an OUT_DIR variable, and then
hardcoding everything else relative to it. It simply assumes the build
placed everything in that directory.

This is problematic for more complex build systems, which would now take
on I/O costs to copy files around into where Rust wants. It's also less
convenient for the build file author. So, instead we went with an
environment variable that carries the entire path. This has worked out,
except that Android's build tool, Soong, cannot express this! It has no
way to specify that some build product's path should be passed in via
some environment variable.

Soong does, however, have some (less preferred, less efficient) way to
emulate the OUT_DIR behavior, by copying files around until it's in the
place that the Rust convention expects. So introduce that option too,
gated on cfg(soong).

Update-Note: When this rolls into Android, remove the sed logic from
Android.bp and instead set up the OUT_DIR cargo emulation.

Bug: b:291253039
Change-Id: Id0afe9259f15f041c953dc5ad945cb9eda24ffc7
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68048
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
1 file changed
tree: 24c7e7dc4e6e8c076e4134a94ab3279672f3f4f4
  1. .github/
  2. cmake/
  3. crypto/
  4. decrepit/
  5. fuzz/
  6. gen/
  7. include/
  8. pki/
  9. rust/
  10. ssl/
  11. third_party/
  12. tool/
  13. util/
  14. .clang-format
  15. .gitignore
  16. API-CONVENTIONS.md
  17. BREAKING-CHANGES.md
  18. build.json
  19. BUILDING.md
  20. CMakeLists.txt
  21. codereview.settings
  22. CONTRIBUTING.md
  23. FUZZING.md
  24. go.mod
  25. go.sum
  26. INCORPORATING.md
  27. LICENSE
  28. PORTING.md
  29. PrivacyInfo.xcprivacy
  30. README.md
  31. SANDBOXING.md
  32. STYLE.md
README.md

BoringSSL

BoringSSL is a fork of OpenSSL that is designed to meet Google's needs.

Although BoringSSL is an open source project, it is not intended for general use, as OpenSSL is. We don't recommend that third parties depend upon it. Doing so is likely to be frustrating because there are no guarantees of API or ABI stability.

Programs ship their own copies of BoringSSL when they use it and we update everything as needed when deciding to make API changes. This allows us to mostly avoid compromises in the name of compatibility. It works for us, but it may not work for you.

BoringSSL arose because Google used OpenSSL for many years in various ways and, over time, built up a large number of patches that were maintained while tracking upstream OpenSSL. As Google's product portfolio became more complex, more copies of OpenSSL sprung up and the effort involved in maintaining all these patches in multiple places was growing steadily.

Currently BoringSSL is the SSL library in Chrome/Chromium, Android (but it's not part of the NDK) and a number of other apps/programs.

Project links:

There are other files in this directory which might be helpful: