Commit graph

1885 commits

Author SHA1 Message Date
Lukacs T. Berki
5353744f1d Remove global variables from Blueprint.
The end goal of this exercise is to remove all mutable global state so
that multiple Blueprint instances can be run in the same process.

This is done by plumbing the necessary data through the configuration.

Test: Presubmit.
Change-Id: I040a461ae17705258b882b3a44740a4dd5027a2c
2021-03-17 08:06:38 +01:00
Jooyung Han
6704030713 Add ShellEscapeIncludingSpaces(string) am: ddb5ed7e1f am: 41ea2da6af am: 7f2f6ea504
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1620991

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0803915c413351ec45f0905a5694ce69915296fa
2021-03-12 10:43:24 +00:00
Jooyung Han
7f2f6ea504 Add ShellEscapeIncludingSpaces(string) am: ddb5ed7e1f am: 41ea2da6af
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1620991

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic7fd9d76711bb1cf77e7da3cd57bb0a9727f8a19
2021-03-12 09:59:58 +00:00
Jooyung Han
41ea2da6af Add ShellEscapeIncludingSpaces(string) am: ddb5ed7e1f
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1620991

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I65daf1c2bb22165fb0a1d65c7837c576a98cf3a2
2021-03-12 09:19:56 +00:00
Jooyung Han
ddb5ed7e1f Add ShellEscapeIncludingSpaces(string)
ShellEscape(string) doesn't escape a string with spaces like "arg1
arg2". However, when we want to escape a string to use it as an
argument, then strings with spaces should be escaped.

For example,

  "command " + ShellEscapeIncludingSpaces("a b")

becomes "command 'a b'" so that "command" will get "a b" as a single
argument.

Bug: 182092664
Test: Added tests to escape_test.go
Change-Id: I8f88c18bc4f9f7aacfe9e701b8f0876dd8b9a8c3
2021-03-12 14:37:42 +09:00
Lukács T. Berki
3a46f0d341 Merge "Fix quoting issues when generating build.ninja ." am: 51868f1577 am: 705d040fe7 am: 6cdf3d00f2
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622515

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4119acc0fd90c98a0303fbe91be60ca04c07eea6
2021-03-10 08:48:05 +00:00
Lukács T. Berki
6cdf3d00f2 Merge "Fix quoting issues when generating build.ninja ." am: 51868f1577 am: 705d040fe7
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622515

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I54130017b6f42a9f781aa76583265285b1229ea2
2021-03-10 08:11:29 +00:00
Lukács T. Berki
705d040fe7 Merge "Fix quoting issues when generating build.ninja ." am: 51868f1577
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622515

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4d4c49d33bbbd042deca6a9cb73c13efb73f6b2f
2021-03-10 07:28:59 +00:00
Lukács T. Berki
51868f1577 Merge "Fix quoting issues when generating build.ninja ." 2021-03-10 07:03:48 +00:00
Colin Cross
2701112713 Merge "Fix numericStringLess and add tests" am: 73dd495dee am: d49f80433d am: 6ada468f99
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622932

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9194f1741f04033b67ad8a967bce48e967f55646
2021-03-09 19:01:19 +00:00
Colin Cross
6ada468f99 Merge "Fix numericStringLess and add tests" am: 73dd495dee am: d49f80433d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622932

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic92b162e59850125198d4641a835ef09c0d48de2
2021-03-09 18:18:37 +00:00
Colin Cross
d49f80433d Merge "Fix numericStringLess and add tests" am: 73dd495dee
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622932

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3e52b56de3af7c468434f50beb5925737870634e
2021-03-09 17:57:12 +00:00
Colin Cross
73dd495dee Merge "Fix numericStringLess and add tests" 2021-03-09 17:25:56 +00:00
Lukacs T. Berki
714a686aed Use stageDir() to determine the install directory. am: 7d2e60ece7 am: da1e23b7ef am: a78548403e
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622883

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idb683b9e346b6059da8e6fddf40e16023839f6d5
2021-03-09 10:31:14 +00:00
Lukacs T. Berki
a78548403e Use stageDir() to determine the install directory. am: 7d2e60ece7 am: da1e23b7ef
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622883

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If680d3730c5e700fd5feda8ee232fadb9ad5cfa0
2021-03-09 09:44:30 +00:00
Lukacs T. Berki
da1e23b7ef Use stageDir() to determine the install directory. am: 7d2e60ece7
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1622883

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11d3381999e3fa9e08e97cd0e75c6d6e74486cf7
2021-03-09 09:05:18 +00:00
Lukacs T. Berki
0bd3de33fd Fix quoting issues when generating build.ninja .
Some of these were introduced in aosp/1610784 and some others were
present since a good while.

Test: Manual: "m nothing"
Change-Id: I7d5cb56ca2d87cb439354fd1b298c3b8d97d665d
2021-03-09 09:32:54 +01:00
Colin Cross
eb15c126c3 Fix numericStringLess and add tests
numericStringLess("1a", "11a") would strip the equal prefix "1" and
then compare the bytes "a" and "1", when it should have compared the
numbers 1 and 11.  Fix it by handling the case where the last equal
byte was numeric and the first differing byte is numeric in one
string and non-numeric in the other.

numericStringLess("12", "101") would strip the equal prefix "1" and
then compare the numbers 2 and 01, when it should have compared the
numbers 12 and 101.  Fix it by tracking the beginning of the sequence
of numeric bytes containing the differing byte.

Test: sort_test.go
Change-Id: I8d9252a64625ba6a3c75d09bb1429dcb1115e3e1
2021-03-08 17:59:55 -08:00
Lukacs T. Berki
7d2e60ece7 Use stageDir() to determine the install directory.
In particular, for Go binary modules.

Test: Manual ("m nothing")
Change-Id: I98d184a00f1a48bc68e4b03747331fd449e37de1
2021-03-08 16:48:38 +01:00
Lukacs T. Berki
3992917a44 Make debugging easier: am: 122b3ee153 am: 5506289b6d am: b89005d459
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1610784

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I578d3f005894a8be05dfac118aba390014ca274f
2021-03-08 12:42:32 +00:00
Lukacs T. Berki
b89005d459 Make debugging easier: am: 122b3ee153 am: 5506289b6d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1610784

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I70ed3c028d4408a9c9baf6bfed38d3cdc1e0a02f
2021-03-08 12:18:06 +00:00
Lukacs T. Berki
5506289b6d Make debugging easier: am: 122b3ee153
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1610784

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id1b7db6dd699fac097a193a96f46e3d8110d2fb1
2021-03-08 11:56:32 +00:00
Lukacs T. Berki
023d45784b cd / before generating build.ninja . am: f802ffcd12 am: e4b39574a3 am: 5278a2b5bb
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1592052

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6682e2ad1c44cd38e600a07d414873ad3f78b49e
2021-03-04 09:41:49 +00:00
Lukacs T. Berki
5278a2b5bb cd / before generating build.ninja . am: f802ffcd12 am: e4b39574a3
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1592052

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5bf49d69fe2dc2ac9f80a58d5b223d9e421c8c0c
2021-03-04 08:37:36 +00:00
Lukacs T. Berki
e4b39574a3 cd / before generating build.ninja . am: f802ffcd12
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1592052

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3b17e9de0999fc055d1adfe76b529ce70a649299
2021-03-04 07:58:46 +00:00
Lukacs T. Berki
122b3ee153 Make debugging easier:
- Add the -N -l command line arguments to Microfactory
- Pass the the Delve arguments to the primary builder on the command line

Test: Manual.

Change-Id: I4034f2d48b3e40d9863529053715183dc3dce1f5
2021-03-03 09:15:04 +01:00
Lukacs T. Berki
f802ffcd12 cd / before generating build.ninja .
This is so that soong_build doesn't know the current directory, thereby
avoiding one way to leak information.

Test: Manual.
Change-Id: I976a8663b11d99c5382726487102df10043c5a61
2021-03-03 09:14:22 +01:00
Treehugger Robot
d708933aba Merge "propertyIndexesWithTag can handle slice of struct" am: 2910183696 am: 8d9d43c46c am: 4d11943146
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1601875

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5b7ad3a3b308708063af5ed10269730cd9d4a7af
2021-02-24 02:21:19 +00:00
Colin Cross
e36b5066e6 Add preupload hooks to build/blueprint am: 747b95206b am: 764d29e796 am: 5c9f69df0b
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1602333

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7c1683dc1be5a101cba818c9669b79e6419f961f
2021-02-24 02:21:08 +00:00
Treehugger Robot
4d11943146 Merge "propertyIndexesWithTag can handle slice of struct" am: 2910183696 am: 8d9d43c46c
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1601875

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibd6f37ba8edff1eb89469699a65f1790d1fc354d
2021-02-24 01:49:33 +00:00
Colin Cross
5c9f69df0b Add preupload hooks to build/blueprint am: 747b95206b am: 764d29e796
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1602333

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3613c0603c8293117f67e6e008cee2000f8d7bdd
2021-02-24 01:45:31 +00:00
Treehugger Robot
8d9d43c46c Merge "propertyIndexesWithTag can handle slice of struct" am: 2910183696
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1601875

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4908415cc4eb454030c0224fb990be6c2b89b443
2021-02-24 01:34:38 +00:00
Colin Cross
764d29e796 Add preupload hooks to build/blueprint am: 747b95206b
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1602333

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id329902522927d6fa678b17b10753a6f948523c4
2021-02-24 01:17:47 +00:00
Treehugger Robot
2910183696 Merge "propertyIndexesWithTag can handle slice of struct" 2021-02-24 00:54:56 +00:00
Colin Cross
747b95206b Add preupload hooks to build/blueprint
Run gofmt and bpfmt during preupload, and warn about uses of
DO NOT MERGE.

Test: repo upload
Change-Id: I5f8a318f9ec1dbca897d25f25107df36d160e1f6
2021-02-23 10:29:46 -08:00
Jiyong Park
b48d4aea85 propertyIndexesWithTag can handle slice of struct
The function now can traverse into a field whose type is slice of
struct. When reading field values from the returned indexes, Soong will
check if the next field is a slice of struct or not. If so, it will
recurse into all the values in the slice.

Bug: 181018147
Test: m nothing
Change-Id: Ib8a7b7911a0be37a6dc03079adeb906497e60875
2021-02-24 01:02:59 +09:00
Xin Li
f65a030188 [automerger skipped] Mark ab/7061308 as merged in stage. am: f4c3ff67ba -s ours am: 808f3f87a5 -s ours
am skip reason: Change-Id If8f454d33ec6def0f7f13ab4866be05ed73cf0a7 with SHA-1 819320dabc is in history

Original change: undetermined

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I84cf6e674c31b72c39827a827dcf32773a09c2c0
2021-02-20 09:54:33 +00:00
Xin Li
808f3f87a5 [automerger skipped] Mark ab/7061308 as merged in stage. am: f4c3ff67ba -s ours
am skip reason: Change-Id If8f454d33ec6def0f7f13ab4866be05ed73cf0a7 with SHA-1 819320dabc is in history

Original change: undetermined

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7b58b381e2c12f537e588ad77398519ca0c06b63
2021-02-20 09:15:28 +00:00
Xin Li
f4c3ff67ba Mark ab/7061308 as merged in stage.
Bug: 180401296
Merged-In: If8f454d33ec6def0f7f13ab4866be05ed73cf0a7
Change-Id: I1e39637f944839c99cb6fa41fc8e914ad3455368
2021-02-20 00:24:00 -08:00
Treehugger Robot
30143e47f1 Merge "Make bpfmt use exit codes even when reading from stdin." am: 0335565677 am: e3abb5ce41 am: 1131633ceb
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1592922

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieca90ac22d748f429ae51baef097b81135dfa0ea
2021-02-19 00:16:36 +00:00
Treehugger Robot
1131633ceb Merge "Make bpfmt use exit codes even when reading from stdin." am: 0335565677 am: e3abb5ce41
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1592922

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id2d2d069e7c9c0280d45afc3e6205a74006bcd02
2021-02-18 23:34:40 +00:00
Treehugger Robot
e3abb5ce41 Merge "Make bpfmt use exit codes even when reading from stdin." am: 0335565677
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1592922

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifa0a2163ba8ffb6cc4cdd6610f24c00795079cd6
2021-02-18 23:11:12 +00:00
Treehugger Robot
0335565677 Merge "Make bpfmt use exit codes even when reading from stdin." 2021-02-18 22:10:22 +00:00
Hunter Knepshield
9033c957b9 Make bpfmt use exit codes even when reading from stdin.
Previously, an incantation like `bpfmt -o <$BAD_BP` would print to
stderr as expected, but then it would exit with 0. This is different
than the behavior of `bpfmt -o $BAD_BP`, which correctly exits with a
non-zero status code (in addition to printing the issues to stderr).

Test: m bpfmt; out/soong/host/linux-x86/bin/bpfmt -o <$BAD_BP; echo $?
Change-Id: I0a970cddf94fbd818525f9167d9113086b023c81
2021-02-17 20:24:50 -08:00
Thiébaud Weksteen
d6d8b94f0c Fix ReplaceExtension am: 8ec690764e am: 9d5b6043b5 am: c4f5f2ae7c
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1591572

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iefcf24ed5f3e462dd88a367ee6e51887dda7b5ff
2021-02-17 08:52:46 +00:00
Thiébaud Weksteen
c4f5f2ae7c Fix ReplaceExtension am: 8ec690764e am: 9d5b6043b5
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1591572

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia8faa3c1c85777e9157cd36b61e39e272a462111
2021-02-17 08:18:22 +00:00
Thiébaud Weksteen
9d5b6043b5 Fix ReplaceExtension am: 8ec690764e
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1591572

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I915906293c6e245bd433460b0babfa0fe777b2ea
2021-02-17 08:00:50 +00:00
Thiébaud Weksteen
8ec690764e Fix ReplaceExtension
ReplaceExtension had an unexpected behaviour when the file did not have
an extension. In certain cases, the final path would be severely
trimmed: out/.intermediates/my_file would become out/.new_extension.
Explicitly handle the case by appending the new extension.

Test: Run checkbuild on Android Soong
Change-Id: Ie27a98845894cfaee5af5e2a02d44168c40ed821

This is an imported pull request from
https://github.com/google/blueprint/pull/345

GitOrigin-RevId: f9166c0e6151499b4b1a23b89b0bc133203a1116
Change-Id: I63f0798177545792440b8a84b04f1090590f1642
2021-02-16 21:45:01 -08:00
Colin Cross
a0bd64046e Merge remote-tracking branch 'aosp/upstream' am: e980b25b95 am: 8cb0bda1b1 am: 0381bdcc1d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1580817

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4aee599352d38243bbdbb20cfeda7f925df5a936
2021-02-09 23:44:27 +00:00
Colin Cross
0381bdcc1d Merge remote-tracking branch 'aosp/upstream' am: e980b25b95 am: 8cb0bda1b1
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1580817

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6de36ceac8a7044b0cd360183c9864505d1d3f54
2021-02-09 22:49:18 +00:00