Skip to content
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

Only use async pre-empt hack if go < 1.15 #12718

Merged
merged 2 commits into from
Sep 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/git/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import (
"io"
"os"
"os/exec"
"runtime"
"strings"
"time"

"code.gitea.io/gitea/modules/process"
"github.com/mcuadros/go-version"
Copy link
Member

Choose a reason for hiding this comment

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

github.com/mcuadros/go-version was archived !!!

we should switch to github.com/hashicorp/go-version

Copy link
Member

Choose a reason for hiding this comment

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

I'll try to create a pr - it shold be a drop in replacement ...

)

var (
Expand Down Expand Up @@ -130,7 +132,9 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.
}

// TODO: verify if this is still needed in golang 1.15
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO: verify if this is still needed in golang 1.15

Copy link
Contributor Author

Choose a reason for hiding this comment

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

perhaps we should actually verify it first... 😛

cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
if version.Compare(runtime.Version(), "go1.15", "<") {
cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
}
cmd.Dir = dir
cmd.Stdout = stdout
cmd.Stderr = stderr
Expand Down