Skip to content

dispatch binary extensions directly#4568

Merged
vilmibm merged 3 commits intotrunkfrom
bin-ext-dispatch
Oct 21, 2021
Merged

dispatch binary extensions directly#4568
vilmibm merged 3 commits intotrunkfrom
bin-ext-dispatch

Conversation

@vilmibm
Copy link
Contributor

@vilmibm vilmibm commented Oct 19, 2021

This PR skips the sh wrapper on all platforms when dispatching a binary extension.

I'm still punting on local installs.

@vilmibm vilmibm requested a review from a team as a code owner October 19, 2021 19:53
@vilmibm vilmibm requested review from mislav and samcoe and removed request for a team October 19, 2021 19:53
Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I left two non-blocking comments. Nice work!

var externalCmd *exec.Cmd

if runtime.GOOS == "windows" {
if ext.IsBinary() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ext.IsBinary() {
if ext.IsBinary() || runtime.GOOS != "windows" {
...
} else {
...
}

Looks like this if statement could be simplified a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol oops

return true
}

func (e *Extension) IsBinary() bool {
Copy link
Contributor

@samcoe samcoe Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one place in extension/manager.go:480 that this same check is taking place, can we replace the check with this function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I actually found another use case for it. If we switch around the if statement at extension/manager.go:271 we can reuse this function, that way we are never directly checking ext.kind outside of this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants