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

[QUESTION]: Patch to fix for Windows compile here #8884

Open
lonnietc opened this issue Jun 23, 2023 · 1 comment
Open

[QUESTION]: Patch to fix for Windows compile here #8884

lonnietc opened this issue Jun 23, 2023 · 1 comment
Labels
kind/question Something requiring a response.

Comments

@lonnietc
Copy link

Question.

Hello,

Although I understand that Dgraph is no long supporting Windows, I was able to make a couple of small changes and use "go version go1.19.3 windows/amd64" to enable it to easily compile on my Windows 10 machine.

Here is a small patch for current Repo (6/23/2023) for the "dgraph/x/x.go file to make it work.

--- x-20230623.go       2023-06-23 13:21:54.470012708 -0400
+++ x-20230623-g.go     2023-06-23 13:29:46.838153418 -0400
@@ -38,7 +38,6 @@
        "strings"
        "sync"
        "sync/atomic"
-       "syscall"
        "time"

        "github.com/dustin/go-humanize"
@@ -1116,7 +1115,7 @@
        AssertTrue(pwdType == "Current" || pwdType == "New")
        // ask for the user's password
        fmt.Printf("%s password for %v:", pwdType, userid)
-       pd, err := term.ReadPassword(syscall.Stdin)
+       pd, err := term.ReadPassword(int(os.Stdin.Fd()))
        if err != nil {
                return "", errors.Wrapf(err, "while reading password")
        }
@@ -1125,7 +1124,7 @@

        if times == 2 {
                fmt.Printf("Retype %s password for %v:", strings.ToLower(pwdType), userid)
-               pd2, err := term.ReadPassword(syscall.Stdin)
+               pd2, err := term.ReadPassword(int(os.Stdin.Fd()))
                if err != nil {
                        return "", errors.Wrapf(err, "while reading password")
                }

patch-01.txt

@lonnietc lonnietc added the kind/question Something requiring a response. label Jun 23, 2023
@mangalaman93
Copy link
Contributor

Could you raise a PR? I wouldn't be against merging it if the CI is happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Something requiring a response.
Development

No branches or pull requests

2 participants