Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and remove proxy generation objects #629

Merged
merged 64 commits into from
Jul 13, 2023

Conversation

birunts
Copy link
Collaborator

@birunts birunts commented Jul 13, 2023

This PR makes refactor for cclibs to use provider interfaces as also removes proxy objects used within bob_genrule & bob_gensrcs.
There are also few fixes applied.

Refactor CompileObjs to be shared between legacy
library targets and new strict library targets.

Change-Id: I15596317ae56083edf6dd5e3f7deb24207f05017
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I623f07a02e834b363db5d21c9cab400087e5adae
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I5958f729f2d642586fb094c8a50385823e0f7e14
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I3512be7adf621ee85e5fa75d7d7df47868732bc8
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Iba493bc1f7f14b2ced5040dd2cc6d54fee7de99f
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I5c97af4fe1aee7f9a5dabb072d59afa2cd6718c4
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I8e0da7d71ccee56d22f48411808a89b36e02ca5f
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I5bc784f4c578f8fb9b07b927fe5e7f142acf0055
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I93d12d53c7d355f60a5cc64e0a645b704aa0a89f
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I9e404d200c049eec7a67af5ed5d9a82dbed1e82f
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
This method was only used for Binary actions and
in the longer term we will be using the file provider
instead.

Change-Id: I520ec3bf2611e87e2b6fdc1c040670203ee3d1f3
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: If352441df641a121529a2a298b7ca0b13608201a
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Update unit tests.

Change-Id: Ic103eaffd23effd7802c8ba7316c42333506f360
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I3eb92f5ab723c79310dfa9636d98082502a8ccc1
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Icc3ad56786b140ebef2ed2ddb9ae4ebce4b8c54d
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I26bf2a645f2888a77259e84c7839b92ec1244f88
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I1eb085f533886408593229b479188973dddbbd15
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I700ac1f55f91b9a104d070f67f9dc50d72785026
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I94272e94a125bd92c0a1d352789f410511ea7647
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Remove outs where possible to prepare for
switchover to file.

Change-Id: Idf4c9ec8fad9b6a9a53f38ec5e4319d675120c9e
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
This interface is no longer needed as the
modules should be using FlagProvider.

Change-Id: I259a38a253e3125fb1a1d051e8384905340f3593
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Rename `GetGeneratedHeaders` to `GetGeneratedHeadersFiles`
and make it generic across file providers. This removes
the need for `outputs` calls.

Change-Id: I817c6ab672b1bd6d098d460ac54486306c3bae53
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I467e87635ce01e7b1e091bbf5403ab74c736e92d
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I6e849f5b7b137a43e6dd8506cd418883b05dd0be
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I652f28325bbb2e61fc761577197c01936224d7de
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: If35fcac1cf773b3949383499a027a8cb04bfe671
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I6fd76e8615a21a0782befd8943226fbf8e8eecbf
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
This is now replaced by file provider.

Change-Id: If1cf36045e00d96163638f64988424455a599a9a
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ic9439c289f09b62a18dce5164f8d7a4566ddfe12
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I4966557a6440c01f73f86d0b7893e28f9cc02f44
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
lukokr-aarch64 and others added 26 commits July 10, 2023 14:22
Change-Id: I2199c3fd926cd166cd1ff7d0391ac31edf442cc4
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ibd5a7f4b708679cbdc8aa3056fb5f8326466b801
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ib9a20d5175cacc38632eea06a2f9ff8231f79ab3
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ie14d3bc367c6d8899ccae39ceb3517e64303f4b6
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Removes the need for getSharedLibTocPath

Change-Id: Iaa9ae89ae246a8218da4fc4afd4bad09f833069e
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ic02cc869be2d5f3d8128c2b25c4f0d1f07c1945b
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ib27e7e482f5b3d61b1f9202d9940a00e74460a3d
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
`bob_gensrcs` should implement `DynamicFileProvider`
to allow to compute the output file names.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I29f7783ffab2987dd4566e0b20786a459da4ec88
Add `generateInouts` method for `ModuleGenrule`
& `ModuleGensrcs`.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ic5cfcdddc7737138c781fd7bd4abcc085d6cc91e
Building rules part can be separated
and reused also for strict generation
modules after resolving all arguments.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I32af57e06e50082afe1770c337e9f2daf8b2e019
`processPaths` has wrongly prefixed paths
of `Tools` which should be host executable
modules. This has to be done just for
`Tool_files` as those refer to local files.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I54066349a660064202a29cf4ee9810969f0315f2
`bob_genrule` & `bob_gensrcs` can use either
curly braces `${}` or normal braces `$()`
interchangeable for variables in `cmd`.
Mixing those introduces confusion and needs
special replacing within the code.

As Blueprint handles only curly braces `${}`
Bob simplifies this for all modules and forbids
use of normal braces `$()`.

In the other hand Android uses normal braces for
its native rules thus those will be replaced
only in this case to `$()` while generating
Android.bp file.

BREAKING CHANGE: `$()` for variables is not
supported anymore in `build.bp` files.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I24f8a0c3bee8d71af7b2c2085f07b027fb3cb0da
`AndroidGenerateRuleProps` properties are
a bit misleading and should be renamed to
more miningful name `GenruleProps`.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ic699fa548be8b5beadced1ba1be7cabb92a623e2
Rename `AndroidGenerateCommonProps` to more
meaningful name `StrictGenerateProps`.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I6e961ce211df5faeeb1e95e97a73f6f537e879fc
Rename `GensrcsRuleProps` to more meaningful
`GensrcsProps` name.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I4a19e50f2a1ef949a89483636d9dccb098cc4750
Rename `ModuleGenruleCommon` to more
meaningful `ModuleStrictGenerateCommon` name.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I07863f8f11e4611a83b4fbb3bc5ca510e9da7a38
Rename `getAndroidGenerateCommonInterface` to
more meaningful `StrictGenerator` name.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I3b2eba7386af60150019f10b2d992808c41c4ed2
Move `ModuleStrictGenerateCommon` and
`StrictGenerateProps` to separate files.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I03f20756c275e18938ef2187c1798f749abcd249
`hostBinOuts` can be used by multiple
modules and should not be just the
`ModuleGenerateCommon`s method.

Change-Id: Ie067afd2eaf29a6c83c35e4be781636b59473593
Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Call direct object method.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I56bb7f52c7ca6f1a63d9590219b4c86133cdfebd
Add `ModuleGensrcsInterface` and
`StrictGenerateCommonInterface` implementation
check interfaces.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I2eeb06db2155be8f66a04fe915e33909990778ed
Move regexp variables to `strict_generate_common.go`.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I29d40f42a48877a1da6982b95f9725032df0ba0d
Correctly generate and use depfile for
`bob_genrule` & `bob_gensrcs`.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ib007c00e5dfbde12013497f997ac6c0f2a7c2704
Change adds new functionality to obtain
arguments for strict generate modules
as also parse `cmd` method.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I214615db73f12ca1293abf08d704080081267a1a
Add new method to generate `linuxBackend`
output for strict `bob_genrule` & `bob_gensrcs`
modules.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: I940e1243229fa3f91090573f3df1dc4a0ce78366
Remove proxy objects for strict `bob_genrule`
and `bob_gensrcs` to generate proper
output.

Remove unused code.

Signed-off-by: Sebastian Birunt <sebastian.birunt@arm.com>
Change-Id: Ia4a85c8bdb05173c7488e3b35f6507a52fdf6e8a
@github-actions
Copy link

LCOV of commit 6180a49 during CI #405

Summary coverage rate:
  lines......: 36.3% (4485 of 12340 lines)
  functions..: no data found
  branches...: 62.0% (556 of 897 branches)

Files changed coverage rate:
                                                 |Lines       |Functions  |Branches    
  Filename                                       |Rate     Num|Rate    Num|Rate     Num
  =====================================================================================
  core/androidbp_cclibs.go                       | 4.5%    396|    -     0|    -      0
  core/androidbp_generated.go                    | 0.0%    238|    -     0|    -      0
  core/androidbp_kernel_module.go                | 0.0%     75|    -     0|    -      0
  core/backend/androidbp.go                      | 0.0%     67|    -     0|    -      0
  core/backend/backend.go                        |57.9%     19|    -     0|    -      0
  core/backend/linux.go                          |60.0%     45|    -     0|    -      0
  core/binary.go                                 | 0.0%     31|    -     0|    -      0
  core/build.go                                  | 0.0%     45|    -     0|    -      0
  core/build_structs.go                          | 0.0%    347|    -     0|    -      0
  core/file/file.go                              |86.5%     96|    -     0|    -      0
  core/file/file_test.go                         | 100%    102|    -     0|    -      0
  core/file/filegroup.go                         |69.7%     66|    -     0|    -      0
  core/file/filegroup_test.go                    | 100%     58|    -     0|    -      0
  core/gen_binary.go                             | 0.0%     43|    -     0|    -      0
  core/gen_library.go                            | 0.0%     82|    -     0|    -      0
  core/gen_shared.go                             | 0.0%     71|    -     0|    -      0
  core/gen_static.go                             | 0.0%     60|    -     0|    -      0
  core/generated.go                              | 0.0%    149|    -     0|    -      0
  core/generated_common.go                       | 0.0%    274|    -     0|    -      0
  core/install.go                                | 0.0%    189|    -     0|    -      0
  core/kernel_module.go                          | 0.0%    165|    -     0|    -      0
  core/legacy_source_props.go                    | 0.0%     33|    -     0|    -      0
  core/library.go                                | 0.0%    516|    -     0|    -      0
  core/library_shared.go                         | 0.0%     82|    -     0|    -      0
  core/library_static.go                         | 0.0%     29|    -     0|    -      0
  core/linux_backend.go                          | 2.1%    193|    -     0|    -      0
  core/linux_cclibs.go                           | 0.7%    412|    -     0|    -      0
  core/linux_generated.go                        | 0.0%    194|    -     0|    -      0
  core/linux_kernel_module.go                    | 0.0%     37|    -     0|    -      0
  core/module_generate_source.go                 | 0.0%    106|    -     0|    -      0
  core/module_genrule.go                         | 0.0%     92|    -     0|    -      0
  core/module_gensrcs.go                         | 0.0%    101|    -     0|    -      0
  core/module_transform_source.go                | 0.0%    106|    -     0|    -      0
  core/source_props.go                           | 0.0%     57|    -     0|    -      0
  core/strict_generate_common.go                 | 0.0%    168|    -     0|    -      0
  core/strict_generate_props.go                  | 0.0%     60|    -     0|    -      0
  core/strict_library.go                         | 0.0%    165|    -     0|    -      0

@lukokr-aarch64 lukokr-aarch64 merged commit 3e7f491 into master Jul 13, 2023
32 checks passed
@lukokr-aarch64 lukokr-aarch64 deleted the refactor_and_remove_proxy branch July 13, 2023 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants