Skip to content

Commit

Permalink
Load AST from ETF for project apps
Browse files Browse the repository at this point in the history
Summary: Do not load AST from Beam files in case of OTP modules or 3rd party dependencies if the module is also present in a project app.

Reviewed By: ilya-klyuchnikov

Differential Revision: D41265141

fbshipit-source-id: 9e1634cdac0eab4177794caeb9da2399084a3d70
  • Loading branch information
VLanvin authored and facebook-github-bot committed Nov 14, 2022
1 parent 9e3e9a5 commit bfe4ad1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ private object Db {
otpApps.values.flatMap(_.modules).toSet
lazy val projectApps: Map[String, App] =
config.apps.map { case (n, ai) => n -> App(n, ai.ebin, erlModules(ai), hasEqwalizerMarker(ai)) }
lazy val projectModules: Set[String] =
projectApps.values.flatMap(_.modules).toSet
lazy val depApps: Map[String, App] =
config.deps.map { case (n, ai) => n -> App(n, ai.ebin, erlModules(ai), hasEqwalizerMarker = false) }
lazy val depModules: Set[String] =
Expand Down Expand Up @@ -170,7 +172,7 @@ private object Db {
}

def fromBeam(module: String): Boolean =
otpModules(module) || depModules(module) || !config.useElp
((otpModules(module) || depModules(module)) && !projectModules(module)) || !config.useElp

// $COVERAGE-OFF$
private val generatedMark: String = "@" + "generated"
Expand Down

0 comments on commit bfe4ad1

Please sign in to comment.