Skip to content

SH installs wrong architecture on ARM64 host, ARM32 OS #16

Closed
@directhex

Description

@directhex

Issue Description

get_machine_architecture contains the following:

https://github.com/microsoft/azure-pipelines-tasks/blob/08914a70defbdbe73b2bb87e8d0663bdbeb248e0/Tasks/UseDotNetV2/externals/get-os-distro.sh#L159-L178

This is... fundamentally not how uname should be used.

  1. uname refers to the profile of the running kernel, not the executing environment. It can be a 100% mismatch, and that's valid and fine. The .NET Core environment which gets installed needs to match the executing environment, not the kernel.

Some examples:

(xenial-armhf)root@xam-softiron-16:/# uname -a
Linux xam-softiron-16 4.15.0-50-generic dotnet/cli#54~16.04.1-Ubuntu SMP Wed May 8 15:55:41 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
(xenial-armhf)root@xam-softiron-16:/# file /bin/bash
/bin/bash: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib, for GNU/Linux 3.2.0, BuildID[sha1]=9a214a5bbfe98a862fd835fdcbfa1d9f8dabff0e, stripped
root@breakfast:/# uname -a
Linux breakfast 4.15.0-50-generic dotnet/cli#54-Ubuntu SMP Mon May 6 18:46:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
root@breakfast:/# file /bin/bash 
/bin/bash: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib, for GNU/Linux 3.2.0, BuildID[sha1]=d3d60e9d8193746d270cd74bcb2f5742ffc65d48, stripped

In both these cases, these are 64-bit kernels with 32-bit executing environments. There is no guarantee that 64-bit libraries are available to execute 64-bit code, and it is a 32-bit .NET Core which should be installed.

  1. armv7l is not the only valid uname which requires a 32-bit .NET Core. 32-bit compatibility kernel profile on 64-bit ARM kernels will show armv8l:
$ uname -a
Linux xam-softiron-15 4.15.0-50-generic dotnet/cli#54~16.04.1-Ubuntu SMP Wed May 8 15:55:41 UTC 2019 armv8l armv8l armv8l GNU/Linux

ref: microsoft/azure-pipelines-tasks#10439

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions