-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/build+compile: allow opt-out of dependents gathering #5038
cmd/build+compile: allow opt-out of dependents gathering #5038
Conversation
e01d770
to
358eb5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
compile/compile.go
Outdated
// | ||
// Notably this includes functions (they can't be entrypoints) and causes | ||
// the built bundle to no longer be semantically equivalent to the bundle built | ||
// without wasm, or optimizations.} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth mentioning this option is for -t plan just as much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no real equivalence there, I thought... but yeah as it stands, the "optimizations" part is also misleading. I'll update the comment. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
With `.WithPruneUnused(true)`, the compiler (of the compile package) no longer collects dependents of its entrypoints. The resulting bundle, if used with the wasm target, will no longer be semantically equivalent to the bundle built with the rego target. Since we're unable to have entrypoints for functions, this allows building modules that we couldn't build before. See open-policy-agent#5035. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
358eb5e
to
af5de64
Compare
With
.WithPruneUnused(true)
, the compiler (of the compile package) no longercollects dependents of its entrypoints.
The resulting bundle, if used with the wasm target, will no longer be
semantically equivalent to the bundle built with the rego target.
Since we're unable to have entrypoints for functions, this allows building
modules that we couldn't build before.
Fixes #5035.