mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user