diff --git a/.cirrus.yml b/.cirrus.yml index 5727fbf1..c612714c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -45,8 +45,7 @@ task: alias: Tests persistent_worker: labels: - os: darwin - tart: installed + name: scaleway-m1 env: CIRRUS_INTERNAL_TART_VM: ghcr.io/cirruslabs/macos-monterey-vanilla:12.4 CIRRUS_INTERNAL_TART_SSH_PASSWORD: admin diff --git a/pkg/parser/instance/proto.go b/pkg/parser/instance/proto.go index 4762e0cf..b0a0b617 100644 --- a/pkg/parser/instance/proto.go +++ b/pkg/parser/instance/proto.go @@ -380,9 +380,18 @@ func GuessPlatformOfProtoMessage(message protoreflect.Message, descriptor protor return "" } -func GuessArchitectureOfProtoMessage(anyInstance *anypb.Any, descriptor protoreflect.MessageDescriptor) string { - message := dynamicpb.NewMessage(descriptor) - _ = proto.Unmarshal(anyInstance.GetValue(), message) +func GuessArchitecture(anyInstance *anypb.Any, descriptor protoreflect.MessageDescriptor) string { + instanceType := anyInstance.TypeUrl + if strings.Contains(instanceType, "Arm") { + return "arm64" + } + + dynamicMessage := dynamicpb.NewMessage(descriptor) + _ = proto.Unmarshal(anyInstance.GetValue(), dynamicMessage) + return GuessArchitectureOfProtoMessage(dynamicMessage, descriptor) +} + +func GuessArchitectureOfProtoMessage(message protoreflect.Message, descriptor protoreflect.MessageDescriptor) string { fields := descriptor.Fields() architectureField := fields.ByJSONName("architecture") if architectureField != nil && message.Has(architectureField) { diff --git a/pkg/parser/task/task.go b/pkg/parser/task/task.go index 3088b878..43ea4d6b 100644 --- a/pkg/parser/task/task.go +++ b/pkg/parser/task/task.go @@ -209,7 +209,7 @@ func NewTask( }, ) } - architecture := instance.GuessArchitectureOfProtoMessage(anyInstance, scopedDescriptor) + architecture := instance.GuessArchitecture(anyInstance, scopedDescriptor) if architecture != "" { task.proto.Environment = environment.Merge( task.proto.Environment, map[string]string{