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

Not working with Go Get #221

Closed
Colhodm opened this issue Oct 6, 2019 · 4 comments · Fixed by #222

Comments

@Colhodm
Copy link

commented Oct 6, 2019

Hi,
Trying to use go get and compile, but getting complaints from the commit that went in a day ago:
./cpuinfo.go:58:15: undefined: util.ReadFileNoStat
./ipvs.go:70:15: undefined: util.ReadFileNoStat
./proc.go:125:15: undefined: util.ReadFileNoStat
./proc.go:139:15: undefined: util.ReadFileNoStat
./proc_environ.go:26:15: undefined: util.ReadFileNoStat
./proc_fdinfo.go:48:15: undefined: util.ReadFileNoStat
./proc_io.go:46:15: undefined: util.ReadFileNoStat
./proc_psi.go:60:15: undefined: util.ReadFileNoStat
./proc_stat.go:116:15: undefined: util.ReadFileNoStat
./proc_status.go:78:15: undefined: util.ReadFileNoStat
./proc_status.go:78:15: too many errors
Thanks!

@pgier

This comment has been minimized.

Copy link
Collaborator

commented Oct 6, 2019

Are you getting those errors doing a go get github.com/prometheus/procfs? I tried this after deleting the existing procfs dir and cleaning my local module cache go clean --modcache, and I didn't see any errors.

The new ReadFileNoStat function is in the internal.util package. Do you see this in your procfs directory?

@Colhodm

This comment has been minimized.

Copy link
Author

commented Oct 6, 2019

Hi,
The function is defined in the util package, and is present in the code written in sysreadfile.go. So the source code looks all fine, so I'm not sure why it is unable to resolve the import path for util. I am using Go 1.13, but can also provide a format of my directories, however, they look very standard
Edited: Also tried it with Go 1.10 but getting the same issue

@dmitshur

This comment has been minimized.

Copy link

commented Oct 6, 2019

The problem is in PR #219. It added ReadFileNoStat to internal/util/sysreadfile.go but not to internal/util/sysreadfile_compat.go. I left a comment here.

I didn't see any errors.

@pgier This problem affects non-Linux OSes; you probably tested on Linux.

pgier added a commit to pgier/procfs that referenced this issue Oct 7, 2019
This allows it to be built on all platforms
Fixes prometheus#221

Signed-off-by: Paul Gier <pgier@redhat.com>
@pgier

This comment has been minimized.

Copy link
Collaborator

commented Oct 7, 2019

Sorry about that, I have created #222 to hopefully fix this.

pgier added a commit to pgier/procfs that referenced this issue Oct 7, 2019
This allows it to be built on all platforms
Fixes prometheus#221.
Also, updates the max size to 512k (instead of 500k) to match the comment.

Signed-off-by: Paul Gier <pgier@redhat.com>
@pgier pgier closed this in #222 Oct 7, 2019
pgier added a commit that referenced this issue Oct 7, 2019
This allows it to be built on all platforms
Fixes #221.
Also, updates the max size to 512k (instead of 500k) to match the comment.

Signed-off-by: Paul Gier <pgier@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.