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

Unix AIX - Problem to build node_exporter #840

Closed
BilouteMaif opened this issue Oct 11, 2018 · 7 comments
Closed

Unix AIX - Problem to build node_exporter #840

BilouteMaif opened this issue Oct 11, 2018 · 7 comments

Comments

@BilouteMaif
Copy link

BilouteMaif commented Oct 11, 2018

We try to build node_exporter v0.15.2 on aix system v7.2.
Prerequisites:
yum (and its dependencies), gcc-go version gccgo go1.10 (GCC) 8.1.0 aix / ppc (and its dependencies) and git version 2.8.1 (and its dependencies).

It failed with this issue:

[root@samaq024] /data/go/src/github.com/prometheus/node_exporter
# /opt/freeware/bin/make
>> formatting code
>> vetting code
# github.com/prometheus/node_exporter/vendor/github.com/sirupsen/logrus
vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go:15:19: error: reference to > undefined identifier 'terminal.IsTerminal'
return terminal.IsTerminal(int(v.Fd()))
^
make: *** [Makefile:98: vet] Error 2

Logrus version is 1.1.1

Exchange in prometheus-users group:
https://groups.google.com/forum/#!topic/prometheus-users/-TloFSp7y54

@dgsb
Copy link
Collaborator

dgsb commented Oct 11, 2018

There is not much we can do there. AIX does not seem to be supported by golang.org/x/crypto and this seems to be the root cause of your error. You may try to open a ticket to this library but I'm not sure that this target is in their scope.

What we may do to mitigate your build problem is to provide an empty implementation for AIX of checkIfTerminal which would always return false, the drawback would be that the TextFormatter could not automatically activate output coloring.

Alas, there is no way to perform nor testing neither cross-compiling for aix. I've no idea which build constraint or file extension must be set with gccgo on the specific aix file to only be included on aix build, and which build constraint to add in the file terminal_check_notappengine.go to exclude from the aix build.

As you have such environment to test, if you provide a patch which pass all our builds and test suite, I would happily merge it in our code base.

@dgsb
Copy link
Collaborator

dgsb commented Oct 12, 2018

Actually you probably can set any build constraint from the command line in gccgo.

@dgsb
Copy link
Collaborator

dgsb commented Oct 12, 2018

Can you test if the branch I've just pushed upstream/fix_aix_build fixes your issue ?

@BilouteMaif
Copy link
Author

Hi david,

Thanks a lot !
We now have other mistakes during the make process.

For information:

[root@samaq024] /data/go/src/github.com/prometheus/node_exporter
# /opt/freeware/bin/make

checking code style
vetting code

github.com/prometheus/node_exporter

./node_exporter.go:22:2: could not import github.com/prometheus/client_golang/prometheus (unrecognized magic string: "<big")
./node_exporter.go:23:2: could not import github.com/prometheus/client_golang/prometheus/promhttp (unrecognized magic string: "<big")
./node_exporter.go:24:2: could not import github.com/prometheus/common/log (unrecognized magic string: "<big")
./node_exporter.go:25:2: could not import github.com/prometheus/common/version (unrecognized magic string: "<big")
./node_exporter.go:26:2: could not import github.com/prometheus/node_exporter/collector (unrecognized magic string: "<big")
./node_exporter.go:27:2: could not import gopkg.in/alecthomas/kingpin.v2 (unrecognized magic string: "<big")
./node_exporter_test.go:13:2: could not import github.com/prometheus/procfs (unrecognized magic string: "<big")
./node_exporter.go:73:19: undeclared name: kingpin
./node_exporter.go:74:19: undeclared name: kingpin
./node_exporter.go:77:15: undeclared name: kingpin
./node_exporter.go:78:2: undeclared name: kingpin
./node_exporter.go:79:2: undeclared name: kingpin
./node_exporter.go:80:2: undeclared name: kingpin
./node_exporter.go:92:17: cannot range over nc.Collectors (invalid operand)
./node_exporter.go:27:2: "gopkg.in/alecthomas/kingpin.v2" imported but not used
vet: typecheck failures
# github.com/prometheus/node_exporter/collector
collector/buddyinfo.go:23:2: could not import github.com/prometheus/client_golang/prometheus (unrecognized magic string: "<big")
collector/buddyinfo.go:24:2: could not import github.com/prometheus/common/log (unrecognized magic string: "<big")
collector/buddyinfo.go:25:2: could not import github.com/prometheus/procfs (unrecognized magic string: "<big")
collector/collector.go:24:2: could not import gopkg.in/alecthomas/kingpin.v2 (unrecognized magic string: "<big")
collector/ntp.go:23:2: could not import github.com/beevik/ntp (unrecognized magic string: "<big")
collector/runit.go:21:2: could not import github.com/soundcloud/go-runit/runit (unrecognized magic string: "<big")
collector/supervisord.go:19:2: could not import github.com/kolo/xmlrpc (unrecognized magic string: "<big")
collector/textfile.go:28:6: could not import github.com/prometheus/client_model/go (unrecognized magic string: "<big")
collector/textfile.go:29:2: could not import github.com/prometheus/common/expfmt (unrecognized magic string: "<big")
collector/textfile_test.go:24:2: could not import github.com/prometheus/client_golang/prometheus/promhttp (unrecognized magic string: "<big")
collector/ntp.go:34:23: undeclared name: kingpin
collector/ntp.go:35:23: undeclared name: kingpin
collector/ntp.go:36:23: undeclared name: kingpin
collector/ntp.go:37:23: undeclared name: kingpin
collector/ntp.go:40:23: undeclared name: kingpin
collector/ntp.go:41:23: undeclared name: kingpin
collector/paths.go:25:13: undeclared name: kingpin
collector/paths.go:26:13: undeclared name: kingpin
collector/runit.go:25:23: undeclared name: kingpin
collector/supervisord.go:26:19: undeclared name: kingpin
collector/buddyinfo.go:64:24: cannot range over buddyInfo (invalid operand)
collector/buddyinfo.go:65:28: cannot range over entry.Sizes (invalid operand)
collector/collector.go:67:10: undeclared name: kingpin
collector/runit.go:73:26: cannot range over services (invalid operand)
collector/supervisord.go:115:12: invalid operation: c.client (variable of type *invalid type) has no field or method Call
collector/textfile.go:216:22: cannot range over parsedFamilies (invalid operand)
collector/textfile.go:217:22: cannot range over mf.Metric (invalid operand)
collector/textfile.go:234:22: cannot range over parsedFamilies (invalid operand)
collector/textfile.go:68:25: invalid operation: metricFamily (variable of type *invalid type) has no field or method Metric
collector/textfile.go:68:25: cannot range over metricFamily.Metric (invalid operand)
collector/textfile.go:70:25: cannot range over labels (invalid operand)
collector/textfile.go:77:25: invalid operation: metricFamily (variable of type *invalid type) has no field or method Metric
collector/textfile.go:77:25: cannot range over metricFamily.Metric (invalid operand)
collector/textfile.go:85:25: cannot range over labels (invalid operand)
collector/textfile.go:104:17: invalid operation: metricFamily (variable of type *invalid type) has no field or method GetType
collector/textfile.go:120:22: cannot range over metric.Summary.Quantile (invalid operand)
collector/textfile.go:125:7: invalid operation: metricFamily (variable of type *invalid type) has no field or method Name
collector/textfile.go:126:6: invalid operation: metricFamily (variable of type *invalid type) has no field or method GetHelp
collector/textfile.go:135:22: cannot range over metric.Histogram.Bucket (invalid operand)
collector/textfile.go:140:7: invalid operation: metricFamily (variable of type *invalid type) has no field or method Name
collector/textfile.go:141:6: invalid operation: metricFamily (variable of type *invalid type) has no field or method GetHelp
collector/textfile.go:154:7: invalid operation: metricFamily (variable of type *invalid type) has no field or method Name
collector/textfile.go:155:6: invalid operation: metricFamily (variable of type *invalid type) has no field or method GetHelp
collector/paths_test.go:24:15: undeclared name: kingpin
collector/paths_test.go:38:15: undeclared name: kingpin
collector/paths_test.go:52:15: undeclared name: kingpin
collector/paths_test.go:66:15: undeclared name: kingpin
collector/collector.go:24:2: "gopkg.in/alecthomas/kingpin.v2" imported but not used
collector/ntp.go:25:2: "gopkg.in/alecthomas/kingpin.v2" imported but not used
collector/paths.go:20:2: "gopkg.in/alecthomas/kingpin.v2" imported but not used
collector/runit.go:22:2: "gopkg.in/alecthomas/kingpin.v2" imported but not used
collector/supervisord.go:22:2: "gopkg.in/alecthomas/kingpin.v2" imported but not used
collector/paths_test.go:20:2: "gopkg.in/alecthomas/kingpin.v2" imported but not used
vet: typecheck failures
make: *** [Makefile:116: vet] Error 2
...

When we run a "/opt/freeware/bin/make -i", there is lots of others errors..
As far as you concerned:

running staticcheck
/data/go/src/github.com/prometheus/node_exporter/vendor/github.com/alecthomas/units/util.go:4:2: could not import errors (cannot find package "errors" in any of:
/data/go/src/github.com/prometheus/node_exporter/vendor/errors (vendor tree)
/opt/freeware/src/errors (from $GOROOT)
/data/go/src/errors (from $GOPATH))
couldn't load packages due to errors: github.com/prometheus/node_exporter/vendor/github.com/prometheus/common/log, github.com/prometheus/node_exporter/vendor/github.com/prometheus/common/expfmt, github.com/prometheus/node_exporter/vendor/github.com/sirupsen/logrus and 25 more
make: [Makefile:120: staticcheck] Error 1 (ignored)
package github.com/prometheus/prometheus/vendor/github.com/prometheus/client_golang/api:
../prometheus/vendor/github.com/prometheus/client_golang/api/client.go:1:1: expected 'package', found 'EOF'

Finaly, i'm not sure node_exporter can be build for AIX system.

@dgsb
Copy link
Collaborator

dgsb commented Oct 15, 2018

@BilouteMaif can you confirm first that the branch builds for aix target and that all tests pass ?
Beyond that we won't be able to fix the issue you face building another project.
We may help if you isolate the specific logrus build command which does not work for aix.

@dgsb
Copy link
Collaborator

dgsb commented Oct 30, 2018

@BilouteMaif can you provide some feedback on the proposed fix ?

@BilouteMaif
Copy link
Author

Hi david,

Sorry for the delay, i was on vacation.
What do you mean about all tests pass ?
I confirm the branch build for aix helped us for the first issue mentioned above.
However we are still on error with the next step of the compil!
We have not advanced yet

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