prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
769 stars 317 forks source link

Update build constraints for loong64 and s390x, Compatible with lower versions of go compiler #626

Open fangwentong opened 6 months ago

fangwentong commented 6 months ago

go1.16 cannot recognize the loong64 instruction set architecture, and an error will occur during compilation. This MR explicitly specifies the instruction set build constraints in the source file.

When running on linux/amd64, got the following error

❯ gvm use go1.16
Now using version go1.16
❯ go build -o main main.go
# github.com/prometheus/procfs
vendor/github.com/prometheus/procfs/cpuinfo_x86.go:20:5: parseCPUInfo redeclared in this block
    previous declaration at vendor/github.com/prometheus/procfs/cpuinfo_loong64.go:19:5
discordianfish commented 5 months ago

Not sure we want/need to support go 1.16. Why do you need to compile it with that old version? @SuperQ wdyt?

SuperQ commented 4 months ago

As of today this library requires Go 1.20 and newer.