Skip to content

Commit

Permalink
Use new IPC protocol by default (except for mini-elp)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
VLanvin authored and facebook-github-bot committed Nov 24, 2023
1 parent a93581e commit ab28269
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions eqwalizer/src/main/scala/com/whatsapp/eqwalizer/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 } {
Expand All @@ -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)) {
Expand Down

0 comments on commit ab28269

Please sign in to comment.