-
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
compile/compile: Fix panic from CLI + metadata entrypoint overlaps. #6667
compile/compile: Fix panic from CLI + metadata entrypoint overlaps. #6667
Conversation
@@ -978,9 +978,7 @@ update { | |||
|
|||
func modulesToString(modules []bundle.ModuleFile) string { | |||
var buf bytes.Buffer | |||
//result := make([]string, len(modules)) |
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.
This appears to be an unfinished cleanup from a few months back, so I took the liberty of completing the job. 😅
Ah nuts, so deduplicating the entrypoint refs brought about a new issue: the order of the refs can be changed by the particular way I was deduplicating things with a |
a6ec082
to
6860f61
Compare
Added @dxh9845 as a co-author on the PR commit, since he did the majority of the heavy-lifting to narrow down the bug site. The actual fix was pretty easy once I had a good repro case to work with. |
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, thanks
Thanks for the fix! |
6860f61
to
82005bf
Compare
This commit fixes a panic that could occur when `opa build` was provided an entrypoint from both a CLI flag, and via entrypoint metadata annotation. The fix is simple: deduplicate the slice of entrypoint refs that the compiler uses, before compiling WASM or Plan targets. Fixes: open-policy-agent#6661 Co-authored-by: Daniel Herzig <danielherzig96@gmail.com> Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
82005bf
to
c9763bd
Compare
There were some more silly test failures, which led me to do some refactoring + a rebase or two was needed to catch up with the state of OPA's |
First time I've seen a GH Actions runner fail this way: I believe it's a spurious failure, and will re-run the failing actions once the other CI checks complete. |
@philipaconrad it's been failing that way in a lot of builds recently :( I think someone is about to look into it. Just retry the job in the meantime. |
...And we're good! 😄 |
We have #6650 to track the CI updates. We need to look into that. |
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
This PR fixes a panic that could occur when
opa build
was provided an entrypoint from both a CLI flag, and via entrypoint metadata annotation.The fix is simple: deduplicate the slice of entrypoint refs that the compiler uses, before compiling WASM or Plan targets.
Fixes: #6661
Thanks to @dxh9845 for reporting this one, and for putting together the initial repro test case!