Pass rsp files into sbox and rewrapper
The current implementation causes inputs listed in an rsp file used with sbox to be duplicated 3 times in the build.ninja file; once as a dependency of the rule, once in the rspfile_content field of the rule with the paths rewritten to be relative to the sandbox, and once in the rule to write the sbox manifest. When RBE is enabled it also gets a fourth copy in the list of files to be treated as inputs by rewrapper. Reduce this to a single copy by using "$in" for the rspfile_content so that the files only have to be listed in the input dependencies of the rule, and then add support to sbox to rewrite the rsp file while copying it into the sandbox, and pass it to rewrapper as well. Test: m lint-check Change-Id: I3f46f61119508d39a8bb231c99fc130153fb6f04
This commit is contained in:
@@ -376,8 +376,6 @@ func TestRuleBuilder(t *testing.T) {
|
||||
wantDepMergerCommand := "out_local/host/" + ctx.Config().PrebuiltOS() + "/bin/dep_fixer " +
|
||||
"out_local/module/DepFile out_local/module/depfile out_local/module/ImplicitDepFile out_local/module/depfile2"
|
||||
|
||||
wantRspFileContent := "$in"
|
||||
|
||||
AssertDeepEquals(t, "rule.Commands()", wantCommands, rule.Commands())
|
||||
|
||||
AssertDeepEquals(t, "rule.Inputs()", wantInputs, rule.Inputs())
|
||||
@@ -389,8 +387,6 @@ func TestRuleBuilder(t *testing.T) {
|
||||
AssertDeepEquals(t, "rule.OrderOnlys()", wantOrderOnlys, rule.OrderOnlys())
|
||||
|
||||
AssertSame(t, "rule.depFileMergerCmd()", wantDepMergerCommand, rule.depFileMergerCmd(rule.DepFiles()).String())
|
||||
|
||||
AssertSame(t, "rule.composeRspFileContent()", wantRspFileContent, rule.composeRspFileContent(rule.RspFileInputs()))
|
||||
})
|
||||
|
||||
t.Run("sbox", func(t *testing.T) {
|
||||
@@ -409,8 +405,6 @@ func TestRuleBuilder(t *testing.T) {
|
||||
|
||||
wantDepMergerCommand := "out_local/host/" + ctx.Config().PrebuiltOS() + "/bin/dep_fixer __SBOX_SANDBOX_DIR__/out/DepFile __SBOX_SANDBOX_DIR__/out/depfile __SBOX_SANDBOX_DIR__/out/ImplicitDepFile __SBOX_SANDBOX_DIR__/out/depfile2"
|
||||
|
||||
wantRspFileContent := "$in"
|
||||
|
||||
AssertDeepEquals(t, "rule.Commands()", wantCommands, rule.Commands())
|
||||
|
||||
AssertDeepEquals(t, "rule.Inputs()", wantInputs, rule.Inputs())
|
||||
@@ -422,8 +416,6 @@ func TestRuleBuilder(t *testing.T) {
|
||||
AssertDeepEquals(t, "rule.OrderOnlys()", wantOrderOnlys, rule.OrderOnlys())
|
||||
|
||||
AssertSame(t, "rule.depFileMergerCmd()", wantDepMergerCommand, rule.depFileMergerCmd(rule.DepFiles()).String())
|
||||
|
||||
AssertSame(t, "rule.composeRspFileContent()", wantRspFileContent, rule.composeRspFileContent(rule.RspFileInputs()))
|
||||
})
|
||||
|
||||
t.Run("sbox tools", func(t *testing.T) {
|
||||
@@ -442,8 +434,6 @@ func TestRuleBuilder(t *testing.T) {
|
||||
|
||||
wantDepMergerCommand := "__SBOX_SANDBOX_DIR__/tools/out/bin/dep_fixer __SBOX_SANDBOX_DIR__/out/DepFile __SBOX_SANDBOX_DIR__/out/depfile __SBOX_SANDBOX_DIR__/out/ImplicitDepFile __SBOX_SANDBOX_DIR__/out/depfile2"
|
||||
|
||||
wantRspFileContent := "$in"
|
||||
|
||||
AssertDeepEquals(t, "rule.Commands()", wantCommands, rule.Commands())
|
||||
|
||||
AssertDeepEquals(t, "rule.Inputs()", wantInputs, rule.Inputs())
|
||||
@@ -455,8 +445,6 @@ func TestRuleBuilder(t *testing.T) {
|
||||
AssertDeepEquals(t, "rule.OrderOnlys()", wantOrderOnlys, rule.OrderOnlys())
|
||||
|
||||
AssertSame(t, "rule.depFileMergerCmd()", wantDepMergerCommand, rule.depFileMergerCmd(rule.DepFiles()).String())
|
||||
|
||||
AssertSame(t, "rule.composeRspFileContent()", wantRspFileContent, rule.composeRspFileContent(rule.RspFileInputs()))
|
||||
})
|
||||
|
||||
t.Run("sbox inputs", func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user