Closed Jakob-Naucke closed 2 years ago
Eh. I can sorta reproduce this: s390x, gcc not installed (err 1):
~/go/src/github.com/kata-containers/kata-containers/src/runtime/cmd/kata-runtime$ golangci-lint run ~/go/src/github.com/kata-containers/tests/.ci/.golangci.yml .
ERRO [linters context] typechecking error: directory ../../../../../tests/.ci/.golangci.yml outside available modules
kata-check.go:16:8: could not import C (cgo preprocessing failed) (typecheck)
import "C"
^
s390x, gcc installed (err 1):
~/go/src/github.com/kata-containers/kata-containers/src/runtime/cmd/kata-runtime$ golangci-lint run ~/go/src/github.com/kata-containers/tests/.ci/.golangci.yml .
ERRO [linters context] typechecking error: directory ../../../../../tests/.ci/.golangci.yml outside available modules
kata-check_s390x_test.go:59:16: fieldalignment: struct with 24 pointer bytes could be 16 (govet)
type testData struct {
^
x86_64 (err 7):
~/go/src/github.com/kata-containers/kata-containers/src/runtime/cmd/kata-runtime$ golangci-lint run ~/go/src/github.com/kata-containers/tests/.ci/.golangci.yml .
ERRO [linters context] typechecking error: directory ../../../../../tests/.ci/.golangci.yml outside available modules
I can reach the same err 7 by having gcc installed and fixing alignment á la https://github.com/kata-containers/kata-containers/pull/2237
and gcc will be there after running .ci/setup.sh
, but the static checks are run before.
re alignment: see https://github.com/kata-containers/kata-containers/pull/2774
@Jakob-Naucke , I'm able to reproduce this error on ppc64le
now, however, I do have gcc installed and still see this
WARN [runner] Can't run linter goanalysis_metalinter: buildir: failed to load package katautils: could not load export data: no export data for "github.com/kata-containers/kata-containers/src/runtime/pkg/katautils"
[static-checks.sh:360] INFO: Running golangci-lint on /home/katauser/go/src/github.com/kata-containers/kata-containers/src/runtime/cmd/kata-monitor
WARN [runner] Can't run linter goanalysis_metalinter: buildir: failed to load package katautils: could not load export data: no export data for "github.com/kata-containers/kata-containers/src/runtime/pkg/katautils"
[static-checks.sh:360] INFO: Running golangci-lint on /home/katauser/go/src/github.com/kata-containers/kata-containers/src/runtime/cmd/kata-runtime
kata-check.go:16:8: could not import C (cgo preprocessing failed) (typecheck)
import "C"
^
root@kata5:/home/katauser/go/src/github.com/kata-containers/kata-containers# apt install -y gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version (4:9.3.0-1ubuntu2).
@Amulyam24 yes, gcc seems to be a red herring. At this moment, it works for me on s390x with gcc not installed (like it does on x86_64).
I have found an architecture-agnostic, back-and-forth-switchable condition to reproduce this: It's the file kata-containers/src/runtime/pkg/katautils/config-settings.go
, which is generated by build processes, that must be present for this to work.
Hmmm. For the static checks on GHA, we run the full setup anyways: https://github.com/kata-containers/kata-containers/blob/8739a73dd3fa036e81ecf1612c2a82c5f10cad20/.github/workflows/static-checks.yaml#L60. I still think your approach is nicer because it catches static errors before building and is therefore less CI load. I will check how easy it is to generate that file, and if it itakes me too long, we will just move the static checks after the setup.
Hmmm. For the static checks on GHA, we run the full setup anyways: https://github.com/kata-containers/kata-containers/blob/8739a73dd3fa036e81ecf1612c2a82c5f10cad20/.github/workflows/static-checks.yaml#L60. I still think your approach is nicer because it catches static errors before building and is therefore less CI load. I will check how easy it is to generate that file, and if it itakes me too long, we will just move the static checks after the setup.
Sure @Jakob-Naucke , makes sense. Let me know if you need me to create a PR for moving the changes it that doesn't work.
post #4027, http://jenkins.katacontainers.io/job/kata-containers-2.0-ubuntu-ARM-PR/2451, http://jenkins.katacontainers.io/job/kata-containers-2.0-ubuntu-s390x-PR/694, haven't been able to reproduce so far /cc @Amulyam24 @jongwu