[go] syscall: implement Unix Socket for Windows

285 views
Skip to first unread message

Yasuhiro MATSUMOTO (Gerrit)

unread,
Jul 22, 2018, 12:49:13 PM7/22/18
to Ian Lance Taylor, Rob Pike, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Yasuhiro MATSUMOTO has uploaded this change for review.

View Change

syscall: implement Unix Socket for Windows

Add implementation of AF_UNIX. This works only on Windows 10.

Closes #26072

Change-Id: I76a96a472385a17901885271622fbe55d66bb720
---
M src/syscall/syscall_windows.go
1 file changed, 47 insertions(+), 4 deletions(-)

diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go
index 5cfdb76..c8c868a 100644
--- a/src/syscall/syscall_windows.go
+++ b/src/syscall/syscall_windows.go
@@ -626,7 +626,7 @@

type RawSockaddrAny struct {
Addr RawSockaddr
- Pad [96]int8
+ Pad [100]int8
}

type Sockaddr interface {
@@ -675,19 +675,62 @@
return unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil
}

+type RawSockaddrUnix struct {
+ Family uint16
+ Path [108]int8
+}
+
type SockaddrUnix struct {
Name string
+ raw RawSockaddrUnix
}

func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, int32, error) {
- // TODO(brainman): implement SockaddrUnix.sockaddr()
- return nil, 0, EWINDOWS
+ name := sa.Name
+ n := len(name)
+ if n > len(sa.raw.Path) {
+ return nil, 0, EINVAL
+ }
+ if n == len(sa.raw.Path) && name[0] != '@' {
+ return nil, 0, EINVAL
+ }
+ sa.raw.Family = AF_UNIX
+ for i := 0; i < n; i++ {
+ sa.raw.Path[i] = int8(name[i])
+ }
+ // length is family (uint16), name, NUL.
+ sl := int32(2)
+ if n > 0 {
+ sl += int32(n) + 1
+ }
+ if sa.raw.Path[0] == '@' {
+ sa.raw.Path[0] = 0
+ // Don't count trailing NUL for abstract address.
+ sl--
+ }
+
+ return unsafe.Pointer(&sa.raw), sl, nil
}

func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_UNIX:
- return nil, EWINDOWS
+ pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
+ sa := new(SockaddrUnix)
+ sa.raw.Family = AF_UNIX
+ copy(sa.raw.Path[:], pp.Path[:])
+ if len(pp.Path) > 0 {
+ var b [108]byte
+ var i int
+ for i = 0; i < len(pp.Path); i++ {
+ if pp.Path[i] == 0 {
+ break
+ }
+ b[i] = byte(pp.Path[i])
+ }
+ sa.Name = string(b[:i])
+ }
+ return sa, nil

case AF_INET:
pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))

To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
Gerrit-Change-Number: 125456
Gerrit-PatchSet: 1
Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
Gerrit-MessageType: newchange

Yasuhiro MATSUMOTO (Gerrit)

unread,
Jul 22, 2018, 12:50:41 PM7/22/18
to goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

Please take a look. Current implementation doesn't have tests since AF_UNIX was included in Fall Creators Update of Windows 10.

View Change

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 1
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Comment-Date: Sun, 22 Jul 2018 16:50:36 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Alex Brainman (Gerrit)

    unread,
    Jul 24, 2018, 5:49:29 AM7/24/18
    to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Ian Lance Taylor, golang-co...@googlegroups.com

    Thank you for doing this.

    Alex

    View Change

    5 comments:

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 1
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Comment-Date: Tue, 24 Jul 2018 09:49:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Yasuhiro MATSUMOTO (Gerrit)

    unread,
    Jul 24, 2018, 12:54:10 PM7/24/18
    to Ian Lance Taylor, Alex Brainman, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Yasuhiro MATSUMOTO uploaded patch set #2 to this change.

    View Change

    syscall: implement Unix Socket for Windows

    Add implementation of AF_UNIX. This works only on Windows 10.

    https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/


    Closes #26072

    Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    ---
    A src/net/unixsock_windows_test.go
    M src/syscall/syscall_windows.go
    2 files changed, 147 insertions(+), 4 deletions(-)

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-MessageType: newpatchset

    Yasuhiro MATSUMOTO (Gerrit)

    unread,
    Jul 24, 2018, 12:55:35 PM7/24/18
    to goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

    Thanks your reviewing.

    View Change

    5 comments:

      • Patch Set #1, Line 7: syscall: implement Unix Socket for Windows

        Not without some new tests. How do you expect reviewers to verify that this code actually work? […]

      • I didn't notice how to check whether Fall Creators Update 2018. I noticed way to check this with reading registry.

      • Sorry, I can't explain why this value is required. When I tried with 96, Accept crash with invalid pointer. But bigger size doesn't.
        I attempted to reduce this size little by little. And I figure out that the minimum value that did not crash was 100.

      • This is defined in afunix.h

        #define UNIX_PATH_MAX 108

        typedef struct sockaddr_un
        {
        ADDRESS_FAMILY sun_family; /* AF_UNIX */
        char sun_path[UNIX_PATH_MAX]; /* pathname */
        } SOCKADDR_UN, *PSOCKADDR_UN;
      • Patch Set #1, Line 721: // "Abstract" Unix domain socket.

        I can see that you have copied lines 689-712 from syscall_linux.go / SockaddrUnix.sockaddr function. […]

        I didn't copied from any where since I did not notice it is already implemented in syscall_linux.go. Just had implemented to fill all of fields from pp to sa. Then, I updated code to copy this from syscall_linux.go .

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Comment-Date: Tue, 24 Jul 2018 16:55:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alex Brainman <alex.b...@gmail.com>
    Gerrit-MessageType: comment

    Alex Brainman (Gerrit)

    unread,
    Jul 29, 2018, 2:55:12 AM7/29/18
    to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Ian Lance Taylor, golang-co...@googlegroups.com

    View Change

    4 comments:

      • Sorry, I can't explain why this value is required. […]

        Fair enough. I do not know what this value should be. Perhaps UNIX_PATH_MAX? But we should get it right first time. We do not want to break syscall API twice. Mikio, do you know what this value should be?

      • This is defined in afunix.h […]

        Than add (perhaps put it into types_windows.go)

        const UNIX_PATH_MAX 108 // defined in afunix.h

        and use it everywhere.

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Comment-Date: Sun, 29 Jul 2018 06:55:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Yasuhiro MATSUMOTO <matt...@gmail.com>

    Yasuhiro MATSUMOTO (Gerrit)

    unread,
    Aug 5, 2018, 10:59:29 AM8/5/18
    to Ian Lance Taylor, Alex Brainman, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Yasuhiro MATSUMOTO uploaded patch set #3 to this change.

    View Change

    syscall: implement Unix Socket for Windows

    Add implementation of AF_UNIX. This works only on Windows 10.

    https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

    Fixes #26072


    Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    ---
    A src/net/unixsock_windows_test.go
    M src/syscall/syscall_windows.go
    M src/syscall/types_windows.go
    3 files changed, 149 insertions(+), 4 deletions(-)

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 3
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-MessageType: newpatchset

    Yasuhiro MATSUMOTO (Gerrit)

    unread,
    Aug 5, 2018, 10:59:44 AM8/5/18
    to goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

    View Change

    1 comment:

      • I believe we already have appropriate tests in unixsock_posix.go. […]

        SOCK_DGRAM still not be supported on Windows10.

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 3
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Comment-Date: Sun, 05 Aug 2018 14:59:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Alex Brainman (Gerrit)

    unread,
    Aug 12, 2018, 3:32:56 AM8/12/18
    to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Ian Lance Taylor, golang-co...@googlegroups.com

    Patch set 3:Run-TryBot +1

    View Change

    1 comment:

    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
    Gerrit-Change-Number: 125456
    Gerrit-PatchSet: 3
    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
    Gerrit-Comment-Date: Sun, 12 Aug 2018 07:32:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Gobot Gobot (Gerrit)

    unread,
    Aug 12, 2018, 3:33:06 AM8/12/18
    to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

    TryBots beginning. Status page: https://farmer.golang.org/try?commit=9bf0e208

    View Change

      To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
      Gerrit-Change-Number: 125456
      Gerrit-PatchSet: 3
      Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
      Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
      Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
      Gerrit-CC: Gobot Gobot <go...@golang.org>
      Gerrit-Comment-Date: Sun, 12 Aug 2018 07:33:03 +0000

      Gobot Gobot (Gerrit)

      unread,
      Aug 12, 2018, 3:39:07 AM8/12/18
      to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

      Build is still in progress...
      This change failed on linux-amd64:
      See https://storage.googleapis.com/go-build-log/9bf0e208/linux-amd64_01edff14.log

      Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report.

      View Change

        To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
        Gerrit-Change-Number: 125456
        Gerrit-PatchSet: 3
        Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
        Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
        Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
        Gerrit-CC: Gobot Gobot <go...@golang.org>
        Gerrit-Comment-Date: Sun, 12 Aug 2018 07:39:06 +0000

        Alex Brainman (Gerrit)

        unread,
        Aug 12, 2018, 3:40:44 AM8/12/18
        to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

        Patch Set 3:

        Build is still in progress...
        This change failed on linux-amd64:
        See https://storage.googleapis.com/go-build-log/9bf0e208/linux-amd64_01edff14.log

        Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report.

        ##### API check
        Error running API checker: exit status 1
        +pkg syscall (windows-386), const UNIX_PATH_MAX = 108
        +pkg syscall (windows-386), const UNIX_PATH_MAX ideal-int
        +pkg syscall (windows-386), type RawSockaddrAny struct, Pad [100]int8
        -pkg syscall (windows-386), type RawSockaddrAny struct, Pad [96]int8
        +pkg syscall (windows-386), type RawSockaddrUnix struct, Family uint16
        +pkg syscall (windows-386), type RawSockaddrUnix struct, Path [108]int8
        +pkg syscall (windows-amd64), const UNIX_PATH_MAX = 108
        +pkg syscall (windows-amd64), const UNIX_PATH_MAX ideal-int
        +pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [100]int8
        -pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8
        +pkg syscall (windows-amd64), type RawSockaddrUnix struct, Family uint16
        +pkg syscall (windows-amd64), type RawSockaddrUnix struct, Path [108]int8
        +pkg syscall, type RawSockaddrUnix struct
        exit status 1
        2018/08/12 07:37:19 Failed: exit status 1
        2018/08/12 07:37:19 FAILED

        mattn, you have to adjust API file.

        Alex

        View Change

          To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
          Gerrit-Change-Number: 125456
          Gerrit-PatchSet: 3
          Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
          Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
          Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
          Gerrit-CC: Gobot Gobot <go...@golang.org>
          Gerrit-Comment-Date: Sun, 12 Aug 2018 07:40:40 +0000

          Gobot Gobot (Gerrit)

          unread,
          Aug 12, 2018, 3:42:02 AM8/12/18
          to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

          1 of 19 TryBots failed:
          Failed on linux-amd64: https://storage.googleapis.com/go-build-log/9bf0e208/linux-amd64_01edff14.log

          Consult https://build.golang.org/ to see whether they are new failures.

          Patch set 3:TryBot-Result -1

          View Change

            To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
            Gerrit-Change-Number: 125456
            Gerrit-PatchSet: 3
            Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
            Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
            Gerrit-Comment-Date: Sun, 12 Aug 2018 07:42:00 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            Gerrit-MessageType: comment

            Yasuhiro MATSUMOTO (Gerrit)

            unread,
            Aug 14, 2018, 1:47:46 AM8/14/18
            to Ian Lance Taylor, Gobot Gobot, Alex Brainman, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

            Yasuhiro MATSUMOTO uploaded patch set #4 to this change.

            View Change

            syscall: implement Unix Socket for Windows

            Add implementation of AF_UNIX. This works only on Windows 10.

            https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

            Fixes #26072

            Change-Id: I76a96a472385a17901885271622fbe55d66bb720
            ---
            M api/except.txt

            A src/net/unixsock_windows_test.go
            M src/syscall/syscall_windows.go
            M src/syscall/types_windows.go
            4 files changed, 159 insertions(+), 4 deletions(-)

            To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
            Gerrit-Change-Number: 125456
            Gerrit-PatchSet: 4
            Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
            Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
            Gerrit-MessageType: newpatchset

            Alex Brainman (Gerrit)

            unread,
            Aug 14, 2018, 5:19:23 AM8/14/18
            to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

            Patch set 4:Run-TryBot +1

            View Change

              To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
              Gerrit-Change-Number: 125456
              Gerrit-PatchSet: 4
              Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
              Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
              Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
              Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
              Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
              Gerrit-Comment-Date: Tue, 14 Aug 2018 09:19:17 +0000

              Gobot Gobot (Gerrit)

              unread,
              Aug 14, 2018, 5:20:01 AM8/14/18
              to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

              TryBots beginning. Status page: https://farmer.golang.org/try?commit=6bb392db

              View Change

                To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-Project: go
                Gerrit-Branch: master
                Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                Gerrit-Change-Number: 125456
                Gerrit-PatchSet: 4
                Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                Gerrit-Comment-Date: Tue, 14 Aug 2018 09:19:58 +0000

                Gobot Gobot (Gerrit)

                unread,
                Aug 14, 2018, 5:26:04 AM8/14/18
                to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

                Build is still in progress...
                This change failed on linux-amd64:

                See https://storage.googleapis.com/go-build-log/6bb392db/linux-amd64_ff5842fe.log

                Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report.

                View Change

                  To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                  Gerrit-Change-Number: 125456
                  Gerrit-PatchSet: 4
                  Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                  Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                  Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                  Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                  Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                  Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                  Gerrit-Comment-Date: Tue, 14 Aug 2018 09:26:01 +0000

                  Gobot Gobot (Gerrit)

                  unread,
                  Aug 14, 2018, 5:28:50 AM8/14/18
                  to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

                  1 of 19 TryBots failed:

                  Failed on linux-amd64: https://storage.googleapis.com/go-build-log/6bb392db/linux-amd64_ff5842fe.log

                  Consult https://build.golang.org/ to see whether they are new failures.

                  Patch set 4:TryBot-Result -1

                  View Change

                    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-Project: go
                    Gerrit-Branch: master
                    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                    Gerrit-Change-Number: 125456
                    Gerrit-PatchSet: 4
                    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                    Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                    Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                    Gerrit-Comment-Date: Tue, 14 Aug 2018 09:28:48 +0000

                    Alex Brainman (Gerrit)

                    unread,
                    Aug 14, 2018, 5:35:06 AM8/14/18
                    to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                    Patch Set 4: TryBot-Result-1

                    1 of 19 TryBots failed:
                    Failed on linux-amd64: https://storage.googleapis.com/go-build-log/6bb392db/linux-amd64_ff5842fe.log

                    Consult https://build.golang.org/ to see whether they are new failures.

                    Please, fix the failure.

                    Thank you.

                    Alex

                    View Change

                      To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                      Gerrit-Project: go
                      Gerrit-Branch: master
                      Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                      Gerrit-Change-Number: 125456
                      Gerrit-PatchSet: 4
                      Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                      Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                      Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                      Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                      Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                      Gerrit-Comment-Date: Tue, 14 Aug 2018 09:35:01 +0000

                      Yasuhiro MATSUMOTO (Gerrit)

                      unread,
                      Aug 19, 2018, 11:00:01 PM8/19/18
                      to goph...@pubsubhelper.golang.org, Alex Brainman, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                      Patch Set 4:

                      Patch Set 4: TryBot-Result-1

                      1 of 19 TryBots failed:
                      Failed on linux-amd64: https://storage.googleapis.com/go-build-log/6bb392db/linux-amd64_ff5842fe.log

                      Consult https://build.golang.org/ to see whether they are new failures.

                      Please, fix the failure.

                      Thank you.

                      Alex

                      Sorry, How can I test this on local?

                      View Change

                        To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                        Gerrit-Change-Number: 125456
                        Gerrit-PatchSet: 4
                        Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                        Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                        Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                        Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                        Gerrit-Comment-Date: Mon, 20 Aug 2018 02:59:55 +0000

                        Alex Brainman (Gerrit)

                        unread,
                        Aug 25, 2018, 1:00:41 AM8/25/18
                        to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com


                        Sorry, How can I test this on local?

                        You can run

                        all.bat

                        or

                        make.bat
                        go tool dist test -no-rebuild -run=api

                        Alex

                        View Change

                          To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                          Gerrit-Change-Number: 125456
                          Gerrit-PatchSet: 4
                          Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                          Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                          Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                          Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                          Gerrit-Comment-Date: Sat, 25 Aug 2018 05:00:32 +0000

                          Alex Brainman (Gerrit)

                          unread,
                          Aug 25, 2018, 1:03:04 AM8/25/18
                          to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                          Also, please, rebase to the tip. There would be many new changes that might affect your CL. We do not want trouble when submitting this.

                          Thank you.

                          Alex

                          View Change

                            To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                            Gerrit-Change-Number: 125456
                            Gerrit-PatchSet: 4
                            Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                            Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                            Gerrit-Comment-Date: Sat, 25 Aug 2018 05:02:59 +0000

                            Yasuhiro MATSUMOTO (Gerrit)

                            unread,
                            Aug 27, 2018, 5:28:08 AM8/27/18
                            to Ian Lance Taylor, Gobot Gobot, Alex Brainman, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

                            Yasuhiro MATSUMOTO uploaded patch set #5 to this change.

                            View Change

                            syscall: implement Unix Socket for Windows

                            Add implementation of AF_UNIX. This works only on Windows 10.

                            https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

                            Fixes #26072

                            Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                            ---
                            A src/net/unixsock_windows_test.go
                            M src/syscall/syscall_windows.go
                            M src/syscall/types_windows.go
                            3 files changed, 149 insertions(+), 4 deletions(-)

                            To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                            Gerrit-Change-Number: 125456
                            Gerrit-PatchSet: 5
                            Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                            Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                            Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                            Gerrit-MessageType: newpatchset

                            Yasuhiro MATSUMOTO (Gerrit)

                            unread,
                            Aug 27, 2018, 5:30:17 AM8/27/18
                            to goph...@pubsubhelper.golang.org, Alex Brainman, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                            Patch Set 4:

                            Also, please, rebase to the tip. There would be many new changes that might affect your CL. We do not want trouble when submitting this.

                            Thank you.

                            Alex

                            Thank you. I rebased to the tip. And reverted changes for api on my branch. Sorry, I still have problem. I don't know why there are below's error that don't depend on my CL.

                            ##### Testing packages.
                            ok cmd/api (cached)

                            ##### API check
                            Error running API checker: exit status 1

                            +pkg debug/pe, const IMAGE_FILE_MACHINE_ARMNT = 452
                            +pkg debug/pe, const IMAGE_FILE_MACHINE_ARMNT ideal-int
                            +pkg net/http, method (*Client) CloseIdleConnections()
                            +pkg reflect, method (*MapIter) Key() Value
                            +pkg reflect, method (*MapIter) Next() bool
                            +pkg reflect, method (*MapIter) Value() Value
                            +pkg reflect, method (Value) MapRange() *MapIter
                            +pkg reflect, type MapIter struct
                            +pkg strings, method (*Builder) Cap() int
                            +pkg syscall (freebsd-386), const S_IRWXG = 56
                            +pkg syscall (freebsd-386), const S_IRWXG ideal-int
                            +pkg syscall (freebsd-386), const S_IRWXO = 7
                            +pkg syscall (freebsd-386), const S_IRWXO ideal-int
                            +pkg syscall (freebsd-386-cgo), const S_IRWXG = 56
                            +pkg syscall (freebsd-386-cgo), const S_IRWXG ideal-int
                            +pkg syscall (freebsd-386-cgo), const S_IRWXO = 7
                            +pkg syscall (freebsd-386-cgo), const S_IRWXO ideal-int
                            +pkg syscall (freebsd-amd64), const S_IRWXG = 56
                            +pkg syscall (freebsd-amd64), const S_IRWXG ideal-int
                            +pkg syscall (freebsd-amd64), const S_IRWXO = 7
                            +pkg syscall (freebsd-amd64), const S_IRWXO ideal-int
                            +pkg syscall (freebsd-amd64-cgo), const S_IRWXG = 56
                            +pkg syscall (freebsd-amd64-cgo), const S_IRWXG ideal-int
                            +pkg syscall (freebsd-amd64-cgo), const S_IRWXO = 7
                            +pkg syscall (freebsd-amd64-cgo), const S_IRWXO ideal-int
                            +pkg syscall (freebsd-arm), const S_IRWXG = 56
                            +pkg syscall (freebsd-arm), const S_IRWXG ideal-int
                            +pkg syscall (freebsd-arm), const S_IRWXO = 7
                            +pkg syscall (freebsd-arm), const S_IRWXO ideal-int
                            +pkg syscall (freebsd-arm-cgo), const S_IRWXG = 56
                            +pkg syscall (freebsd-arm-cgo), const S_IRWXG ideal-int
                            +pkg syscall (freebsd-arm-cgo), const S_IRWXO = 7
                            +pkg syscall (freebsd-arm-cgo), const S_IRWXO ideal-int
                            +pkg syscall (openbsd-386), const S_IRWXG = 56
                            +pkg syscall (openbsd-386), const S_IRWXG ideal-int
                            +pkg syscall (openbsd-386), const S_IRWXO = 7
                            +pkg syscall (openbsd-386), const S_IRWXO ideal-int
                            +pkg syscall (openbsd-386-cgo), const S_IRWXG = 56
                            +pkg syscall (openbsd-386-cgo), const S_IRWXG ideal-int
                            +pkg syscall (openbsd-386-cgo), const S_IRWXO = 7
                            +pkg syscall (openbsd-386-cgo), const S_IRWXO ideal-int
                            +pkg syscall (openbsd-amd64), const S_IRWXG = 56
                            +pkg syscall (openbsd-amd64), const S_IRWXG ideal-int
                            +pkg syscall (openbsd-amd64), const S_IRWXO = 7
                            +pkg syscall (openbsd-amd64), const S_IRWXO ideal-int
                            +pkg syscall (openbsd-amd64-cgo), const S_IRWXG = 56
                            +pkg syscall (openbsd-amd64-cgo), const S_IRWXG ideal-int
                            +pkg syscall (openbsd-amd64-cgo), const S_IRWXO = 7
                            +pkg syscall (openbsd-amd64-cgo), const S_IRWXO ideal-int


                            -pkg syscall (windows-386), type RawSockaddrAny struct, Pad [96]int8

                            -pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8

                            exit status 1
                            2018/08/27 18:19:42 Failed: exit status 1
                            2018/08/27 18:19:43 FAILED

                            View Change

                              To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                              Gerrit-Change-Number: 125456
                              Gerrit-PatchSet: 4
                              Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                              Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                              Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                              Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                              Gerrit-Comment-Date: Mon, 27 Aug 2018 09:30:12 +0000

                              Tobias Klauser (Gerrit)

                              unread,
                              Aug 27, 2018, 9:28:00 AM8/27/18
                              to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                              Patch Set 4:

                              You won't need to care about the additions here (whether they come from this CL or others) as the tree is no longer locked down. It should be sufficient to add the changed RawSockaddrAny parts to api/except.txt, i.e.

                                diff --git a/api/except.txt b/api/except.txt
                              index 46dbb458923c..850724196d24 100644
                              --- a/api/except.txt
                              +++ b/api/except.txt
                              @@ -370,6 +370,7 @@ pkg syscall (windows-386), type CertContext struct, CertInfo uintptr
                              pkg syscall (windows-386), type CertRevocationInfo struct, CrlInfo uintptr
                              pkg syscall (windows-386), type CertRevocationInfo struct, OidSpecificInfo uintptr
                              pkg syscall (windows-386), type CertSimpleChain struct, TrustListInfo uintptr
                              +pkg syscall (windows-386), type RawSockaddrAny struct, Pad [96]int8
                              pkg syscall (windows-amd64), const TOKEN_ALL_ACCESS = 983295
                              pkg syscall (windows-amd64), type AddrinfoW struct, Addr uintptr
                              pkg syscall (windows-amd64), type CertChainPolicyPara struct, ExtraPolicyPara uintptr
                              @@ -378,3 +379,4 @@ pkg syscall (windows-amd64), type CertContext struct, CertInfo uintptr
                              pkg syscall (windows-amd64), type CertRevocationInfo struct, CrlInfo uintptr
                              pkg syscall (windows-amd64), type CertRevocationInfo struct, OidSpecificInfo uintptr
                              pkg syscall (windows-amd64), type CertSimpleChain struct, TrustListInfo uintptr
                              +pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8

                              View Change

                                To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                Gerrit-Change-Number: 125456
                                Gerrit-PatchSet: 5
                                Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                Gerrit-CC: Tobias Klauser <tobias....@gmail.com>
                                Gerrit-Comment-Date: Mon, 27 Aug 2018 13:27:55 +0000

                                Yasuhiro MATSUMOTO (Gerrit)

                                unread,
                                Aug 27, 2018, 8:44:18 PM8/27/18
                                to Ian Lance Taylor, Gobot Gobot, Alex Brainman, goph...@pubsubhelper.golang.org, Tobias Klauser, golang-co...@googlegroups.com

                                Yasuhiro MATSUMOTO uploaded patch set #6 to this change.

                                View Change

                                syscall: implement Unix Socket for Windows

                                Add implementation of AF_UNIX. This works only on Windows 10.

                                https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

                                Fixes #26072

                                Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                ---
                                M api/except.txt

                                A src/net/unixsock_windows_test.go
                                M src/syscall/syscall_windows.go
                                M src/syscall/types_windows.go
                                4 files changed, 151 insertions(+), 4 deletions(-)

                                To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                Gerrit-Change-Number: 125456
                                Gerrit-PatchSet: 6
                                Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                Gerrit-CC: Tobias Klauser <tobias....@gmail.com>
                                Gerrit-MessageType: newpatchset

                                Yasuhiro MATSUMOTO (Gerrit)

                                unread,
                                Aug 27, 2018, 8:48:55 PM8/27/18
                                to goph...@pubsubhelper.golang.org, Tobias Klauser, Alex Brainman, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                                Patch Set 5:

                                Thank you

                                View Change

                                  To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                  Gerrit-Project: go
                                  Gerrit-Branch: master
                                  Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                  Gerrit-Change-Number: 125456
                                  Gerrit-PatchSet: 6
                                  Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                  Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                  Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                  Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                  Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                  Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                  Gerrit-CC: Tobias Klauser <tobias....@gmail.com>
                                  Gerrit-Comment-Date: Tue, 28 Aug 2018 00:48:50 +0000

                                  Tobias Klauser (Gerrit)

                                  unread,
                                  Aug 28, 2018, 12:34:28 AM8/28/18
                                  to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Alex Brainman, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                                  Patch set 6:Run-TryBot +1

                                  View Change

                                    To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                    Gerrit-Change-Number: 125456
                                    Gerrit-PatchSet: 6
                                    Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                    Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                    Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                    Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                    Gerrit-Reviewer: Tobias Klauser <tobias....@gmail.com>
                                    Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                    Gerrit-Comment-Date: Tue, 28 Aug 2018 04:34:23 +0000

                                    Gobot Gobot (Gerrit)

                                    unread,
                                    Aug 28, 2018, 12:34:39 AM8/28/18
                                    to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Tobias Klauser, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

                                    TryBots beginning. Status page: https://farmer.golang.org/try?commit=9ab0f4a6

                                    View Change

                                      To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                      Gerrit-Project: go
                                      Gerrit-Branch: master
                                      Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                      Gerrit-Change-Number: 125456
                                      Gerrit-PatchSet: 6
                                      Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                      Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                      Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                      Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                      Gerrit-Reviewer: Tobias Klauser <tobias....@gmail.com>
                                      Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                      Gerrit-Comment-Date: Tue, 28 Aug 2018 04:34:36 +0000

                                      Gobot Gobot (Gerrit)

                                      unread,
                                      Aug 28, 2018, 12:43:04 AM8/28/18
                                      to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Tobias Klauser, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

                                      TryBots are happy.

                                      Patch set 6:TryBot-Result +1

                                      View Change

                                        To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                        Gerrit-Change-Number: 125456
                                        Gerrit-PatchSet: 6
                                        Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                        Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                        Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                        Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                        Gerrit-Reviewer: Tobias Klauser <tobias....@gmail.com>
                                        Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                        Gerrit-Comment-Date: Tue, 28 Aug 2018 04:43:02 +0000

                                        Tobias Klauser (Gerrit)

                                        unread,
                                        Aug 28, 2018, 1:25:14 AM8/28/18
                                        to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Gobot Gobot, Alex Brainman, Ian Lance Taylor, golang-co...@googlegroups.com

                                        Leaving to Alex for the review. Thanks.

                                        View Change

                                          To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                          Gerrit-Project: go
                                          Gerrit-Branch: master
                                          Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                          Gerrit-Change-Number: 125456
                                          Gerrit-PatchSet: 6
                                          Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                          Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                          Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                          Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                          Gerrit-Reviewer: Tobias Klauser <tobias....@gmail.com>
                                          Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                          Gerrit-Comment-Date: Tue, 28 Aug 2018 05:25:11 +0000

                                          Alex Brainman (Gerrit)

                                          unread,
                                          Aug 28, 2018, 5:26:44 AM8/28/18
                                          to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, Tobias Klauser, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                                          LGTM

                                          Thank you everyone for pushing this along.

                                          Alex

                                          RELNOTE=yes

                                          Patch set 6:Code-Review +2

                                          View Change

                                            To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                            Gerrit-Project: go
                                            Gerrit-Branch: master
                                            Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                            Gerrit-Change-Number: 125456
                                            Gerrit-PatchSet: 6
                                            Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                            Gerrit-Reviewer: Tobias Klauser <tobias....@gmail.com>
                                            Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                            Gerrit-Comment-Date: Tue, 28 Aug 2018 09:26:40 +0000

                                            Alex Brainman (Gerrit)

                                            unread,
                                            Aug 28, 2018, 5:26:50 AM8/28/18
                                            to Yasuhiro MATSUMOTO, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Tobias Klauser, Gobot Gobot, Ian Lance Taylor, golang-co...@googlegroups.com

                                            Alex Brainman merged this change.

                                            View Change

                                            Approvals: Alex Brainman: Looks good to me, approved Tobias Klauser: Run TryBots Gobot Gobot: TryBots succeeded
                                            syscall: implement Unix Socket for Windows

                                            Add implementation of AF_UNIX. This works only on Windows 10.

                                            https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

                                            Fixes #26072

                                            Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                            Reviewed-on: https://go-review.googlesource.com/125456
                                            Run-TryBot: Tobias Klauser <tobias....@gmail.com>
                                            TryBot-Result: Gobot Gobot <go...@golang.org>
                                            Reviewed-by: Alex Brainman <alex.b...@gmail.com>

                                            ---
                                            M api/except.txt
                                            A src/net/unixsock_windows_test.go
                                            M src/syscall/syscall_windows.go
                                            M src/syscall/types_windows.go
                                            4 files changed, 151 insertions(+), 4 deletions(-)

                                            diff --git a/api/except.txt b/api/except.txt
                                            index 46dbb45..8507241 100644

                                            --- a/api/except.txt
                                            +++ b/api/except.txt
                                            @@ -370,6 +370,7 @@
                                             pkg syscall (windows-386), type CertRevocationInfo struct, CrlInfo uintptr
                                            pkg syscall (windows-386), type CertRevocationInfo struct, OidSpecificInfo uintptr
                                            pkg syscall (windows-386), type CertSimpleChain struct, TrustListInfo uintptr
                                            +pkg syscall (windows-386), type RawSockaddrAny struct, Pad [96]int8
                                            pkg syscall (windows-amd64), const TOKEN_ALL_ACCESS = 983295
                                            pkg syscall (windows-amd64), type AddrinfoW struct, Addr uintptr
                                            pkg syscall (windows-amd64), type CertChainPolicyPara struct, ExtraPolicyPara uintptr
                                            @@ -378,3 +379,4 @@
                                             pkg syscall (windows-amd64), type CertRevocationInfo struct, CrlInfo uintptr
                                            pkg syscall (windows-amd64), type CertRevocationInfo struct, OidSpecificInfo uintptr
                                            pkg syscall (windows-amd64), type CertSimpleChain struct, TrustListInfo uintptr
                                            +pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8
                                            diff --git a/src/net/unixsock_windows_test.go b/src/net/unixsock_windows_test.go
                                            new file mode 100644
                                            index 0000000..a1da5d4
                                            --- /dev/null
                                            +++ b/src/net/unixsock_windows_test.go
                                            @@ -0,0 +1,93 @@
                                            +// Copyright 2018 The Go Authors. All rights reserved.
                                            +// Use of this source code is governed by a BSD-style
                                            +// license that can be found in the LICENSE file.
                                            +
                                            +// +build windows
                                            +
                                            +package net
                                            +
                                            +import (
                                            + "internal/syscall/windows/registry"
                                            + "os"
                                            + "reflect"
                                            + "strconv"
                                            + "testing"
                                            +)
                                            +
                                            +func isBuild17063() bool {
                                            + k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.READ)
                                            + if err != nil {
                                            + return false
                                            + }
                                            + defer k.Close()
                                            +
                                            + s, _, err := k.GetStringValue("CurrentBuild")
                                            + if err != nil {
                                            + return false
                                            + }
                                            + ver, err := strconv.Atoi(s)
                                            + if err != nil {
                                            + return false
                                            + }
                                            + return ver >= 17063
                                            +}
                                            +
                                            +func TestUnixConnLocalWindows(t *testing.T) {
                                            + if !isBuild17063() {
                                            + t.Skip("unix test")
                                            + }
                                            +
                                            + handler := func(ls *localServer, ln Listener) {}
                                            + for _, laddr := range []string{"", testUnixAddr()} {
                                            + laddr := laddr
                                            + taddr := testUnixAddr()
                                            + ta, err := ResolveUnixAddr("unix", taddr)
                                            + if err != nil {
                                            + t.Fatal(err)
                                            + }
                                            + ln, err := ListenUnix("unix", ta)
                                            + if err != nil {
                                            + t.Fatal(err)
                                            + }
                                            + ls, err := (&streamListener{Listener: ln}).newLocalServer()
                                            + if err != nil {
                                            + t.Fatal(err)
                                            + }
                                            + defer ls.teardown()
                                            + if err := ls.buildup(handler); err != nil {
                                            + t.Fatal(err)
                                            + }
                                            +
                                            + la, err := ResolveUnixAddr("unix", laddr)
                                            + if err != nil {
                                            + t.Fatal(err)
                                            + }
                                            + c, err := DialUnix("unix", la, ta)
                                            + if err != nil {
                                            + t.Fatal(err)
                                            + }
                                            + defer func() {
                                            + c.Close()
                                            + if la != nil {
                                            + defer os.Remove(laddr)
                                            + }
                                            + }()
                                            + if _, err := c.Write([]byte("UNIXCONN LOCAL AND REMOTE NAME TEST")); err != nil {
                                            + t.Fatal(err)
                                            + }
                                            +
                                            + if laddr == "" {
                                            + laddr = "@"
                                            + }
                                            + var connAddrs = [3]struct{ got, want Addr }{
                                            + {ln.Addr(), ta},
                                            + {c.LocalAddr(), &UnixAddr{Name: laddr, Net: "unix"}},
                                            + {c.RemoteAddr(), ta},
                                            + }
                                            + for _, ca := range connAddrs {
                                            + if !reflect.DeepEqual(ca.got, ca.want) {
                                            + t.Fatalf("got %#v, expected %#v", ca.got, ca.want)
                                            + }
                                            + }
                                            + }
                                            +}
                                            diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go
                                            index 638a818..528ef4f 100644
                                            --- a/src/syscall/syscall_windows.go
                                            +++ b/src/syscall/syscall_windows.go
                                            @@ -634,7 +634,7 @@

                                            type RawSockaddrAny struct {
                                            Addr RawSockaddr
                                            - Pad [96]int8
                                            + Pad [100]int8
                                            }

                                            type Sockaddr interface {
                                            @@ -683,19 +683,69 @@
                                            return unsafe.Pointer(&sa.raw), int32(unsafe.Sizeof(sa.raw)), nil
                                            }

                                            +type RawSockaddrUnix struct {
                                            + Family uint16
                                            + Path [UNIX_PATH_MAX]int8
                                            +}
                                            +
                                            type SockaddrUnix struct {
                                            Name string
                                            + raw RawSockaddrUnix
                                            }

                                            func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, int32, error) {
                                            - // TODO(brainman): implement SockaddrUnix.sockaddr()
                                            - return nil, 0, EWINDOWS
                                            + name := sa.Name
                                            + n := len(name)
                                            + if n > len(sa.raw.Path) {
                                            + return nil, 0, EINVAL
                                            + }
                                            + if n == len(sa.raw.Path) && name[0] != '@' {
                                            + return nil, 0, EINVAL
                                            + }
                                            + sa.raw.Family = AF_UNIX
                                            + for i := 0; i < n; i++ {
                                            + sa.raw.Path[i] = int8(name[i])
                                            + }
                                            + // length is family (uint16), name, NUL.
                                            + sl := int32(2)
                                            + if n > 0 {
                                            + sl += int32(n) + 1
                                            + }
                                            + if sa.raw.Path[0] == '@' {
                                            + sa.raw.Path[0] = 0
                                            + // Don't count trailing NUL for abstract address.
                                            + sl--
                                            + }
                                            +
                                            + return unsafe.Pointer(&sa.raw), sl, nil
                                            }

                                            func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) {
                                            switch rsa.Addr.Family {
                                            case AF_UNIX:
                                            - return nil, EWINDOWS
                                            + pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
                                            + sa := new(SockaddrUnix)
                                            + if pp.Path[0] == 0 {
                                            + // "Abstract" Unix domain socket.
                                            + // Rewrite leading NUL as @ for textual display.
                                            + // (This is the standard convention.)
                                            + // Not friendly to overwrite in place,
                                            + // but the callers below don't care.
                                            + pp.Path[0] = '@'
                                            + }
                                            +
                                            + // Assume path ends at NUL.
                                            + // This is not technically the Linux semantics for
                                            + // abstract Unix domain sockets--they are supposed
                                            + // to be uninterpreted fixed-size binary blobs--but
                                            + // everyone uses this convention.
                                            + n := 0
                                            + for n < len(pp.Path) && pp.Path[n] != 0 {
                                            + n++
                                            + }
                                            + bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
                                            + sa.Name = string(bytes)
                                            + return sa, nil

                                            case AF_INET:
                                            pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
                                            diff --git a/src/syscall/types_windows.go b/src/syscall/types_windows.go
                                            index 6911fe5..0b83933 100644
                                            --- a/src/syscall/types_windows.go
                                            +++ b/src/syscall/types_windows.go
                                            @@ -1139,3 +1139,5 @@
                                            SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1
                                            _SYMLINK_FLAG_RELATIVE = 1
                                            )
                                            +
                                            +const UNIX_PATH_MAX = 108 // defined in afunix.h

                                            To view, visit change 125456. To unsubscribe, or for help writing mail filters, visit settings.

                                            Gerrit-Project: go
                                            Gerrit-Branch: master
                                            Gerrit-Change-Id: I76a96a472385a17901885271622fbe55d66bb720
                                            Gerrit-Change-Number: 125456
                                            Gerrit-PatchSet: 7
                                            Gerrit-Owner: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                            Gerrit-Reviewer: Alex Brainman <alex.b...@gmail.com>
                                            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                                            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                            Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
                                            Gerrit-Reviewer: Tobias Klauser <tobias....@gmail.com>
                                            Gerrit-Reviewer: Yasuhiro MATSUMOTO <matt...@gmail.com>
                                            Gerrit-MessageType: merged
                                            Reply all
                                            Reply to author
                                            Forward
                                            0 new messages