From ab28269012bcf5607db720f0afe365d020c7e7ba Mon Sep 17 00:00:00 2001 From: Victor Lanvin Date: Fri, 24 Nov 2023 07:41:40 -0800 Subject: [PATCH] Use new IPC protocol by default (except for mini-elp) Summary: A new IPC protocol was introduced for ELP shell, which allows for precise by-module caching of dependencies even when running `eqwalize-all`. The previous protocol was kept around to avoid regressions in IDE and in ELP CLI. After a period of testing, this protocol seems stable enough that the previous one can be deprecated, except for mini-elp. Reviewed By: ilya-klyuchnikov, alanz Differential Revision: D51524775 fbshipit-source-id: 9de5ff1cb4e2e9faf40d634917b8b171df0c4e80 --- eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Main.scala | 6 +++--- .../scala/com/whatsapp/eqwalizer/util/ELPDiagnostics.scala | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Main.scala b/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Main.scala index 03944c1..c503f74 100644 --- a/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Main.scala +++ b/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Main.scala @@ -59,10 +59,10 @@ object Main { } val modules = ipcArgs.tail val modulesAndStorages = modules.distinct.flatMap(m => DbApi.getAstStorage(m).map(m -> _)) - if (config.mode == Mode.Shell) { - ELPDiagnostics.getDiagnosticsIpcShell(modulesAndStorages) - } else { + if (config.useElp()) { ELPDiagnostics.getDiagnosticsIpc(modulesAndStorages) + } else { + ELPDiagnostics.getDiagnosticsIpcMiniElp(modulesAndStorages) } } diff --git a/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/util/ELPDiagnostics.scala b/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/util/ELPDiagnostics.scala index 328e1ff..6635688 100644 --- a/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/util/ELPDiagnostics.scala +++ b/eqwalizer/src/main/scala/com/whatsapp/eqwalizer/util/ELPDiagnostics.scala @@ -28,7 +28,7 @@ object ELPDiagnostics { def getDiagnosticsString(module: String, astStorage: DbApi.AstStorage, options: Options = noOptions): String = toJsonObj(Map(module -> getDiagnostics(module, astStorage, options))).render(indent = 2) - def getDiagnosticsIpc(modulesAndStorages: Iterable[(String, DbApi.AstStorage)]): Unit = + def getDiagnosticsIpcMiniElp(modulesAndStorages: Iterable[(String, DbApi.AstStorage)]): Unit = try { val diagnosticsByModule = mutable.Map.empty[String, List[Error]] for { (module, astStorage) <- modulesAndStorages } { @@ -44,7 +44,7 @@ object ELPDiagnostics { case Ipc.Terminated => () } - def getDiagnosticsIpcShell(modulesAndStorages: Iterable[(String, DbApi.AstStorage)]): Unit = + def getDiagnosticsIpc(modulesAndStorages: Iterable[(String, DbApi.AstStorage)]): Unit = try { for { (module, astStorage) <- modulesAndStorages } { if (Ipc.shouldEqwalize(module)) {