Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit ac01f20

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Pass eden client to parser factory
Summary: Just a lot of dumb code propagating eden client from main where it is created to `BUCK` file parsing. Reviewed By: xavierd fbshipit-source-id: 04c9f00375780b475b55cba8309b820f758e3a90
1 parent a0d0917 commit ac01f20

29 files changed

Lines changed: 113 additions & 29 deletions

src/com/facebook/buck/cli/AuditDependenciesCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public ExitCode runWithoutHelp(CommandRunnerParams params) throws Exception {
117117
params.getCells().getRootCell().getBuckConfig(),
118118
params.getExecutableFinder()),
119119
params.getWatchman(),
120+
params.getEdenClient(),
120121
params.getBuckEventBus(),
121122
params.getUnconfiguredBuildTargetFactory(),
122123
params.getHostConfiguration().orElse(UnconfiguredTargetConfiguration.INSTANCE))

src/com/facebook/buck/cli/AuditIncludesCommand.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ public ExitCode runWithoutHelp(CommandRunnerParams params) throws Exception {
6969
params.getCells().getRootCell().getBuckConfig(), params.getExecutableFinder()),
7070
params.getKnownRuleTypesProvider())
7171
.createFileParser(
72-
params.getBuckEventBus(), params.getCells().getRootCell(), params.getWatchman())) {
72+
params.getBuckEventBus(),
73+
params.getCells().getRootCell(),
74+
params.getWatchman(),
75+
params.getEdenClient())) {
7376
PrintStream out = params.getConsole().getStdOut();
7477
for (String pathToBuildFile : getArguments()) {
7578
if (!json) {

src/com/facebook/buck/cli/AuditOwnerCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public ExitCode runWithoutHelp(CommandRunnerParams params) throws Exception {
6868
params.getCells().getRootCell().getBuckConfig(),
6969
params.getExecutableFinder()),
7070
params.getWatchman(),
71+
params.getEdenClient(),
7172
params.getBuckEventBus(),
7273
params.getUnconfiguredBuildTargetFactory(),
7374
params.getHostConfiguration().orElse(UnconfiguredTargetConfiguration.INSTANCE))

src/com/facebook/buck/cli/AuditRulesCommand.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ public ExitCode runWithoutHelp(CommandRunnerParams params) throws Exception {
108108
params.getCells().getRootCell().getBuckConfig(), params.getExecutableFinder()),
109109
params.getKnownRuleTypesProvider())
110110
.createFileParser(
111-
params.getBuckEventBus(), params.getCells().getRootCell(), params.getWatchman())) {
111+
params.getBuckEventBus(),
112+
params.getCells().getRootCell(),
113+
params.getWatchman(),
114+
params.getEdenClient())) {
112115
/*
113116
* The super console does a bunch of rewriting over the top of the console such that
114117
* simultaneously writing to stdout and stderr in an interactive session is problematic.

src/com/facebook/buck/cli/ConfiguredQueryCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ private PerBuildState createPerBuildState(CommandRunnerParams params, CommandThr
195195
new ParserPythonInterpreterProvider(
196196
params.getCells().getRootCell().getBuckConfig(), params.getExecutableFinder()),
197197
params.getWatchman(),
198+
params.getEdenClient(),
198199
params.getBuckEventBus(),
199200
params.getUnconfiguredBuildTargetFactory(),
200201
params.getHostConfiguration().orElse(UnconfiguredTargetConfiguration.INSTANCE));

src/com/facebook/buck/cli/GraphEngineFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ public static GraphTransformationEngine create(
112112

113113
ProjectBuildFileParser buildFileParser =
114114
projectBuildFileParserFactory.createFileParser(
115-
params.getBuckEventBus(), params.getCells().getRootCell(), params.getWatchman());
115+
params.getBuckEventBus(),
116+
params.getCells().getRootCell(),
117+
params.getWatchman(),
118+
params.getEdenClient());
116119

117120
// Once computation is over, we want to close ProjectBuildFileParser to potentially release
118121
// resources

src/com/facebook/buck/cli/MainRunner.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,7 @@ public ExitCode runMainWithExitCode(
14221422
filesystem,
14231423
buckConfig,
14241424
watchman,
1425+
edenClientResourcePool,
14251426
cells,
14261427
buckGlobalState,
14271428
buildEventBus,
@@ -1958,6 +1959,7 @@ private static ParserAndCaches getParserAndCaches(
19581959
ProjectFilesystem filesystem,
19591960
BuckConfig buckConfig,
19601961
Watchman watchman,
1962+
Optional<EdenClientResourcePool> edenClient,
19611963
Cells cells,
19621964
BuckGlobalState buckGlobalState,
19631965
BuckEventBus buildEventBus,
@@ -2022,6 +2024,7 @@ private static ParserAndCaches getParserAndCaches(
20222024
buckGlobalState.getDaemonicParserState(),
20232025
targetSpecResolver,
20242026
watchman,
2027+
edenClient,
20252028
buildEventBus,
20262029
unconfiguredBuildTargetFactory,
20272030
hostConfiguration),

src/com/facebook/buck/cli/QueryCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public ExitCode runWithoutHelp(CommandRunnerParams params) throws Exception {
161161
params.getCells().getRootCell().getBuckConfig(),
162162
params.getExecutableFinder()),
163163
params.getWatchman(),
164+
params.getEdenClient(),
164165
params.getBuckEventBus(),
165166
params.getUnconfiguredBuildTargetFactory(),
166167
params.getHostConfiguration().orElse(UnconfiguredTargetConfiguration.INSTANCE))

src/com/facebook/buck/cli/TargetsCommand.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,7 @@ void printJsonForTargets(
10471047
new ParserPythonInterpreterProvider(
10481048
params.getCells().getRootCell().getBuckConfig(), params.getExecutableFinder()),
10491049
params.getWatchman(),
1050+
params.getEdenClient(),
10501051
params.getBuckEventBus(),
10511052
params.getUnconfiguredBuildTargetFactory(),
10521053
params.getHostConfiguration().orElse(UnconfiguredTargetConfiguration.INSTANCE))
@@ -1493,6 +1494,7 @@ private void computeShowTargetHash(
14931494
new ParserPythonInterpreterProvider(
14941495
params.getCells().getRootCell().getBuckConfig(), params.getExecutableFinder()),
14951496
params.getWatchman(),
1497+
params.getEdenClient(),
14961498
params.getBuckEventBus(),
14971499
params.getUnconfiguredBuildTargetFactory(),
14981500
params.getHostConfiguration().orElse(UnconfiguredTargetConfiguration.INSTANCE))

src/com/facebook/buck/cli/UnconfiguredQueryCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ private PerBuildState createPerBuildState(CommandRunnerParams params, CommandThr
462462
new ParserPythonInterpreterProvider(
463463
params.getCells().getRootCell().getBuckConfig(), params.getExecutableFinder()),
464464
params.getWatchman(),
465+
params.getEdenClient(),
465466
params.getBuckEventBus(),
466467
params.getUnconfiguredBuildTargetFactory(),
467468
params.getHostConfiguration().orElse(UnconfiguredTargetConfiguration.INSTANCE));

0 commit comments

Comments
 (0)