Add OUT_DIR to rust_bindgen for boringssl
Using custom envflag is not how rust_bindgen output is included normally
and this makes it even more compatible with how Soong does `rust_bindgen`.
I have enabled this only for the `bssl-sys-rust` in order not to break
https://boringssl-review.googlesource.com/c/boringssl/+/72487 when it
lands.
The newly introduced param `MODULE_BINDGEN_OUTPUT_FILE` will output
the rust bindgen file to `build-root/{project_name}/{path_to_header_file_used_for_bindgen_generation}/{MODULE_BINDGEN_OUTPUT_FILE}`
while the previous approach would be `build-root/{project_name}/{path_to_header_file_used_for_bindgen_generation}/{header_filename.rs}`
which means that the previous approach was not vulunerable to having
duplicate output because it is impossible to have two file with the
same name and path. However, this approach can lead to conflict
if two different bindgen has two different header path and same
`MODULE_BINDGEN_OUTPUT_FILE`. This should be fine as this will lead to
an error if it happens and can be quickly solved by choosing a different
`MODULE_BINDGEN_OUTPUT_FILE` for the rust bindgen.
It's important to note that this kind of conflict will be very rare
but it's important to note it down.
Test: ./trusty/vendor/google/aosp/scripts/build.py generic-arm64
Bug: b/373864033
Change-Id: I38a07ded9aa4ee5c4ebaad0b5562ae38af7197e7
2 files changed