From de9090dde9d9dd3f9c5bd8c7bda831132828bc04 Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Wed, 20 Oct 2021 18:21:24 +0000 Subject: fix the failed test target //pkg/cpuid:cpuid_test on arm64. --- pkg/cpuid/cpuid_arm64.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cpuid/cpuid_arm64.go b/pkg/cpuid/cpuid_arm64.go index 04645aed5..446d3db83 100644 --- a/pkg/cpuid/cpuid_arm64.go +++ b/pkg/cpuid/cpuid_arm64.go @@ -491,4 +491,5 @@ func init() { initCPUInfo() initHwCap() initFeaturesFromString() + hostFeatureSet = getHostFeatureSet() } -- cgit v1.2.3 From c0dfa0e845b3571550e84bdebb411b119086b4aa Mon Sep 17 00:00:00 2001 From: Jing Chen Date: Sat, 23 Oct 2021 15:38:28 -0700 Subject: initialize hostFeatureSet from init function --- pkg/cpuid/cpuid.go | 2 +- pkg/cpuid/cpuid_x86.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cpuid/cpuid.go b/pkg/cpuid/cpuid.go index 4d5e062a8..e1ea9b32c 100644 --- a/pkg/cpuid/cpuid.go +++ b/pkg/cpuid/cpuid.go @@ -43,7 +43,7 @@ func HostFeatureSet() *FeatureSet { return hostFeatureSet } -var hostFeatureSet = getHostFeatureSet() +var hostFeatureSet *FeatureSet // ErrIncompatible is returned by FeatureSet.HostCompatible if fs is not a // subset of the host feature set. diff --git a/pkg/cpuid/cpuid_x86.go b/pkg/cpuid/cpuid_x86.go index a92d32d74..8cbcc9f61 100644 --- a/pkg/cpuid/cpuid_x86.go +++ b/pkg/cpuid/cpuid_x86.go @@ -1109,4 +1109,5 @@ func initFeaturesFromString() { func init() { initCPUFreq() initFeaturesFromString() + hostFeatureSet = getHostFeatureSet() } -- cgit v1.2.3