[Unix|*] Rework and share the logic for determining __DistroRid (dotnet/coreclr#22628)
authorJarret Shook <jashoo@microsoft.com>
Thu, 21 Feb 2019 21:16:33 +0000 (13:16 -0800)
committerGitHub <noreply@github.com>
Thu, 21 Feb 2019 21:16:33 +0000 (13:16 -0800)
commit5b9915d99d4ba3b91945494eda307fec6194a50c
treefaa077303c3bd9d692a76390ebb7b5828594b5fd
parent2c63171c3c9f09aef9da19bda4b421428070e465
[Unix|*] Rework and share the logic for determining __DistroRid (dotnet/coreclr#22628)

* [Unix|*] Rework and share the logic for determining __DistroRid

This will consolidate all of our different functions which determine
the __DistroRid into one file. In addition, it will remove the unused
__HostDistroRid file.

Lastly, it corrects the rid choice when crossbuilding musl-arm64 as the
cross-rootfs non-portable build will correctly be picked up.

* Fix typo and use __BuildArch in place of __Arch

* Correct non-portable build decision

* Add error for missing redhat-release

* Fix redhat comparison

* Correct previous rhel or

* Fix cross scenerio

* Fix missed $

* Set __RuntimeId for runtest.proj

* Correct naming convention of file

* Address feedback and support -portablebuild=0

With this change:

1. build.sh and build-test.sh should build portable by default.
2. init-distro-rid.sh checks __PortableBuild=1. If so, then it must force rhel 6 and freebsd to __PortableBuild=0 and use the non-portable build
    - For __PortableBuild=0 init-distro-rid.sh sets the non-portable rid correctly to "${ID}.${VERSION_ID}-${buildArch}"

* Correct arguments

* Fix if to include then

* A few more changes to correct linux-musl-arm64

* Add error for non-cross build and correctly pass ROOTFS_DIR

* Correctly exit instead of echo

* Correct isCrossBuild and use rootfsDir only

* Add documentation

* Address feedback

* Rework rhel if

Commit migrated from https://github.com/dotnet/coreclr/commit/a006c44d06d56829a230bbbce17b74b21a0b8842
src/coreclr/build-packages.sh
src/coreclr/build-test.sh
src/coreclr/build.sh
src/coreclr/init-distro-rid.sh [new file with mode: 0644]