1106 Commits

Author SHA1 Message Date
shuixx
62e828fdac strix 2025-07-14 03:15:52 +00:00
Ido Ben-Hur
027b01d48d androidmk_denylist: Allow make files in packages 2025-02-11 22:38:48 +08:00
daniml3
4ac1f093dc sandbox_linux: set CCACHE_DIR as a writable path
Fixes "Read-only file system" error when using ccache.

NOTE: This is only required when both ccache exec and dir are on the
same partition.

Change-Id: I99afe644c8ee0e0b881c1643fef0cb31b83bcd17
2025-02-11 22:23:36 +08:00
LuK1337
0e4dd53982 cleanbuild: Add install to installclean files
Change-Id: Ib46d9638a2b3648d5e2ade1dfa864bc4e2ae695c
2025-02-11 22:15:15 +08:00
Jarl-Penguin
1db2b2cc5f cleanbuild: Add recovery_kernel to installclean files
Signed-off-by: Jarl-Penguin <jarlpenguin@outlook.com>
Change-Id: I89b7093be92cb22a223033f9a7269624f7293c35
2025-02-11 22:15:15 +08:00
Julian Veit
4428f9922b cleanbuild: add *.zip.sha256sum to installclean_files
Change-Id: I91f92349423eeb99e7e4521f6239baabe8b1314c
2025-02-11 22:14:43 +08:00
HeroBuxx
e27da47beb soong: ui: dumpvar: Apparently PRODUCT_SOONG_NAMESPACES is necessary
Bring back PRODUCT_SOONG_NAMESPACES after this change:
3690485a16

Change-Id: I1efa7620d79eb9c330f0f028a91e10d2a9ce49e8
Signed-off-by: HeroBuxx <me@herobuxx.me>
2025-02-11 22:14:31 +08:00
Nolen Johnson
fe9d40342b Add dumpvars for GMS
* For most people and in most enviorments these will
  never pop up, but given we now support GMS variants
  and different build types we ought to tell the user
  which one is in use.

Change-Id: I7639f2e741d9b24e3719ef76d7d532c0155cd988
2025-02-11 22:14:17 +08:00
Abhisek Devkota
5567c50113 Add dumpvar for WITH_SU
-Allow folks to see easily if the term session they are in has
   WITH_SU set to true

Change-Id: Ib310d0016bb9eb16960f794720321b706b6fd8b0
2025-02-11 22:14:06 +08:00
SkyMinus
c5deb2da14 soong: Add MINUS_VERSION to dumpvars
Change-Id: I24b29442f041aec451a173db404f542060ac67d2
(cherry picked from commit 1c1460eb635df8f3627a2e9ff5dee044e4fed850)
2025-02-11 22:13:44 +08:00
Colin Cross
de7d7bcab2 Possible fix for stat error during globbing
Globs can fail when a directory is replaced with a file:
Error checking globs: stat foo: not a directory

Manually check for syscall.ENOTDIR, which is not covered by
fs.ErrNotExist.


Ignore-AOSP-First: "Landing internal first for critical ap4a move"
Bug: 369548825
Test: manual
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c3cd8e3f3c93773f0051608b94a0358554a95c98)
Merged-In: I35f65725b70fc0abb22aff46298d053d98d03b00
Change-Id: I35f65725b70fc0abb22aff46298d053d98d03b00
2024-09-25 20:05:15 +00:00
Treehugger Robot
d4771aa267 Merge "Allow multiple ninja implementations" into main 2024-09-12 22:09:58 +00:00
LaMont Jones
ece626ccac Allow multiple ninja implementations
This permits easier testing and comparison between different ninja
implementations.

Bug: 362926979
Bug: 318434287
Test: manual
Change-Id: Ic058338d0a2fd8c988794a0781dcc93c0f4c03e3
2024-09-12 12:45:27 -07:00
Yaowen Mei
d9108d2d34 Fix a bug in the log directory cleanup logic.
This CL fix the bug that shouldCleanupRBELogsDir() never return true.

The way how shouldCleanupRBELogsDir() use to work is it will return true only if `RBE_proxy_log_dir` flag is not set.

But CI build always got this flag from gcl file, and developer build always got this flag set from ui/build/rbe.go (http://shortn/_K604iWNYkd). So there is never a case this shouldCleanupRBELogsDir() return true. That is to say, we never clean up
RBELogsDir by ourselves.

The reason why this is not a concern is that soong will automatically delete the out/soong/.temp folder every time when user run `m` or `lunch`, and the default RBELogsDir use to be `out/soong/.temp/rbe`. So soong is helping us to clean the logs before.


Previously, I merged this CL: https://r.android.com/3192211 to support running `lunch` in two terminals. In that CL, I moved the auto created RBELogsDir one level up to `out/soong/rbe`. This is causing a problem because RBELogsDir never get cleaned.

This CL will fix the shouldCleanupRBELogsDir() method, after this merged in, 1) if a user didn't set the `RBE_proxy_log_dir` flag, the logs in `out/soong/rbe` will be cleaned each time when running `m`, but `lunch` will not touch `out/soong/rbe`, so we still support running `lunch` in different terminals. 2) If user set `RBE_proxy_log_dir` flag to anything rather than `out/song/rbe`, the directory will not be cleaned by running `m`; 3) we have updated our doc everywhere that `out/soong/rbe` is re-client's default log dir, so I think it should be expected if user set `RBE_proxy_log_dir=out/soong/rbe`, then the logs will be deleted when next time `m` invoked, same as if they set `RBE_proxy_log_dir=out/soong/.temp/rbe` before.


Test: abtd run is green: http://shortn/_KqTvQelstP, local build with multiply lunch is not affected, and running m after a build can clean the out/soong/rbe directory.
Bug: 362798954
Change-Id: I38a7ad650fc59ad06716c5be7de6ecc61ead8eef
2024-09-12 18:08:06 +00:00
Treehugger Robot
ba841f8155 Merge "Add directories below to Android.mk denylist:" into main 2024-09-11 20:36:53 +00:00
Wei Li
7df32b1f69 Add directories below to Android.mk denylist:
device/common/
device/google_car/
vendor/google_contexthub/
vendor/google_data/
vendor/google_elmyra/
vendor/google_mhl/
vendor/google_pdk/
vendor/google_testing/
vendor/partner_testing/
vendor/partner_tools/
vendor/pdk/

Bug: 318428689
Test: CIs
Change-Id: I2242c84aaea844ed19bafd20a68c506c99859fea
2024-09-11 19:36:41 +00:00
Cole Faust
69c78e9b6e Rerun globs when a dependency is missing
If you remove a folder that's part of a glob, soong will error out
currently. Instead treat it like an out-of-date dependency.

Bug: 364749114
Test: m nothing, rm glob folder, m nothing
Change-Id: I86ee755a0815b79192133223f8ef3ecd90669db1
2024-09-10 16:46:06 -07:00
Cole Faust
8ca2a80d27 Merge "Make globs compatible with hash-based ninja semantics" into main 2024-09-10 23:20:10 +00:00
Cole Faust
527dc30f42 Revert "Add BUILD_BROKEN_PYTHON_IS_PYTHON2"
This reverts commit b1fbc79206.

Removing the build broken flag to progress the python3 migration. It's been here for over a year and I haven't heard of any users.

Bug: 203436762
Test: Presubmits
Change-Id: Icfd2d25986abda934c60fd868ed5525dc384fbf3
2024-09-10 10:04:19 -07:00
Cole Faust
2fec4128e0 Make globs compatible with hash-based ninja semantics
Previously, globs worked by having soong_build rewrite a ninja file
that ran the globs, and then dependended on the results of that ninja
file. soong_build also pre-filled their outputs so that it wouldn't
be immediately rerun on the 2nd build.

However, the pre-filling of outputs worked for ninja, because although
it updated their timestamps, the soong ninja file was then touched
by soong_build after that, so the soong_build ninja file was newer
and ninja wouldn't rerun soong. But N2 reruns actions if their inputs'
mtimes change in any way, not just if they're newer. Similarly,
hashed-based ninja implementations could not enforce an order on
file contents, so they would have the same problem.

To fix this, lift the glob checking out of ninja and into soong_ui.
Soong_build will output a globs report file every time it's run, and
every time soong_ui is run it will check the globs file, and if any
globs change, update an input to soong_build. soong_ui is essentially
doing what was done in ninja with bpglob actions before.

Bug: 364749114
Test: m nothing, m nothing again doesn't reanalyze, create a new file under a glob directory, m nothing again reanalyzes
Change-Id: I0dbc5ec58c89b869b59cd0602b82215c4972d799
2024-09-09 17:42:49 -07:00
Cole Faust
3ae36f42dc Remove zeros from build number
The zeros were kept in place of the timestamp in case people were
parsing it. Let's try to remove the zeros now and see what breaks.

Test: Presubmits
Change-Id: Ic52168f6be05a74323d8e47935de5c6a5cf15516
2024-09-09 16:54:16 -07:00
Treehugger Robot
b32516985d Merge "Remove Android.bp file input to primaryBuilders" into main 2024-09-05 23:26:59 +00:00
Cole Faust
eda96ba50f Remove Android.bp file input to primaryBuilders
The soong primary builder action lists all the Android.bp files
as dependencies via a depfile. The top-level one doesn't need to be
listed as an input explicitly. I think it was there from the early
days of soong when soong started at the top-level Android.bp file and
traversed downwards through references via the subdirs or
optional_subdirs variables.

Bug: 364749114
Test: Presubmits
Change-Id: I72eabe4d4179696bfa258c8c4c56351a132e0870
2024-09-05 15:26:32 -07:00
Taylor Santiago
c162dfac78 Undo filtering of HOME environment variable.
It an cause 'nonexistent' user errors in the sandbox.

Bug: 363037195
Change-Id: I5e17fa62029ba9bcd2422fa9aebef95223c68c0d
2024-09-05 19:43:27 +00:00
Taylor Santiago
8b0bed7187 Reapply "Clean environment variables to account for sandbox work directory."
with minor edits.

This reverts commit 9543d19b4b.

Bug: 363037195
Change-Id: I4cb10b312b7f468185bfad12a16f9b4b64e7a58a
2024-09-04 22:55:02 +00:00
PODISHETTY KUMAR (xWF)
cdd70d268a Merge "Revert "Clean environment variables to account for sandbox work directory."" into main 2024-09-02 06:57:34 +00:00
PODISHETTY KUMAR (xWF)
9543d19b4b Revert "Clean environment variables to account for sandbox work directory."
This reverts commit 0af8ea14fc.

Reason for revert: <Droidmonitor created revert due to b/363848580. Will be verifying through ABTD before submission.>

Change-Id: Iafba28897ad27df67ef8ae8904454196c482216d
2024-09-02 03:54:36 +00:00
Taylor Santiago
3cd732bcd1 Merge "Clean environment variables to account for sandbox work directory." into main 2024-08-31 04:04:22 +00:00
Taylor Santiago
0af8ea14fc Clean environment variables to account for sandbox work directory.
Unset HOME to prevent username leak.

Bug: 363037195

Change-Id: I7a8694f746d58de8f6e41adb6ad52abbaf955ef4
2024-08-29 20:12:35 +00:00
Wei Li
91a1e9f894 Merge "Add "packages/" to Android.mk denylist." into main 2024-08-26 21:24:56 +00:00
Wei Li
ffb99497a7 Add "packages/" to Android.mk denylist.
Bug: 318428689
Change-Id: I229fb645cdf03881ed709216dd6743d456440403
Test: CIs
2024-08-23 22:54:40 +00:00
Qing Shen
713c54289c Revert "Revert "Add a coverage suffix to avoid Ninja file regene..."
Revert submission 3235973-revert-3207217-emma-flip-time-saver-BYWASVIMTD

Reason for revert: Rolling forward with a fix

Adding a coverage suffix for product_config.go too:

FAILED: ninja: 'out/soong/soong.sdv_core_cf.extra.variables', needed by 'out/soong/.intermediates/build/soong/product_config/product_config.json', missing and no known rule to make it
03:42:23 ninja failed with: exit status 1

Reverted changes: /q/submissionid:3235973-revert-3207217-emma-flip-time-saver-BYWASVIMTD

Change-Id: I74d0e3fda09b1367f3dbb939d4f47c4d09b3d51f
2024-08-23 21:41:52 +00:00
Cole Faust
4e58bba1fc Use musl build of n2
We're seeing bugs on the build server only, and previous similar bugs
were caused by issues in the older version of glibc the build server
uses, so try using the musl build of n2 to see if it resolves the
issues.

Bug: 318434287
Test: Presubmits
Change-Id: I416cd77f4dfb4ca04f6dd5b36fa73585a2904b55
2024-08-22 14:27:03 -07:00
Hugo Drumond Jacob
079871cd55 Merge "Revert "Add a coverage suffix to avoid Ninja file regeneration."" into main 2024-08-21 17:20:34 +00:00
Hugo Drumond Jacob
134fa5df00 Revert "Add a coverage suffix to avoid Ninja file regeneration."
Revert submission 3207217-emma-flip-time-saver

Reason for revert: b/361236607

Reverted changes: /q/submissionid:3207217-emma-flip-time-saver

Change-Id: I7b4dcd3f6e73e302a2c3ef7ed5c02f6345619463
2024-08-21 13:07:06 +00:00
Qing Shen
ff545caecd Merge "Add a coverage suffix to avoid Ninja file regeneration." into main 2024-08-20 01:16:53 +00:00
LaMont Jones
b2ab527798 Pass through RUST_LOG
If the user has RUST_LOG set in the environment, pass that through.

Bug: 352600283
Test: manual
Change-Id: Ia6bfa4be791a8e72591fc729de4e4270df150a1c
2024-08-14 10:08:50 -07:00
Qing Shen
9e05d1c5cd Add a coverage suffix to avoid Ninja file regeneration.
This CL uses the environment variable, EMMA_INSTRUMENT to determine whether or not coverage is enabled. If coverage is enabled, it adds a bunch of suffixes to the files generated in out/soong/ folders.

This change reduces the build time by avoiding ninja regeneration when users simply switches from atest to atest --experimental-coverage, or vice versa, and no Android.bp changes are made.

Bug: 331444846
Test: Locally run m libc, and then EMMA_INSTRUMENT m libc twice, no ninja regenerations required. Compared the hash of out/target/product/vsoc_x86_64/ between the before-change repo and after-change repo. Only diff is the after-change directory contains an extra file `out/target/product/vsoc_x86_64/.installable_files` while the original directory has only `out/target/product/vsoc_x86_64/.installable_files.previous`, both files have the same hash.
Change-Id: I972aec20a9d97b223cc833ee245016ac4b0f09a2
2024-08-13 02:04:53 +00:00
Taylor Santiago
2611851112 Individually mount children of root with ABFS enabled and respect
OUT_DIR configuration.

Mounting '/' directly as read-only results in failed bindmounts at /src
if that directory does not already exist due to failure to mkdir.

Change-Id: I7f11c45e82374d142a86fcb2f03e53ddacffffb8
2024-08-12 12:06:29 -07:00
Taylor Santiago
60fa202bb5 Merge "Use consistent directory for source and output inside the build sandbox for ABFS." into main 2024-07-31 17:55:41 +00:00
Taylor Santiago
ca30e08b9d Use consistent directory for source and output inside the build sandbox
for ABFS.

A consistent source directory addresses problematic full path inputs and
outputs, which can manifest as cache misses or build failures after an ABFS
patch application.

Bug: 347704053
Change-Id: Ib2297bb0b904b1b490e83c22fd468eee928e53fe
2024-07-30 13:52:31 -07:00
Yaowen Mei
d4da266b35 Fix RBE tmp dir
The RBE tmp dir holds all the re-client logs and socket files.

Currently, it is being created as the `out/soong/.temp/` dir, which is auto deleted by Soong. This is causing problems because while a build is running, user cannot open a second terminal and run `lunch`.

This CL fixes the issue by creating the RBE tmp dir in the `out/soong/rbe/` directory. The next RBE build will clean this folder.


Bug: 349664018
Change-Id: Ib238e48f5b19755b016263b45f02b1be3e8efb35
2024-07-30 14:21:04 +00:00
Christopher Ferris
cdd872a5be Merge "Update tests to expect RBE not supported on linux." into main 2024-07-26 17:58:26 +00:00
Wei Li
9f13555225 Merge "Generate SBOM of products in Soong." into main 2024-07-26 00:45:43 +00:00
Christopher Ferris
1db36e3888 Update tests to expect RBE not supported on linux.
Bug: 354280127

Test: Passes on linux
Test: Treehugger for the rest.
Change-Id: Ic1546a153e7e761a2132409743650cbf0a0b1ba6
2024-07-25 16:52:31 -07:00
Taylor Santiago
dd65d3e672 Merge "Add ABFS (Android Build Filesystem) configuration option to Soong" into main 2024-07-25 21:04:06 +00:00
Wei Li
b85a178b07 Generate SBOM of products in Soong.
Bug: 324465531
Test: CIs
Test: m soong-sbom
Change-Id: If76776851d49282829a79bfb1c33f05b8f57de31
2024-07-24 18:23:13 -07:00
Treehugger Robot
c7eb3bdae7 Merge "Highlight build failures in soong output" into main 2024-07-18 20:13:15 +00:00
Colin Cross
ea1b3b78b8 Merge changes from topic "elide_empty_variants" into main
* changes:
  Convert sdk mutator to TransitionMutator
  Convert link mutator to TransitionMutator
  Convert version mutator to TransitionMutator
  Convert python_version mutator to TransitionMutator
  Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
2024-07-18 17:37:38 +00:00
Treehugger Robot
865b877027 Merge "Generate .build-id directory tree after every build." into main 2024-07-17 23:13:24 +00:00