Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

arm64: Fix static check error #1223

Closed
wants to merge 1 commit into from

Conversation

teawater
Copy link
Member

@teawater teawater commented Feb 11, 2019

Got following error:

/home/jenkins/workspace/kata-containers-runtime-ARM-18.04-PR/go/src/github.com/kata-containers/runtime/virtcontainers/utils
cli/kata-check_arm64.go:129:9:warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
cli/kata-check_test.go:141:113:warning: undeclared name: TestDataa (unused)
cli/kata-check_test.go:141:113:warning: unused variable or constant undeclared name: TestDataa (varcheck)
virtcontainers/qemu_arm64_test.go:43:23:warning: unused variable or constant undeclared name: virt (varcheck)
virtcontainers/qemu_arm64_test.go:50:11:warning: unused variable or constant undeclared name: defaultMemSlots (varcheck)
virtcontainers/qemu_arm64_test.go:54:40:warning: unused variable or constant too few arguments in call to arm64.memoryTopology (varcheck)
virtcontainers/qemu_arm64_test.go:29:23:warning: unused variable or constant undeclared name: virt (varcheck)
cli/kata-check_test.go:141:113:warning: undeclared name: TestDataa (staticcheck)
virtcontainers/qemu_arm64_test.go:43:23:warning: unused struct field undeclared name: virt (structcheck)
virtcontainers/qemu_arm64_test.go:50:11:warning: unused struct field undeclared name: defaultMemSlots (structcheck)
virtcontainers/qemu_arm64_test.go:54:40:warning: unused struct field too few arguments in call to arm64.memoryTopology (structcheck)
virtcontainers/qemu_arm64_test.go:29:23:warning: unused struct field undeclared name: virt (structcheck)
cli/kata-check_test.go:141:113:warning: unused struct field undeclared name: TestDataa (structcheck)
Build step 'Execute shell' marked build as failure

Fixes: #1206

Signed-off-by: Hui Zhu [email protected]

@teawater
Copy link
Member Author

/test

@teawater teawater force-pushed the armfix branch 2 times, most recently from aeea5ca to ed4c554 Compare February 11, 2019 06:20
@teawater
Copy link
Member Author

/test

@WeiZhang555
Copy link
Member

There're still some error left 😄

15:43:21 virtcontainers/qemu_arm64_test.go:52:11:warning: unused variable or constant undeclared name: defaultMemSlots (varcheck)
15:43:21 virtcontainers/qemu_arm64_test.go:56:40:warning: unused variable or constant too few arguments in call to arm64.memoryTopology (varcheck)
15:43:21 virtcontainers/qemu_arm64_test.go:52:11:warning: unused struct field undeclared name: defaultMemSlots (structcheck)
15:43:21 virtcontainers/qemu_arm64_test.go:56:40:warning: unused struct field too few arguments in call to arm64.memoryTopology (structcheck)
15:43:21 virtcontainers/qemu_arm64_test.go:52:11:warning: undeclared name: defaultMemSlots (unused)
15:43:22 virtcontainers/qemu_arm64_test.go:52:11:warning: undeclared name: defaultMemSlots (staticcheck)

jodh-intel
jodh-intel previously approved these changes Feb 11, 2019
Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

/cc @Pennyzct.

Got following error:
/home/jenkins/workspace/kata-containers-runtime-ARM-18.04-PR/go/src/github.com/kata-containers/runtime/virtcontainers/utils
cli/kata-check_arm64.go:129:9:warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
cli/kata-check_test.go:141:113:warning: undeclared name: TestDataa (unused)
cli/kata-check_test.go:141:113:warning: unused variable or constant undeclared name: TestDataa (varcheck)
virtcontainers/qemu_arm64_test.go:43:23:warning: unused variable or constant undeclared name: virt (varcheck)
virtcontainers/qemu_arm64_test.go:50:11:warning: unused variable or constant undeclared name: defaultMemSlots (varcheck)
virtcontainers/qemu_arm64_test.go:54:40:warning: unused variable or constant too few arguments in call to arm64.memoryTopology (varcheck)
virtcontainers/qemu_arm64_test.go:29:23:warning: unused variable or constant undeclared name: virt (varcheck)
cli/kata-check_test.go:141:113:warning: undeclared name: TestDataa (staticcheck)
virtcontainers/qemu_arm64_test.go:43:23:warning: unused struct field undeclared name: virt (structcheck)
virtcontainers/qemu_arm64_test.go:50:11:warning: unused struct field undeclared name: defaultMemSlots (structcheck)
virtcontainers/qemu_arm64_test.go:54:40:warning: unused struct field too few arguments in call to arm64.memoryTopology (structcheck)
virtcontainers/qemu_arm64_test.go:29:23:warning: unused struct field undeclared name: virt (structcheck)
cli/kata-check_test.go:141:113:warning: unused struct field undeclared name: TestDataa (structcheck)
Build step 'Execute shell' marked build as failure
And:
/home/jenkins/workspace/kata-containers-runtime-ARM-18.04-PR/go/src/github.com/kata-containers/runtime/virtcontainers/utils
virtcontainers/qemu_arm64_test.go:52:11:warning: unused variable or constant undeclared name: defaultMemSlots (varcheck)
virtcontainers/qemu_arm64_test.go:56:40:warning: unused variable or constant too few arguments in call to arm64.memoryTopology (varcheck)
virtcontainers/qemu_arm64_test.go:52:11:warning: unused struct field undeclared name: defaultMemSlots (structcheck)
virtcontainers/qemu_arm64_test.go:56:40:warning: unused struct field too few arguments in call to arm64.memoryTopology (structcheck)
virtcontainers/qemu_arm64_test.go:52:11:warning: undeclared name: defaultMemSlots (unused)
virtcontainers/qemu_arm64_test.go:52:11:warning: undeclared name: defaultMemSlots (staticcheck)
Build step 'Execute shell' marked build as failure

Fixes: kata-containers#1206

Signed-off-by: Hui Zhu <[email protected]>
@sameo
Copy link

sameo commented Feb 11, 2019

#1218, #1202 and this one try to address the same issue.
I propose that we let @Pennyzct handle this by cherry picking the best of all those PRs, but the idea is to fix the ARM CI really quickly. We've been merging a lot of PRs without checking if they even run on ARM 64.
@Pennyzct Could you please drive this?

@Pennyzct
Copy link
Contributor

The struct TestDataa is applied for amd64, ppc64le, s390x, but not for arm64. But the generic func genericTestGetCPUDetails was using it as argument. So in #1202, i was trying to make it generic and keep making specific TestGetCPUDetails for arm64. ptal. ;)

@sameo
Copy link

sameo commented Feb 11, 2019

The struct TestDataa is applied for amd64, ppc64le, s390x, but not for arm64. But the generic func genericTestGetCPUDetails was using it as argument. So in #1202, i was trying to make it generic and keep making specific TestGetCPUDetails for arm64. ptal. ;)

Fine with me. If you can make the ARM CI pass entirely with #1202, I'll approve it right away. We can't have 3 different PRs for the same issue, from 3 different people. We want ARM to be a first class citizen for Kata so we need the CI to be fixed. Also, we must not merge a PR if the ARM CI fails.
@teawater Are you ok with dropping #1223 and letting @Pennyzct fix the ARM CI with #1202?

@teawater
Copy link
Member Author

@sameo I am OK with this idea.

@teawater teawater closed this Feb 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants