HewlettPackard / lustre_exporter

Prometheus exporter for use with the Lustre parallel filesystem
Apache License 2.0
36 stars 51 forks source link

make issue on centos7 #143

Closed afifss81 closed 5 years ago

afifss81 commented 5 years ago

ii am trying to install the lustre_exporter on cetos 7 and below the steps i did

1-install go command

wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz

tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz

Adjust the Path Variable. ---> vi ~/.bash_profile ----> add the follwoing " export PATH=$PATH:/usr/local/go/bin" ---> source ~/.bash_profile

2-download luster_exporter

cd /root/ ; go get github.com/HewlettPackard/lustre_exporter

3-Run make file

cd /root/go/src/github.com/HewlettPackard/lustre_exporter

make

the issue appears when i run make (check the attached file)

luster_error.txt

any thing i am missing ?

joehandzik commented 5 years ago

If you take a look at the build report, go tip is building but 1.8.x is not due to some of our linters...we need to fix this, but to get you started if you move to 1.9.x you should be able to make this work.

afifss81 commented 5 years ago

Thanks will use the 1.9.x

From: Joe Handzik notifications@github.com Sent: Tuesday, June 18, 2019 5:15 PM To: HewlettPackard/lustre_exporter lustre_exporter@noreply.github.com Cc: Afify, Sherif S (IBS) Sherif.Afify@se1.bp.com; Author author@noreply.github.com Subject: Re: [HewlettPackard/lustre_exporter] make issue on centos7 (#143)

If you take a look at the build report, go tip is building but 1.8.x is not due to some of our linters...we need to fix this, but to get you started if you move to 1.9.x you should be able to make this work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/HewlettPackard/lustre_exporter/issues/143?email_source=notifications&email_token=ADNLVEPTTFDN4CZEQDUFUETP3D3XDA5CNFSM4HYUUTZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX67DKQ#issuecomment-503181738, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADNLVEOWKHCPDP6FUF5GUO3P3D3XDANCNFSM4HYUUTZQ.

afifss81 commented 5 years ago

i tried both 1.9.7 and 1.12.6 still have the same issue but in 1.12.6 i see a min. errors

1-version 1.9.7 error:

../../../../../../usr/local/go/src/net/cgo_unix.go:127:53:warning: invalid operation: r (variable of type *invalid type) has no field or method ai_addr (compile) (staticcheck)
../../../../../../usr/local/go/src/net/cgo_unix.go:175:22:warning: invalid operation: res (variable of type *invalid type) has no field or method ai_canonname (compile) (staticcheck)
../../../../../../usr/local/go/src/net/cgo_unix.go:183:30:warning: invalid operation: r (variable of type *invalid type) has no field or method ai_next (compile) (staticcheck)
../../../../../../usr/local/go/src/net/cgo_unix.go:185:6:warning: invalid operation: r (variable of type *invalid type) has no field or method ai_socktype (compile) (staticcheck)
../../../../../../usr/local/go/src/net/cgo_unix.go:188:10:warning: invalid operation: r (variable of type *invalid type) has no field or method ai_family (compile) (staticcheck)
../../../../../../usr/local/go/src/net/cgo_unix.go:190:53:warning: invalid operation: r (variable of type *invalid type) has no field or method ai_addr (compile) (staticcheck)
../../../../../../usr/local/go/src/net/cgo_unix.go:194:53:warning: invalid operation: r (variable of type *invalid type) has no field or method ai_addr (compile) (staticcheck)
make: *** [gometalinter] Error 1
[root@vm1 lustre_exporter]# go version
go version go1.9.7 linux/amd64
[root@vm1 lustre_exporter]#

2-version 1.12.6

[root@vm1 lustre_exporter]# make
>> formatting code
>> linting code
WARNING: Linters are now vendored by default, --update ignored. The original
behaviour can be re-enabled with --no-vendored-linters.

To request an update for a vendored linter file an issue at:
https://github.com/alecthomas/gometalinter/issues/new

../../../../../../usr/local/go/src/net/lookup_unix.go:324:23:warning: undeclared name: cgoLookupPTR (maligned)
../../../../../../usr/local/go/src/net/lookup_unix.go:124:24:warning: undeclared name: cgoLookupCNAME (maligned)
../../../../../../usr/local/go/src/net/lookup_unix.go:108:23:warning: undeclared name: cgoLookupPort (maligned)
../../../../../../usr/local/go/src/net/lookup_unix.go:96:24:warning: undeclared name: cgoLookupIP (maligned)
../../../../../../usr/local/go/src/net/lookup_unix.go:81:24:warning: undeclared name: cgoLookupHost (maligned)
../../../../../../usr/local/go/src/net/lookup_unix.go:324:23:warning: unused variable or constant undeclared name: cgoLookupPTR (varcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:124:24:warning: unused variable or constant undeclared name: cgoLookupCNAME (varcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:108:23:warning: unused variable or constant undeclared name: cgoLookupPort (varcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:96:24:warning: unused variable or constant undeclared name: cgoLookupIP (varcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:81:24:warning: unused variable or constant undeclared name: cgoLookupHost (varcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:324:23:warning: undeclared name: cgoLookupPTR (interfacer)
../../../../../../usr/local/go/src/net/lookup_unix.go:124:24:warning: undeclared name: cgoLookupCNAME (interfacer)
../../../../../../usr/local/go/src/net/lookup_unix.go:108:23:warning: undeclared name: cgoLookupPort (interfacer)
../../../../../../usr/local/go/src/net/lookup_unix.go:96:24:warning: undeclared name: cgoLookupIP (interfacer)
../../../../../../usr/local/go/src/net/lookup_unix.go:81:24:warning: undeclared name: cgoLookupHost (interfacer)
../../../../../../usr/local/go/src/net/lookup_unix.go:324:23:warning: undeclared name: cgoLookupPTR (unconvert)
../../../../../../usr/local/go/src/net/lookup_unix.go:124:24:warning: undeclared name: cgoLookupCNAME (unconvert)
../../../../../../usr/local/go/src/net/lookup_unix.go:108:23:warning: undeclared name: cgoLookupPort (unconvert)
../../../../../../usr/local/go/src/net/lookup_unix.go:96:24:warning: undeclared name: cgoLookupIP (unconvert)
../../../../../../usr/local/go/src/net/lookup_unix.go:81:24:warning: undeclared name: cgoLookupHost (unconvert)
../../../../../../usr/local/go/src/net/lookup_unix.go:324:23:warning: unused struct field undeclared name: cgoLookupPTR (structcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:124:24:warning: unused struct field undeclared name: cgoLookupCNAME (structcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:108:23:warning: unused struct field undeclared name: cgoLookupPort (structcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:96:24:warning: unused struct field undeclared name: cgoLookupIP (structcheck)
../../../../../../usr/local/go/src/net/lookup_unix.go:81:24:warning: unused struct field undeclared name: cgoLookupHost (structcheck)
make: *** [gometalinter] Error 1
[root@vm1 lustre_exporter]# go version
go version go1.12.6 linux/amd64
[root@vm1 lustre_exporter]#
joehandzik commented 5 years ago

I'm going to do what I can here, but some of this seems pretty specific to the linter that we're using. I can remove it, but I don't want to just do that without considering our options.

In the meantime, I just pulled this down and ran with version 1.12.6, and everything worked fine. I don't know what version tip is at, but I would be surprised if 1.12.x was super close to tip. So you'll need to upgrade a bit further to get this working in its current state.

EDIT: And now I see your secondary try was 1.12.6. Frankly, it looks like something in your environment is causing the code to build incorrectly, but I'm not entirely sure what. I'll try to reproduce, but in the meantime you can try entirely removing the lustre_exporter download chain from your go path and rerunning a clean 'go get' with 1.12.6.

joehandzik commented 5 years ago

Ok, on further inspection I made the decision to switch us to golangci-lint for linting. It seems to work well in my testing so far.

I was not able to get the Travis configuration working in its previous state (testing against 1.8.x and tip). On further investigation, these issues are to be expected. Only the last two releases of golang are supported (so 1.12 and 1.11). Anything older is not. In fact, I noticed that one of my primary issues with the new linter was a reference to the 'wasm' architecture which I assume is the WebAssembly support in golang as of 1.11. Testing passes now with the new linter and a couple fixes it requested.

Please reach out if you continue to have issues, but I suspect your environment needs to be cleaned up. It could be a result of binaries involved in the lustre_exporter build and run process being built with another version of golang. The 'easiest' fix is to delete everything located at $GO_PATH if you can. Please reach out if you continue to have issues, but I'm going to close for now as master builds in Travis and in my environment.