From c314bbab90b4b939032efbaacdaffed41dae0f30 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Wed, 15 Sep 2021 17:26:02 -0700 Subject: [PATCH 1/6] Only set path in x64 mac installer when installing on x64 In other words don't set the path for x64 installer on ARM64 --- .../pkg/sfx/installers/dotnet-host.proj | 1 + .../pkg/sfx/installers/dotnet-hostfxr.proj | 3 ++- .../osx_scripts/host-x64/postinstall | 22 +++++++++++++++++++ .../osx_scripts/hostfxr/postinstall | 16 -------------- 4 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall delete mode 100755 src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall diff --git a/src/installer/pkg/sfx/installers/dotnet-host.proj b/src/installer/pkg/sfx/installers/dotnet-host.proj index 953b0f4f8522f9..bddf8e25d3025f 100644 --- a/src/installer/pkg/sfx/installers/dotnet-host.proj +++ b/src/installer/pkg/sfx/installers/dotnet-host.proj @@ -16,6 +16,7 @@ sharedhost false osx_scripts/host + osx_scripts/host-x64 The .NET Shared Host. $(MSBuildThisFileDirectory)rpm_scripts/host $(RpmScriptsDirectory)/after_install.sh diff --git a/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj b/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj index 2c5fa5d8188867..6809ee7cd5cb50 100644 --- a/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj +++ b/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj @@ -14,7 +14,8 @@ HostFxrSrc true hostfxr - osx_scripts/hostfxr + osx_scripts/host + osx_scripts/host-x64 The .NET HostFxr diff --git a/src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall new file mode 100644 index 00000000000000..bfa5f355784944 --- /dev/null +++ b/src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Licensed to the .NET Foundation under one or more agreements. +# The .NET Foundation licenses this file to you under the MIT license. +# + +PACKAGE=$1 +INSTALL_DESTINATION=$2 + +_machine=`uname -m` + +# A temporary fix for the permissions issue(s) +chmod 755 $INSTALL_DESTINATION/dotnet + +if ["$_machine" == "amd64"] || ["$_machine" == "x86_x64"]; then + # Add the installation directory to the system-wide paths + # But first create the directory if it doesn't exist + mkdir -p /etc/paths.d + echo $INSTALL_DESTINATION | tee /etc/paths.d/dotnet +fi + +exit 0 diff --git a/src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall deleted file mode 100755 index 2d0ceb82786936..00000000000000 --- a/src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# - -PACKAGE=$1 -INSTALL_DESTINATION=$2 - -# A temporary fix for the permissions issue(s) -chmod 755 $INSTALL_DESTINATION/dotnet - -# Add the installation directory to the system-wide paths -echo $INSTALL_DESTINATION | tee /etc/paths.d/dotnet - -exit 0 From 7835b8ae1df924ea53aceeccb1b1db73cb11b32a Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 16 Sep 2021 21:03:14 -0700 Subject: [PATCH 2/6] Remove postinstall script from hostfxr There should be no need for both the host and hostfxr to set the path to dotnet. Since the host installs dotnet, it should be the only package responsible for this. --- src/installer/pkg/sfx/installers/dotnet-hostfxr.proj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj b/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj index 6809ee7cd5cb50..b9eb792a38fade 100644 --- a/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj +++ b/src/installer/pkg/sfx/installers/dotnet-hostfxr.proj @@ -14,8 +14,6 @@ HostFxrSrc true hostfxr - osx_scripts/host - osx_scripts/host-x64 The .NET HostFxr From 6ea690a7958333fea2cb746c4f7241104166e8b6 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 16 Sep 2021 21:19:50 -0700 Subject: [PATCH 3/6] Make postinstall set install_location on mac Also refactor script to use a template so that we don't need to fork the script. --- eng/Version.Details.xml | 4 +++ eng/Versions.props | 3 +- .../pkg/sfx/installers/dotnet-host.proj | 34 +++++++++++++++++-- .../osx_scripts/host-x64/postinstall | 22 ------------ .../installers/osx_scripts/host/postinstall | 20 ++++++++--- 5 files changed, 54 insertions(+), 29 deletions(-) delete mode 100644 src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b3b9219cb2f721..f7bb9052b8faf4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -54,6 +54,10 @@ https://github.com/dotnet/arcade fa4a48044d33222537e6dbd000f8a2adaa7a15c7 + + https://github.com/dotnet/arcade + fa4a48044d33222537e6dbd000f8a2adaa7a15c7 + https://github.com/dotnet/arcade fa4a48044d33222537e6dbd000f8a2adaa7a15c7 diff --git a/eng/Versions.props b/eng/Versions.props index e567d77744766b..1e66bcd4eb880b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -62,7 +62,8 @@ 2.5.1-beta.21459.5 7.0.0-beta.21459.5 7.0.0-beta.21459.5 - 7.0.0-beta.21459.5 + 7.0.0-beta.21459.5 + 7.0.0-beta.21459.5 7.0.0-beta.21459.5 7.0.0-beta.21459.5 7.0.0-beta.21459.5 diff --git a/src/installer/pkg/sfx/installers/dotnet-host.proj b/src/installer/pkg/sfx/installers/dotnet-host.proj index bddf8e25d3025f..9f3d4f3d9ce0db 100644 --- a/src/installer/pkg/sfx/installers/dotnet-host.proj +++ b/src/installer/pkg/sfx/installers/dotnet-host.proj @@ -15,8 +15,7 @@ true sharedhost false - osx_scripts/host - osx_scripts/host-x64 + osx_scripts/host The .NET Shared Host. $(MSBuildThisFileDirectory)rpm_scripts/host $(RpmScriptsDirectory)/after_install.sh @@ -79,4 +78,35 @@ + + + <_MacOSIntermediatesPath>$(IntermediateOutputPath)macos/ + + $(_MacOSIntermediatesPath)scripts + + + <_MacOSScript Include="$(MacOSScriptsTemplateDirectory)/*" Destination="$(MacOSScriptsDirectory)/%(FileName)%(Extension)"/> + + + + + <_UnameMachineRegex>$(InstallerTargetArchitecture) + <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'x64'">x64|x86_x64 + <_MacOSScriptsTemplateProperties>InstallerTargetArchitecture=$(InstallerTargetArchitecture);UnameMachineRegex=$(_UnameMachineRegex) + + + + + + + + + + diff --git a/src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall deleted file mode 100644 index bfa5f355784944..00000000000000 --- a/src/installer/pkg/sfx/installers/osx_scripts/host-x64/postinstall +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# - -PACKAGE=$1 -INSTALL_DESTINATION=$2 - -_machine=`uname -m` - -# A temporary fix for the permissions issue(s) -chmod 755 $INSTALL_DESTINATION/dotnet - -if ["$_machine" == "amd64"] || ["$_machine" == "x86_x64"]; then - # Add the installation directory to the system-wide paths - # But first create the directory if it doesn't exist - mkdir -p /etc/paths.d - echo $INSTALL_DESTINATION | tee /etc/paths.d/dotnet -fi - -exit 0 diff --git a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall index 531cb93fd382fc..bc187cfb974315 100755 --- a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall +++ b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall @@ -10,9 +10,21 @@ INSTALL_DESTINATION=$2 # A temporary fix for the permissions issue(s) chmod 755 $INSTALL_DESTINATION/dotnet -# Add the installation directory to the system-wide paths -# But first create the directory if it doesn't exist -mkdir -p /etc/paths.d -echo $INSTALL_DESTINATION | tee /etc/paths.d/dotnet +if [ -e /etc/dotnet/install_location ]; then + # clear out any entries for this architecture if they exist + sed -i '/^${InstallerTargetArchitecture}=/d' /etc/dotnet/install_location +else + mkdir -p /etc/dotnet +fi + +echo ${InstallerTargetArchitecture}=$INSTALL_DESTINATION | tee -a /etc/dotnet/install_location + +# if we're running on the native architecture +if [["$(uname -m)" =~ "${UnameMachineRegex}"]]; then + # Add the installation directory to the system-wide paths + # But first create the directory if it doesn't exist + mkdir -p /etc/paths.d + echo $INSTALL_DESTINATION | tee /etc/paths.d/dotnet +fi exit 0 From 40ac556e11361202f9498cbb10e63298c6379273 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 16 Sep 2021 21:40:44 -0700 Subject: [PATCH 4/6] fix some syntax errors in script --- .../pkg/sfx/installers/osx_scripts/host/postinstall | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall index bc187cfb974315..eaee94e2798738 100755 --- a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall +++ b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. @@ -12,7 +12,7 @@ chmod 755 $INSTALL_DESTINATION/dotnet if [ -e /etc/dotnet/install_location ]; then # clear out any entries for this architecture if they exist - sed -i '/^${InstallerTargetArchitecture}=/d' /etc/dotnet/install_location + sed -i old '/^${InstallerTargetArchitecture}=/d' /etc/dotnet/install_location else mkdir -p /etc/dotnet fi @@ -20,7 +20,7 @@ fi echo ${InstallerTargetArchitecture}=$INSTALL_DESTINATION | tee -a /etc/dotnet/install_location # if we're running on the native architecture -if [["$(uname -m)" =~ "${UnameMachineRegex}"]]; then +if [[ "$(uname -m)" =~ "${UnameMachineRegex}" ]]; then # Add the installation directory to the system-wide paths # But first create the directory if it doesn't exist mkdir -p /etc/paths.d From b1051fbe812c8be264bb7a3843dd430a4d1b2463 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 16 Sep 2021 21:44:27 -0700 Subject: [PATCH 5/6] Update src/installer/pkg/sfx/installers/dotnet-host.proj Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --- src/installer/pkg/sfx/installers/dotnet-host.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer/pkg/sfx/installers/dotnet-host.proj b/src/installer/pkg/sfx/installers/dotnet-host.proj index 9f3d4f3d9ce0db..69029da4feb0f6 100644 --- a/src/installer/pkg/sfx/installers/dotnet-host.proj +++ b/src/installer/pkg/sfx/installers/dotnet-host.proj @@ -95,7 +95,7 @@ <_UnameMachineRegex>$(InstallerTargetArchitecture) - <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'x64'">x64|x86_x64 + <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'x64'">x64|x86_64 <_MacOSScriptsTemplateProperties>InstallerTargetArchitecture=$(InstallerTargetArchitecture);UnameMachineRegex=$(_UnameMachineRegex) From a4ce61065584348fe9cf8babf4b9d1905cba8f98 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 16 Sep 2021 22:08:23 -0700 Subject: [PATCH 6/6] Refine uname regular expressions --- src/installer/pkg/sfx/installers/dotnet-host.proj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/installer/pkg/sfx/installers/dotnet-host.proj b/src/installer/pkg/sfx/installers/dotnet-host.proj index 69029da4feb0f6..aba056f06d17cb 100644 --- a/src/installer/pkg/sfx/installers/dotnet-host.proj +++ b/src/installer/pkg/sfx/installers/dotnet-host.proj @@ -95,7 +95,8 @@ <_UnameMachineRegex>$(InstallerTargetArchitecture) - <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'x64'">x64|x86_64 + <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'arm64'">arm64|aarch64 + <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'x64'">amd64|x86_64 <_MacOSScriptsTemplateProperties>InstallerTargetArchitecture=$(InstallerTargetArchitecture);UnameMachineRegex=$(_UnameMachineRegex)