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

assignment mismatch in process_windows.go (#65 wasn't really fixed) #67

Closed
mmta opened this issue Oct 24, 2019 · 2 comments
Closed

assignment mismatch in process_windows.go (#65 wasn't really fixed) #67

mmta opened this issue Oct 24, 2019 · 2 comments

Comments

@mmta
Copy link
Contributor

mmta commented Oct 24, 2019

I left a comment in #65, but since it's already closed, here's a repost with a quick test result on Windows.

The related upstream change hasn't been reverted, func (sid *SID) String() is still returning only 1 value: https://github.com/golang/sys/blob/master/windows/security_windows.go#L231

PS C:\Users\mmta\proj\sysinfowin> go get -u -v github.com/elastic/go-sysinfo
go: finding github.com/elastic/go-sysinfo v1.1.0
go: downloading github.com/elastic/go-sysinfo v1.1.0
go: extracting github.com/elastic/go-sysinfo v1.1.0
go: downloading github.com/pkg/errors v0.8.1
go: downloading golang.org/x/sys v0.0.0-20191023151326-f89234f9a2c2
go: downloading github.com/elastic/go-windows v1.0.1
go: downloading howett.net/plist v0.0.0-20181124034731-591f970eefbb
go: downloading github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
go: downloading github.com/prometheus/procfs v0.0.5
go: extracting github.com/pkg/errors v0.8.1
go: extracting github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
go: extracting github.com/elastic/go-windows v1.0.1
go: extracting howett.net/plist v0.0.0-20181124034731-591f970eefbb
go: extracting github.com/prometheus/procfs v0.0.5
go: extracting golang.org/x/sys v0.0.0-20191023151326-f89234f9a2c2
go: finding golang.org/x/sys latest
go: finding howett.net/plist latest
go: finding github.com/joeshaw/multierror latest
go: finding github.com/pkg/errors v0.8.1
go: finding github.com/elastic/go-windows v1.0.1
go: finding github.com/prometheus/procfs v0.0.5
github.com/elastic/go-sysinfo/providers/windows
# github.com/elastic/go-sysinfo/providers/windows
..\..\go\pkg\mod\github.com\elastic\go-sysinfo@v1.1.0\providers\windows\process_windows.go:307:11: assignment mismatch: 2 variables but tokenUser.User.Sid.String returns 1 values
..\..\go\pkg\mod\github.com\elastic\go-sysinfo@v1.1.0\providers\windows\process_windows.go:316:12: assignment mismatch: 2 variables but tokenGroup.PrimaryGroup.String returns 1 values
@sql-sith
Copy link

I am running into the same two exact errors when trying to build an app that has a dependency on process_windows.go.

@mmta
Copy link
Contributor Author

mmta commented Oct 25, 2019

This is another test on a fresh Linux install, trying to build a Windows version of a program that uses go.elastic.co/apm -- which is my real use case of this library.

[mmta@mmta-mb~]$ wget -q https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/ && \
PATH=$PATH:/usr/local/go/bin && \
mkdir testproj && cd testproj && \
{ cat << EOF > main.go 
package main

import "go.elastic.co/apm"

func main () {
  tx := apm.DefaultTracer.StartTransaction("test","test")
  defer tx.End()
}
EOF
} && \
go get -u go.elastic.co/apm && \
go build main.go && echo builds fine for linux

builds fine for linux
[mmta@mmta-mb testproj]$ 

But then:

[mmta@mmta-mb testproj]$ GOOS="windows" go build main.go
../go/src/github.com/elastic/go-sysinfo/providers/windows/arch_windows.go:21:2: cannot find package "github.com/elastic/go-windows" in any of:
        /usr/local/go/src/github.com/elastic/go-windows (from $GOROOT)
        /home/mmta/go/src/github.com/elastic/go-windows (from $GOPATH)
[mmta@mmta-mb testproj]$ go get -u github.com/elastic/go-windows
[mmta@mmta-mb testproj]$ GOOS="windows" go build main.go
# github.com/elastic/go-sysinfo/providers/windows
../go/src/github.com/elastic/go-sysinfo/providers/windows/process_windows.go:307:11: assignment mismatch: 2 variables but tokenUser.User.Sid.String returns 1 values
../go/src/github.com/elastic/go-sysinfo/providers/windows/process_windows.go:316:12: assignment mismatch: 2 variables but tokenGroup.PrimaryGroup.String returns 1 values
[mmta@mmta-mb testproj]$

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

No branches or pull requests

2 participants