compile: Add debug message if optimized entrypoint is discarded (#4030)

Previously, `opa build -O=1` would silently discard the support
module for the entrypoint if the entrypoint could not be PE-ed. This
could be somewhat confusing if users expect an optimized/ directory to
show up in the bundle. This change just adds a debug message to the
compiler so that we can see when this happens.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
This commit is contained in:
Torin Sandall
2021-11-17 23:22:34 -08:00
committed by GitHub
parent 639adf8737
commit a1358d9a0f
+1
View File
@@ -778,6 +778,7 @@ func (o *optimizer) getSupportForEntrypoint(queries []ast.Body, e *ast.Term, res
return stop
})
if stop {
o.debug.Printf("optimizer: entrypoint: %v: discard due to self-reference", e)
return nil
}
module.Rules = append(module.Rules, &ast.Rule{