Commit graph

1861 commits

Author SHA1 Message Date
Paul Duffin
21d2987201 Always shard structs if they would exceed maxNameSize even if unfiltered am: 2aa510c27b am: fc2278d1b1
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1652285

Change-Id: Id54ea354cfffe2274ab02c2ad7d9e51cf64bce5d
2021-03-26 18:15:22 +00:00
Paul Duffin
fc2278d1b1 Always shard structs if they would exceed maxNameSize even if unfiltered am: 2aa510c27b
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1652285

Change-Id: I6ea431cede51576f8c19cce2f0151549717ea242
2021-03-26 17:34:52 +00:00
Paul Duffin
2aa510c27b Always shard structs if they would exceed maxNameSize even if unfiltered
Previously, a struct (anonymous or named) whose fields all matched the
predicate would not be sharded and would simply be reused. However,
that could break the maxNameSize limitation which could cause problems
for the caller.

This change makes sure that the supplied struct is only reused if it
does not exceed the maxNameSize, and otherwise is sharded.

Bug: 183777071
Test: m nothing
Change-Id: I8af272ec121077a43333e72b67cfd0e493c83362
2021-03-26 09:59:19 +00:00
Lukacs T. Berki
ea376d6dc5 Add an accessor function for the output Ninja file. am: a9ec69433d am: 584023ba01 am: 185ed79853
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1651769

Change-Id: I15228789ff0561c8a86cb9afff8634e2e843e774
2021-03-24 17:44:29 +00:00
Lukacs T. Berki
185ed79853 Add an accessor function for the output Ninja file. am: a9ec69433d am: 584023ba01
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1651769

Change-Id: Iad3c2e531c254e9bb33ba4e980494ce65db9d390
2021-03-24 17:01:49 +00:00
Lukacs T. Berki
584023ba01 Add an accessor function for the output Ninja file. am: a9ec69433d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1651769

Change-Id: I5795be5d93ee2fee4a2415390a8069683180825e
2021-03-24 16:24:48 +00:00
Lukacs T. Berki
a9ec69433d Add an accessor function for the output Ninja file.
Test: Presubmits.
Change-Id: I505dfbbf7f87c6ea6bce71f7ae4ef8ca750d066d
2021-03-24 10:57:13 +01:00
Lukacs T. Berki
40a7d4f9d2 Add comment about what -N -l does. am: a4c074bc25 am: b442d3ffe4 am: 5534213d13
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1644906

Change-Id: Ib94fdaafa6007ea44808df7b33f5c5c4278ecd00
2021-03-18 15:18:25 +00:00
Lukacs T. Berki
01899e4baf Add a flag to compile Go code for debugging. am: 07a91f072c am: 261a3ccff1 am: 291f774049
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1642084

Change-Id: Idb70eb907d188686d999c8c7b30b68e1f3391a6b
2021-03-18 15:18:07 +00:00
Lukacs T. Berki
5534213d13 Add comment about what -N -l does. am: a4c074bc25 am: b442d3ffe4
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1644906

Change-Id: If8af8871ffbd01a806c43e442a1a7ef015e8a6ad
2021-03-18 10:14:30 +00:00
Lukacs T. Berki
b442d3ffe4 Add comment about what -N -l does. am: a4c074bc25
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1644906

Change-Id: Iae89ded69b550829d0221976c2bf548cd080e588
2021-03-18 09:34:48 +00:00
Lukacs T. Berki
291f774049 Add a flag to compile Go code for debugging. am: 07a91f072c am: 261a3ccff1
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1642084

Change-Id: Ifef2aee892d396f7aef253998cdc822467771cd7
2021-03-18 09:14:41 +00:00
Lukacs T. Berki
261a3ccff1 Add a flag to compile Go code for debugging. am: 07a91f072c
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1642084

Change-Id: Ibc7e3fe6d4ff58b2e7561602c5cc2656e36e816b
2021-03-18 09:13:43 +00:00
Lukacs T. Berki
a4c074bc25 Add comment about what -N -l does.
This was added in aosp/1642084 and I forgot to address a comment.

Test: "m nothing".
Change-Id: I0fd2f2e8eeaa5b316cf19c3b426f708f2587e60f
2021-03-18 10:03:39 +01:00
Lukacs T. Berki
df89780a4a Remove the GeneratingPrimaryBuilder() method. am: b3b9cb6ccc am: 1c633d832c am: 48fef448b3
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1639860

Change-Id: I2daf9cf4e00dc61db2899e5058cd45d7611547ba
2021-03-17 22:17:07 +00:00
Lukacs T. Berki
99923304b4 Make it possible to call Blueprint from Go. am: 7ea1c168fe am: 29feab2a42 am: a8c6430064
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1639859

Change-Id: I26e3ff67176feb2a6ac9a3f0b851ebe3eadce0dd
2021-03-17 22:16:57 +00:00
Lukacs T. Berki
fd581a58e5 Remove global variables from Blueprint. am: 5353744f1d am: 6530d9dbd6 am: a5b86cc234
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1633339

Change-Id: Id2bc596c8c6f776e2e727e63709ba4129e4230ce
2021-03-17 22:16:38 +00:00
Lukacs T. Berki
48fef448b3 Remove the GeneratingPrimaryBuilder() method. am: b3b9cb6ccc am: 1c633d832c
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1639860

Change-Id: Ic0c3b5db863f97dadba5f4ed6ac5f7a3a331f637
2021-03-17 14:14:41 +00:00
Lukacs T. Berki
a8c6430064 Make it possible to call Blueprint from Go. am: 7ea1c168fe am: 29feab2a42
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1639859

Change-Id: I628c7b53c11f89df9361440f5af608b863b23492
2021-03-17 14:14:32 +00:00
Lukacs T. Berki
07a91f072c Add a flag to compile Go code for debugging.
This makes it possible to debug the primary builder without manually
adding the respective flags to the compilation command lines.

Test: "m nothing", "m nothing" with debugging, then "m nothing" again
Change-Id: I7d403af48528a94e5e0033d9a5c1fa9981100cfd
2021-03-17 15:01:51 +01:00
Lukacs T. Berki
1c633d832c Remove the GeneratingPrimaryBuilder() method. am: b3b9cb6ccc
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1639860

Change-Id: Ie3198a5e0afe2b4c0c9f924680eae557a85c8dae
2021-03-17 13:33:12 +00:00
Lukacs T. Berki
29feab2a42 Make it possible to call Blueprint from Go. am: 7ea1c168fe
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1639859

Change-Id: Ie9758e46e6c38814da3e98e81566b6bb28276a36
2021-03-17 13:32:25 +00:00
Lukacs T. Berki
b3b9cb6ccc Remove the GeneratingPrimaryBuilder() method.
It's replaced with a flag in bootstrap.Args. It's a little bit ugly that
bootstrap.Main also gained a new Boolean flag in the process. The plan
is to delete that method in favor of directly calling RunBlueprint().

Test: "m nothing" (presubmits take a full workday these days)
Change-Id: Iae3421ae517a90570259b6278f18c3614bb1bb73
2021-03-17 14:08:47 +01:00
Lukacs T. Berki
a5b86cc234 Remove global variables from Blueprint. am: 5353744f1d am: 6530d9dbd6
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1633339

Change-Id: I1016e3c1ca67722164749cb1bb4170fbf610c6f6
2021-03-17 08:14:29 +00:00
Lukacs T. Berki
6530d9dbd6 Remove global variables from Blueprint. am: 5353744f1d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1633339

Change-Id: I5c2438e1282fa9fec1e64798e9483f6e7af24923
2021-03-17 07:38:29 +00:00
Lukacs T. Berki
7ea1c168fe Make it possible to call Blueprint from Go.
In addition to the command line interface, a new struct is created that
holds all the information Blueprint needs to do its job.

Test: Presubmits.
Change-Id: I0d6c924e09e069b3c1ae2000722efb52fd561e79
2021-03-17 08:33:21 +01:00
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