summaryrefslogtreecommitdiff
path: root/build.py
AgeCommit message (Collapse)Author
2025-03-13system/btcore: Remove unused sources and headers Henri Chataing
NB: the module fuzzer is not parameterized, and as such has no value Bug: 331817295 Test: m com.android.bt Flag: EXEMPT, dead code removal Change-Id: I364c8d8b7c6e3a633b0193e14021fefd4bd6516f
2024-08-23floss: Fix build faliure: non-void function does not return a value Hsin-chen Chuang
Also enabled Werror in build.py and fixed a warning in bt_service. Bug: 290844854 Bug: 361684591 Tag: #floss Test: mmm packages/modules/Bluetooth Test: USE=floss_upstream emerge-nami floss Flag: EXEMPT, Floss-only changes Change-Id: If832a37a4bd466b0862ca0c4773919b80239fb2f
2024-08-02floss: Add support for running cargo-bloat Abhishek Pandit-Subedi
In order to track how binary space is being used, add support for calling cargo bloat via build.py. See https://crates.io/crates/cargo-bloat for more informatio about the crate which needs to be installed on the host in order to run. Bug: 356808668 Test: mmm packages/modules/Bluetooth Change-Id: I637e7e3f48b38ad9982a43ecbe56e51afcf5431b
2024-08-01floss: Fix env encoding issue with build.py Abhishek Pandit-Subedi
Running commands using subprocess can fail if there are any `None` values in env as os.fsencode throws a TypeError. Manually replace them with empty strings in that case. Bug: 356870224 Test: mmm packages/modules/Bluetooth Change-Id: I6ce9e6e79de073686b102e8c783981f0145b9a4e
2024-06-07floss: build.py: Add clippy target Hsin-chen Chuang
Bug: 343315863 Tag: #floss Test: mmm packages/modules/Bluetooth Test: ./build.py --target clippy Flag: EXEMPT, Floss-only changes Change-Id: Ia7bbcc4128b48ea0f69d97b11aa14a48d88bccf9
2024-04-25Add the sysprop_cpp tool inside floss docker image David Duarte
Bug: 337064224 Test: ./container-build-image.py --use-docker Flag: EXEMPT, floss docker image Change-Id: I8d35ad407a36abca1b85e2f1158a6d945ff1d5ee
2024-04-22floss: Add timeout for git clone Abhishek Pandit-Subedi
Git clone operation is timing out in CI so add a 10-minute timeout to this command. The default timeout can be changed via the --clone-timeout option in build.py. Bug: 336365190 Test: Build in container with different timeouts. Test: m Bluetooth Flag: EXEMPT only affects floss linux build Change-Id: Ia93c1c8fd85f348521020822cecba32688c3cb66
2024-02-06system: fmtlib logger implementation Henri Chataing
- The fmtlib logger is implemented in <bluetooth/log.h>. The header defines the following templated logs function: template<typename T...> log::fatal(fmt::format_string<T...> fmt, T...args); log::error(..); log::warn(..); log::info(..); log::debug(..); log::verbose(..); - Front-end, logs are printed out by invoking these macros with the macro LOG_TAG defined _before_ the inclusion of #include <bluetooth/log.h> - Back-end, a single method must be implemented for all supported platforms (android, floss, host): namespace log_internal { void vlog(Level level, char const *tag, char const *file_name, int line, fmt::string_view fmt, fmt::format_args vargs); } - Default implementations are provided: + vlog_android: outputs to <log/log.h> __android_log_write_log_message + vlog_syslog: outputs to <syslog.h> syslog Bug: 305066880 Test: m libbluetooth_log Test: atest libbluetooth_log_test Flag: EXEMPT, logging utils Change-Id: Ic8a80f113b25d874c372d7dce8252d5428842ee8
2023-12-15Rust protobuf 2->3: Update Bluetooth Ludovic Barman
tldr: remove protobuf2 from Android Rust and upgrade everything to pb3. These commits update: - The grpcio rust crate to use protobuf 3 - The build system to always use the new libprotobuf (pb3) instead of the _deprecated variant (for pb2); they also force-enable libprotobuf everywhere, ignoring the use_protobuf3 flag, removes the tests related to pb2 - The following modules, which required syntax changes: -- packages/modules/Bluetooth -- device/google/cuttlefish -- vendor/auto Bug: 308790516 Test: m rust Flag: EXEMPT 3p rust crate upgrade Change-Id: I6f4589dcf503f3a360c3bc4ade7844e858ed618e
2023-10-02floss: Introduce Rootcanal JohnLai
Specify the USE flag floss_rootcanal to build the floss with rootcanal HCIHAL. Bug: 289480188 Tag: #floss Test: m Bluetooth Change-Id: I402b588d85236be1b80ffb5ad8d6c6e2eb7837d3
2023-09-08Floss: Add missing required packages to bootstrap script Yun-Hao Chung
This adds two required packages - libabsl-dev - liblc3-dev Bug: 299597420 Test: run ./build.py --target clean && ./build.py --target bootstrap Test: mma -j32 Tag: #floss Change-Id: Id449f8f2396e6f0252c99ee7b687127d5652c7ef
2023-06-06floss: Add dependency on pdl-compiler Abhishek Pandit-Subedi
Add a dependency on pdl-compiler in preparation for using it to replace bluetooth_packetgen for Rust. Bug: 283991766 Tag: #floss Test: Rebuild docker container Change-Id: Iba2213f9b8cde1a061c457cac0b56a6a7759067e
2023-04-25floss: Remove rootcanal build rules Henri Chataing
build.py contains rules for building and testing the LMP code, that were added when it was discussed to build the LMP for the emulator. Now that the emulator by default builds the rust LMP using the Cargo.toml files, these rules are no longer necessary. Furthermore, they pull crate dependencies from the chrome directory, which is likely to cause issues in the future as all other build rules for LMP use the crate versionned from AOSP. Test: NA Bug: 238726856 Change-Id: I786f35939b707d5eecff4281be4fb7aee19e4e7b
2023-02-10floss: Add hcidoc tool to read snoop files Abhishek Pandit-Subedi
Hcidoc will be used to analyze snoop files and snooz files to identify errors and other behaviors. This commit simply sets up the hcidoc crate and a simple snoop reader. Bug: 262928525 Tag: #floss Test: ./build.py --target utils Change-Id: I7eeae136a35d51a01ac2ab137dbf114e07f800e9
2023-01-24floss: Update container build to use partial clones Abhishek Pandit-Subedi
Reduce infra load on builds by switching to a treeless clone model. Bug: 265832890 Tag: #floss Test: floss/build/build-in-podman.py Change-Id: Ib65ca131fbed07fbc5ce930782465865ed7dc14a
2023-01-09floss: Pin platform2 commit in build.py Abhishek Pandit-Subedi
Pin the platform2 repo to a certain commit in build.py and add a missing default USE flag required by common-mk. We only depend on common-mk for building so pinning is fine for this repo only. Bug: 264776587 Tag: #floss Test: ./floss/build/build-in-podman.py Change-Id: I1e274473eb756a9ceac078e10ae7f48cd6f0bd05
2022-10-17floss: Default build.py to release builds for Rust Abhishek Pandit-Subedi
Switch build.py to use release builds by default for Rust. This saves us ~5gb in generated files in the build output folder. Bug: 254085165 Tag: #floss Test: ./build.py && ./build.py --target test Change-Id: I5abc239afe97dfb7e0e80d8df75325451b1aaa49
2022-09-28floss: Delete rootcanal Cargo.lock in build.py Abhishek Pandit-Subedi
When running ./build.py --target clean, we should also get rid of the rootcanal build.py so we don't get package conflicts. Bug: 249187187 Tag: #floss Test: ./build.py --target clean and full build after. Change-Id: Ifccc28f38ed0ec8c899dac3430be816b9653bd83
2022-09-18floss: remove libflatbuffers1 from APT package list Michael Sun
libflatbuffers1 is deprecated, remove from the required list. Bug: 247004173 Test: ./build.py Change-Id: Idc27d95554bd4947c81b83abea46680bef754b5d
2022-09-15floss: refuse to build if bootstrapped for a different project Michael Sun
Stop the build if the bootstrapped project is different than the one building, and warn the user to rerun the bootstrap. Bug: 247004173 Test: ./build.py Change-Id: Ia98d28d55014fcb9ff8e484e078e329903b071a9
2022-09-13Floss: Add --print-env to build.py Sonny Sasaka
--print-env prints the same environment variables used by build.py, this is useful for setting up external tools like rust-analyzer. The output can be `eval`-ed directly in shell or copied to the external tool's configuration. Bug: 176846220 Tag: #floss Test: Manual - Ran build.py --print-env Change-Id: I51fe9cc64237207b37ba7f8d98bd386387e735e9
2022-09-12floss: Recover via reset after multiple starts Abhishek Pandit-Subedi
If we attempt to start multiple times and are unsuccessful, try using the reset mechanism to recover instead of trying to start. This also changes the condition for attempting a restart/reset from depending on device presence. On Linux, when we bind the socket as userchannel, the device presence is false (index is removed). It makes more sense to attempt retry if we want the device enabled. Bug: 236709385 Tag: #floss Test: Enable/disable cycles to bad state and trigger reset. Change-Id: I8a9003385f8fcb6d1ac237670087d34ed9590048
2022-09-05Merge "Floss: Fix a tiny typo in build.py warning" Treehugger Robot
2022-08-30Floss: Fix a tiny typo in build.py warning howardchung
Missing .format Bug: None Test: run build.py --target aabbcc Tag: #floss Change-Id: I4957e65fa915409490ece53608374281dd019eae
2022-08-24Add support for cargo build of LMP Ivan Podogov
This change adds an option to skip generating Bluetooth packets using bluetooth_packetgen if these were already built in advance. It also adds crate definition for liblmp, similar to bt_packets. Bug: 238726856 Tag: #floss Test: cargo build Change-Id: Ib099b56c0eb39c37cb459132ddf2a813cb63ebf6
2022-08-11Detect non x86_64 machine in build script. Andre Braga
This change adds functionality to detect whether the host machine is x86_64, which is the only machine currently supported by the build script. Bug: 241967798 Tag: #floss Test: run ./build.py on non x86_64 and observe script exiting, run on x86_64 and observe normal behavior. Change-Id: Ia9837e26c78559e85b00cc8637daa2874cb3d8d8
2022-07-06Fix help text for '--no-clang' flag. Andre Braga
Setting the '--no-clang' flag makes the build use gcc/g++ instead of clang, contrary to current help text. Bug: 238217027 Tag: #floss Test: Manual - Run "./build.py --no-clang" and see that gcc/g++ is being run instead of clang. Change-Id: I0f920141b7bda7ff586ba40d4a97dcefd7d2e7f8
2022-06-16Floss: Check for C++ output dir instead of Rust output dir Sonny Sasaka
To determine whether to re-run build script for btadapterd, check the C++ output dir instead of Rust output dir, otherwise we will always rebuild btadapterd unconditionally. Bug: 203696027 Tag: #floss Test: Manual - cargo build and check that btadapterd is only built once unless there is a change in C++ output dir Change-Id: I54fe4293a64d0d1abad3828d12590b63650d4ee6
2022-05-03Merge changes I744d2ba5,Ieae1a882,Id7604ce3,If99a05bd,I27190251, ... Sonny Sasaka
* changes: Floss: Integrate powerd Suspend/Resume API Floss: Define D-Bus projection for Suspend API in btmanagerd Floss: Refactors ClientDBusProxy to be reusable Floss: Implement no-op Suspend/Resume API Floss: Add ServiceWatcher D-Bus utility Floss: Add protobuf build to btmanagerd Floss: Refactor btmanagerd's RPCProxy
2022-05-02Floss: Add protobuf build to btmanagerd Sonny Sasaka
Prepares build system to support protobuf with powerd D-Bus integration. Bug: 224606285 Tag: #floss Test: Manual - build.py Change-Id: I9b701a84d11dde3ed9414711a371707106f28b57
2022-04-29Floss: Exclude uninteresting warning from Linux build Sonny Sasaka
Added rust flags to hide uninterested warning categories so that we can see more useful warnings easily. Bug: 179821440 Tag: Floss Test: Build Floss on Linux with build.py Change-Id: I168322d83053a2889f9487fb92b2d9220eb82d35
2022-02-16floss: Add missing headers and define Abhishek Pandit-Subedi
Bug: None Tag: #floss Test: ./build.py Change-Id: I10f63f45e16843c953be97b635f362633d4c66a3
2022-02-14Floss: build.py needs a few more apt dependencies Martin Brabham
Bug: 217952161 Test: ./build.py completes (some needed to build libchrome) Tag: #floss Change-Id: I16fe443c367aaa160580a0516b9c247fbe054eea
2022-02-14Add apt package to --run-bootstrap Martin Brabham
Bug: 217952161 Test: Bootstrap complains when libc++abi-dev doesn't exist Tag: #floss Change-Id: I091340718127050046c1932131f7b87c57927680
2022-02-14Fix --run-bootstrap for build.py Martin Brabham
FileNotFound exception when unlinking a non-existent path. Bug: 217952161 Test: Bootstrap completes when common-mk folder doesn't exist Tag: #floss Change-Id: Id7dba2a68e67353a557b2745c33d5b974e595470
2022-02-08floss: Improve build.py for docs and test Abhishek Pandit-Subedi
Add a `-test-name` parameter to filter tests and added a `--target docs` option to generate Rustdocs. Bug: 218551688 Tag: #floss Test: ./build.py --target docs Change-Id: Ifed930a9e04b8560d76a3f9e55d4470375562daf
2021-11-23floss: Add install target to build.py Abhishek Pandit-Subedi
The install target will copy binaries to target directory and strip binaries so that they're smaller. Also add an option to not strip binaries during install (default is to run strip). Bug: 207009162 Tag: #floss Test: ./build.py --target install Change-Id: Ifb805a35623e4243cb28e63478a06ae0747c579f
2021-11-23floss: Update symlinks when re-running --run-bootstrap Abhishek Pandit-Subedi
If re-running --run-bootstrap multiple times, do everything except git clone on re-runs. This makes it possible to switch between multiple repos when developing while sharing the staging directory at ~/.floss. Bug: 207009162 Tag: #floss Test: ./build.py --run-bootstrap Change-Id: Iba7324a3ab88ae47cf275e1492395508135ff76d
2021-11-12Revert "Floss: Fix build post repo migration" Abhishek Pandit-Subedi
This reverts commit ddd429fec4f5794d3f17037b2124e23f8820a364. As it turns out, we will need to change //bt to //bt/system after all because the ChromeOS ebuild can't easily handle the subdirectory change otherwise. Bug: 205591223 Test: Run `./build.py` Tag: #floss Change-Id: I620221cb589712dfc1f84c7ea87a175634a86250
2021-11-08Floss: Fix build post repo migration Martin Brabham
Bug: 205591223 Test: Run `./build.py` Tag: #floss Change-Id: Ibc75b1e171013a24826c8b5f5cbc7b8fbf605547
2021-09-30floss: build.py missing import time Chris Manton
Bug: 200620285 Tag: #floss Test: ./build.py --run-bootstrap && ./build.py Change-Id: Ia6e8212759f87db36ef3f86a5980c2afb7661f14
2021-09-21floss: Refactor build script and merge bootstrapping Abhishek Pandit-Subedi
Removed the separate bootstrap.py and merged its functionality into build.py. With all the changes, this is how you do bootstrapping + building now: ./build.py --run-bootstrap ./build.py This changes defaults to something reasonable in the scripts. A few of the defaults that were changed: * Set bootstrap dir default to ~/.floss * Libdir changed to /usr/lib * Clang made default and --no-clang added instead * Vendored rust made default and --no-vendored-rust added instead Bug: 200620285 Tag: #floss Test: ./build.py --run-bootstrap && ./build.py Change-Id: I305c6baa8a47e958dfa8e136eb60b08fc742effc
2021-09-16rust: Add default functions for Facade Martin Brabham
Bug: 200174377 Test: build floss Tag: #floss Change-Id: Ie9c23f71ff473a881e1e3d56eb495f0ebdc7b09a
2021-06-14Disable building C++ tests for Linux Abhishek Pandit-Subedi
Due to the use of multiple build systems, link dependencies between C++ and Rust where C++ does the final linking will fail. Until we have full Bazel build, we can't enable these tests again. Bug: 190750167 Tag: #floss Test: Build for Linux Change-Id: Iadd7dafe9635f606c2289eb246e3e2eb4931e92c
2021-05-17Refactor topshim with bindgen and unsafe code Abhishek Pandit-Subedi
Writing topshim interfaces is very tedious and lots of code is duplicated in C++. Rather that depend on unsafe C++ code, we write a small amount of unsafe Rust code and use macros to interact with the native layer directly from Rust. A few major changes introduced in this patch: - Bindgen to get Rust interface into C - Macros to call raw pointer functions directly - Macros to handle converting a callback into an enum variant - Refactor code to use new data structures - Replace use of closures for callbacks with an enum and dispatch fn This change also updates the bindgen requirement to 0.57 to match what Android is already using. BYPASS_INCLUSIVE_LANGUAGE_REASON=Bindgen dependency provides this api Bug: 183208689 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: Iebe904ebc2643b48d1a371051fbf3c06f2bf04d4
2021-04-26Change build.py ordering for rust and main Abhishek Pandit-Subedi
Rust now links to C++ instead of C++ to Rust so change the build ordering to match. Bug: 183208689 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: I71518b6efc9e45b880baeb2b7db16bbb0006a6e5
2021-04-23Additional changes for Linux build Abhishek Pandit-Subedi
While building for Linux on cloudtop, a few more problems were identified in the build. There were a couple of missing #include and some incomplete struct definitions in btm_int_types.h. Also put statslog.h behind an #ifdef OS_ANDROID. Bug: 184975659 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: Ic2272a3acfa66259e692db280b48b4ddadff2171
2021-04-07Fix rust build in build.py Sonny Sasaka
This copies the rust build result to the gn output directory to be accessible when linking from C++. Also adds an option to use crates.io for rust crates. Bug: 176846220 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: I9f7732878a2aced6f80f363c25aff3243d34f0d5
2021-04-07Guard printing PKG_CONFIG_PATH in build.py Sonny Sasaka
Bug: 176846220 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: Iba0c739a07bcfa7256ea624e2391d5cee016d2de
2021-03-04Add build.py to simplify building locally Abhishek Pandit-Subedi
This adds a script that can build system/bt locally on your Linux machine. Please see required folder layout in the script on how to prepare your environment and check the help text on how to use it. In its simplest form (for example): ./build.py --out ../build --platform-dir ../staging --clang This will build all of systembt in ../build using the ../staging directory as your source directory and will use the clang compiler to do the build. Bug: 179821440 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: I9c6a9fa30235b2fc661a0fe327154f18a03ca026