File tree Expand file tree Collapse file tree 11 files changed +35
-3
lines changed
buck2_execute_impl/src/executors Expand file tree Collapse file tree 11 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ fn main() -> io::Result<()> {
20
20
"." . to_owned( ) ,
21
21
"../buck2_data" . to_owned( ) ,
22
22
"../buck2_subscription_proto" . to_owned( ) ,
23
+ "../buck2_host_sharing_proto" . to_owned( ) ,
23
24
]
24
25
} ;
25
26
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ version = "0.1.0"
7
7
8
8
[dependencies ]
9
9
allocative = { workspace = true }
10
+ buck2_host_sharing_proto = { workspace = true }
10
11
derive_more = { workspace = true }
11
12
hex = { workspace = true }
12
13
prost = { workspace = true }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ fn main() -> io::Result<()> {
16
16
let includes = if let Ok ( path) = env:: var ( "BUCK_PROTO_SRCS" ) {
17
17
vec ! [ path]
18
18
} else {
19
- vec ! [ "." . to_owned( ) ]
19
+ vec ! [ "." . to_owned( ) , "../buck2_host_sharing_proto" . to_owned ( ) ]
20
20
} ;
21
21
22
22
buck2_protoc_dev:: configure ( )
@@ -266,5 +266,6 @@ fn main() -> io::Result<()> {
266
266
. boxed ( "SpanEndEvent.data.action_execution" )
267
267
. boxed ( "SpanEndEvent.data.cache_upload" )
268
268
. boxed ( "InstantEvent.data.snapshot" )
269
+ . extern_path ( ".buck.host_sharing" , "::buck2_host_sharing_proto" )
269
270
. compile ( proto_files, & includes)
270
271
}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import "google/protobuf/duration.proto";
13
13
import "google/protobuf/timestamp.proto" ;
14
14
import "google/protobuf/empty.proto" ;
15
15
import "error.proto" ;
16
+ import "host_sharing.proto" ;
16
17
17
18
package buck.data ;
18
19
@@ -1800,6 +1801,8 @@ message TestDiscoveryEnd {
1800
1801
string suite_name = 1 ;
1801
1802
CommandExecution command_report = 2 ;
1802
1803
bool re_cache_enabled = 3 ;
1804
+ optional buck.host_sharing.HostSharingRequirements
1805
+ command_host_sharing_requirements = 4;
1803
1806
}
1804
1807
1805
1808
message TestRunStart {
@@ -1809,6 +1812,8 @@ message TestRunStart {
1809
1812
message TestRunEnd {
1810
1813
TestSuite suite = 1 ;
1811
1814
CommandExecution command_report = 2 ;
1815
+ optional buck.host_sharing.HostSharingRequirements
1816
+ command_host_sharing_requirements = 3;
1812
1817
}
1813
1818
1814
1819
message FileWatcherStart {
Original file line number Diff line number Diff line change @@ -413,6 +413,7 @@ impl LocalExecutor {
413
413
value : v. into_string_lossy ( ) ,
414
414
} )
415
415
. collect ( ) ;
416
+
416
417
let stage = match worker {
417
418
None => buck2_data:: LocalExecute {
418
419
command : Some ( buck2_data:: LocalCommand {
Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ fn main() -> io::Result<()> {
16
16
let includes = if let Ok ( path) = env:: var ( "BUCK_PROTO_SRCS" ) {
17
17
vec ! [ path]
18
18
} else {
19
- vec ! [ "." . to_owned( ) , "../buck2_data" . to_owned( ) ]
19
+ vec ! [
20
+ "." . to_owned( ) ,
21
+ "../buck2_data" . to_owned( ) ,
22
+ "../buck2_host_sharing_proto" . to_owned( ) ,
23
+ ]
20
24
} ;
21
25
22
26
buck2_protoc_dev:: configure ( )
Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ fn main() -> io::Result<()> {
16
16
let includes = if let Ok ( path) = env:: var ( "BUCK_PROTO_SRCS" ) {
17
17
vec ! [ path]
18
18
} else {
19
- vec ! [ "." . to_owned( ) , "../buck2_data" . to_owned( ) ]
19
+ vec ! [
20
+ "." . to_owned( ) ,
21
+ "../buck2_data" . to_owned( ) ,
22
+ "../buck2_host_sharing_proto" . to_owned( ) ,
23
+ ]
20
24
} ;
21
25
22
26
buck2_protoc_dev:: configure ( )
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ rust_protobuf_library(
9
9
proto_srcs = ":host_sharing.proto" ,
10
10
deps = [
11
11
"fbsource//third-party/rust:prost-types" ,
12
+ "fbsource//third-party/rust:serde" ,
12
13
"fbsource//third-party/rust:tonic" ,
14
+ "//buck2/allocative/allocative:allocative" ,
13
15
],
14
16
)
15
17
Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ repository = { workspace = true }
7
7
version = " 0.1.0"
8
8
9
9
[dependencies ]
10
+ allocative = { workspace = true }
10
11
prost = { workspace = true }
11
12
prost-types = { workspace = true }
13
+ serde = { workspace = true }
12
14
tonic = { workspace = true }
13
15
14
16
[build-dependencies ]
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ fn main() -> io::Result<()> {
21
21
22
22
buck2_protoc_dev:: configure ( )
23
23
. setup_protoc ( )
24
+ . type_attribute ( "." , "#[derive(::allocative::Allocative)]" )
25
+ . type_attribute ( "." , "#[derive(::serde::Serialize, ::serde::Deserialize)]" )
24
26
. extern_path ( ".buck.data" , "::buck2_data" )
25
27
. compile ( proto_files, & includes)
26
28
}
Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ use futures::channel::mpsc::UnboundedSender;
148
148
use futures:: stream:: FuturesUnordered ;
149
149
use futures:: stream:: StreamExt ;
150
150
use host_sharing:: HostSharingRequirements ;
151
+ use host_sharing:: convert:: host_sharing_requirements_to_grpc;
151
152
use indexmap:: IndexMap ;
152
153
use indexmap:: IndexSet ;
153
154
use indexmap:: indexset;
@@ -1016,6 +1017,10 @@ impl BuckTestOrchestrator<'_> {
1016
1017
. to_command_execution_proto ( true , true , false )
1017
1018
. await ,
1018
1019
) ,
1020
+ command_host_sharing_requirements : host_sharing_requirements_to_grpc (
1021
+ prepared_command. request . host_sharing_requirements ( ) . clone ( ) ,
1022
+ )
1023
+ . ok ( ) ,
1019
1024
re_cache_enabled : * cacheable && re_cache_enabled,
1020
1025
} ;
1021
1026
( ( result, cached) , end)
@@ -1068,6 +1073,10 @@ impl BuckTestOrchestrator<'_> {
1068
1073
. to_command_execution_proto ( true , true , false )
1069
1074
. await ,
1070
1075
) ,
1076
+ command_host_sharing_requirements : host_sharing_requirements_to_grpc (
1077
+ prepared_command. request . host_sharing_requirements ( ) . clone ( ) ,
1078
+ )
1079
+ . ok ( ) ,
1071
1080
} ;
1072
1081
( result, end)
1073
1082
} )
You can’t perform that action at this time.
0 commit comments