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

Master not building on windows bridge_windows.go #22

Closed
gajanak opened this issue Sep 2, 2020 · 2 comments · Fixed by #24
Closed

Master not building on windows bridge_windows.go #22

gajanak opened this issue Sep 2, 2020 · 2 comments · Fixed by #24

Comments

@gajanak
Copy link

gajanak commented Sep 2, 2020

errormessage:
varlinkbridge_windows.go:47:9: cannot use PipeCon literal (type PipeCon) as type *ctxio.Conn in assignment
varlink\bridge_windows.go:49:3: c.Reader undefined (type Connection has no field or method Reader)
varlink\go@v0.3.0\varlink\bridge_windows.go:50:3: c.Writer undefined (type Connection has no field or method Writer)

i changed it the same code in bridge.c

Adding import
"github.com/varlink/go/varlink/internal/ctxio"
change line 48-1:
c.conn = ctxio.NewConn(PipeCon{nil, cmd, &r, &w})
remove lines:
//c.Reader = bufio.NewReader(r)
//c.Writer = bufio.NewWriter(w)

Is this correct ?

diff --git "a/varlink/bridge_windows.go" "b/varlink/bridge_windows.go"
index 42953b8..26ec6b2 100644
--- "a/varlink/bridge_windows.go"
+++ "b/varlink/bridge_windows.go"
@@ -1,11 +1,12 @@
 package varlink
 
 import (
-	"bufio"
 	"io"
 	"net"
 	"os"
 	"os/exec"
+
+	"github.com/varlink/go/varlink/internal/ctxio" 
 )
 
 type PipeCon struct {
@@ -44,10 +45,8 @@ func NewBridgeWithStderr(bridge string, stderr io.Writer) (*Connection, error) {
 	if err != nil {
 		return nil, err
 	}
-	c.conn = PipeCon{nil, cmd, &r, &w}
+	c.conn = ctxio.NewConn(PipeCon{nil, cmd, &r, &w})
 	c.address = ""
-	c.Reader = bufio.NewReader(r)
-	c.Writer = bufio.NewWriter(w)
 
 	err = cmd.Start()
 	if err != nil { 
haraldh added a commit that referenced this issue Sep 2, 2020
@haraldh
Copy link
Contributor

haraldh commented Sep 2, 2020

Thanks for reporting. The only difference should basically be the NewBridgeWithStderrI() function. I split that function off in PR #24

haraldh added a commit that referenced this issue Sep 2, 2020
@haraldh
Copy link
Contributor

haraldh commented Sep 2, 2020

https://github.com/varlink/go/releases/tag/v0.4.0

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 a pull request may close this issue.

2 participants