Skip to content

Commit

Permalink
Updated scripts to cross build without installer as .NET 9 Preview 5 …
Browse files Browse the repository at this point in the history
…SDK is delivered out of installer

Signed-off-by: Alhad Deshpande <[email protected]>
  • Loading branch information
alhad-deshpande authored and iii-i committed Jun 27, 2024
1 parent c6b6d47 commit 45a23fa
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 173 deletions.
70 changes: 12 additions & 58 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
local-downloads/
local-packages/
output/
sdk:
aspnetcore:
needs: roslyn
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -175,51 +175,6 @@ jobs:
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
with:
name: roslyn-${{ matrix.arch }}
- name: Prepare
run: ./dotnet-prepare sdk
- name: Build
run: ARCH=${{ matrix.arch }} ./dotnet-build sdk
- name: Upload the intermediate results
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
with:
name: sdk-${{ matrix.arch }}
path: |
local-downloads/
local-packages/
output/
aspnetcore:
needs: sdk
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: aspnetcore build fails on x64 with:
# EXEC : error : Failed to load assembly 'System.Private.CoreLib'
arch: [ppc64le, s390x]
isV6:
- ${{ startsWith(github.ref, 'refs/tags/v6.') }}
exclude:
- arch: ppc64le
isV6: true
container:
image: ghcr.io/ibm/dotnet-${{ matrix.arch }}-toolchain:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Workaround for the following:
# fatal: detected dubious ownership in repository at '/__w/dotnet-s390x/dotnet-s390x'
options: --user root
steps:
- name: Configure git
run: git config --global user.email [email protected] &&
git config --global user.name "dotnet-s390x bot"
- name: Checkout
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
- name: Fix the repository ownership
run: chown -R "$(id -u):$(id -g)" .
- name: Download the previous stage's artifacts
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
with:
name: sdk-${{ matrix.arch }}
- name: Prepare
run: ./dotnet-prepare aspnetcore
- name: Build
Expand All @@ -232,7 +187,7 @@ jobs:
local-downloads/
local-packages/
output/
installer:
sdk:
needs: aspnetcore
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -266,20 +221,19 @@ jobs:
with:
name: aspnetcore-${{ matrix.arch }}
- name: Prepare
run: ./dotnet-prepare installer
run: ./dotnet-prepare sdk
- name: Build
run: ARCH=${{ matrix.arch }} ./dotnet-build installer
run: ARCH=${{ matrix.arch }} ./dotnet-build sdk
- name: Upload the intermediate results
uses: actions/upload-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
with:
name: installer-${{ matrix.arch }}
name: sdk-${{ matrix.arch }}
path: |
# Use a dummy file to preserve the directory structure.
# See https://github.com/actions/upload-artifact/issues/174 for details.
dotnet-versions
local-downloads/
local-packages/
output/
release:
needs: installer
needs: sdk
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -301,15 +255,15 @@ jobs:
uses: actions/checkout@v1 # Newer versions are not compatible with Ubuntu 18.04
- name: Fix the repository ownership
run: chown -R "$(id -u):$(id -g)" .
- name: Download the ppc64le installer artifacts
- name: Download the ppc64le sdk artifacts
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
with:
name: installer-ppc64le
name: sdk-ppc64le
if: ${{ !startsWith(github.ref, 'refs/tags/v6.') }}
- name: Download the s390x installer artifacts
- name: Download the s390x sdk artifacts
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
with:
name: installer-s390x
name: sdk-s390x
- name: Create a release
run: gh release create --notes "" "${{ github.ref_name }}" output/*
env:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/dotnet.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:

{%- set arches = ['ppc64le', 's390x'] -%}

{%- set projects = ['runtime', 'msbuild', 'roslyn', 'sdk', 'aspnetcore', 'installer'] %}
{%- set projects = ['runtime', 'msbuild', 'roslyn', 'aspnetcore', 'sdk'] %}

{%- set matrix -%}
strategy:
Expand Down Expand Up @@ -79,18 +79,12 @@ jobs:
with:
name: {{ projects[i] }}-{% raw %}${{ matrix.arch }}{% endraw %}
path: |
{%- if projects[i] != 'installer' %}
local-downloads/
local-packages/
{%- else %}
# Use a dummy file to preserve the directory structure.
# See https://github.com/actions/upload-artifact/issues/174 for details.
dotnet-versions
{%- endif %}
output/
{%- endfor %}
release:
needs: installer
needs: sdk
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -100,10 +94,10 @@ jobs:
steps:
{{ checkout_steps }}
{%- for arch in arches %}
- name: Download the {{ arch }} installer artifacts
- name: Download the {{ arch }} sdk artifacts
uses: actions/download-artifact@v3 # Newer versions are not compatible with Ubuntu 18.04
with:
name: installer-{{ arch }}
name: sdk-{{ arch }}
{%- if arch == 'ppc64le' %}
if: {% raw %}${{ !startsWith(github.ref, 'refs/tags/v6.') }}{% endraw %}
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore
Submodule aspnetcore updated 470 files
49 changes: 11 additions & 38 deletions dotnet-build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runtime_flavor=Mono
msbuild_conf=Release
roslyn_conf=Release
aspnetcore_conf=Release
installer_conf=Release
sdk_conf=Release

function build_runtime {
runtime_build_flags=(
Expand Down Expand Up @@ -167,13 +167,21 @@ function build_sdk {
--pack
--configuration "$SDK_CONF"
"/p:Architecture=$ARCH"
"/p:HostRid=linux-x64"
"/p:BundleRuntimePacks=true"
"/p:PublicBaseURL=file://$DOWNLOADDIR/"
"/p:CoreSetupBlobRootUrl=file://$DOWNLOADDIR/"
"/p:DotnetToolsetBlobRootUrl=file://$DOWNLOADDIR/"
)
if [ "$sdk_build_id" != "" ]; then
sdk_build_flags+=(
"/p:ContinuousIntegrationBuild=true"
"/p:OfficialBuildId=$sdk_build_id"
)
fi
if [ "$runtime_flavor" = Mono ]; then
sdk_build_flags+=("/p:DISABLE_CROSSGEN=true")
fi
if [ "$sdk_version_suffix" != "" ]; then
SDK_VERSION=$SDK_VERSION-$sdk_version_suffix
fi
Expand All @@ -184,6 +192,7 @@ function build_sdk {
if [ -z ${SKIP_PACKAGE_SDK+x} ] && [ ! -e .skip-package ]; then
mkdir -p "$DOWNLOADDIR/Sdk/$SDK_VERSION"
cp "artifacts/packages/Release/NonShipping/dotnet-toolset-internal-$SDK_VERSION.zip" "$DOWNLOADDIR/Sdk/$SDK_VERSION"
cp "artifacts/packages/$sdk_conf/Shipping/dotnet-sdk-$SDK_VERSION-linux-$ARCH.tar.gz" "$OUTPUTDIR"
fi
popd
}
Expand Down Expand Up @@ -253,46 +262,10 @@ function build_aspnetcore {
popd
}

function build_installer {
INSTALLER_VERSION=$installer_version_prefix
installer_build_flags=(
--ci
--configuration "$installer_conf"
"/p:HostRid=linux-x64"
"/p:Architecture=$ARCH"
"/p:BundleRuntimePacks=true"
"/p:PublicBaseURL=file://$DOWNLOADDIR/"
"/p:CoreSetupBlobRootUrl=file://$DOWNLOADDIR/"
"/p:DotnetToolsetBlobRootUrl=file://$DOWNLOADDIR/"
)
if [ "$installer_build_id" != "" ]; then
installer_build_flags+=(
"/p:ContinuousIntegrationBuild=true"
"/p:OfficialBuildId=$installer_build_id"
)
fi
if [ "$runtime_flavor" = Mono ]; then
installer_build_flags+=("/p:DISABLE_CROSSGEN=true")
fi
if [ "$installer_version_suffix" != "" ]; then
INSTALLER_VERSION=$INSTALLER_VERSION-$installer_version_suffix
fi
pushd installer
if [ -z ${SKIP_BUILD_INSTALLER+x} ] && [ ! -e .skip-build ]; then
rm -rf artifacts
# Setting HostRid to linux- instead of ubuntu- avoids requiring Debian installer packages
./build.sh "${installer_build_flags[@]}"
fi
if [ -z ${SKIP_PACKAGE_INSTALLER+x} ] && [ ! -e .skip-package ]; then
cp "artifacts/packages/$installer_conf/Shipping/dotnet-sdk-$INSTALLER_VERSION-linux-$ARCH.tar.gz" "$OUTPUTDIR"
fi
popd
}

if [ "$#" -gt 0 ]; then
projects=("$@")
else
projects=(runtime msbuild roslyn sdk aspnetcore installer)
projects=(runtime msbuild roslyn aspnetcore sdk)
fi

for project in "${projects[@]}"; do
Expand Down
40 changes: 20 additions & 20 deletions dotnet-bump
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,41 @@ while [ $# -gt 0 ]; do
shift
done
if [ $# -gt 0 ]; then
installer_version=$1
sdk_version=$1
shift
fi
git submodule update --init --recursive
cd installer
if [[ -z ${installer_version+x} ]]; then
cd sdk
if [[ -z ${sdk_version+x} ]]; then
url=https://aka.ms/dotnet/$platform/daily/productCommit-linux-x64.txt
else
url=https://dotnetbuilds.azureedge.net/public/Sdk/$installer_version/productCommit-linux-x64.txt
url=https://dotnetbuilds.azureedge.net/public/Sdk/$sdk_version/productCommit-linux-x64.txt
fi
manifest=$(curl -L "$url")
# installer:e0c95ad21e5eac311e454c65335008161b3e4763, 7.0.103
# installer_commit="c8d103ed3c46cca9bb78098da723037e2be73bce" installer_version="8.0.100-alpha.1.23061.8"
if [[ "$manifest" =~ installer:([0-9a-f]+),\ ([^[:space:]]+) ]] ||
[[ "$manifest" =~ installer_commit=\"([0-9a-f]+)\"\ installer_version=\"([^\"]+)\" ]]; then
installer_sha=${BASH_REMATCH[1]}
installer_version=${BASH_REMATCH[2]}
if [[ "$manifest" =~ sdk:([0-9a-f]+),\ ([^[:space:]]+) ]] ||
[[ "$manifest" =~ sdk_commit=\"([0-9a-f]+)\"\ sdk_version=\"([^\"]+)\" ]]; then
sdk_sha=${BASH_REMATCH[1]}
sdk_version=${BASH_REMATCH[2]}
git fetch --tags
git checkout --force "$installer_sha"
git checkout --force "$sdk_sha"
else
git fetch --tags
git checkout --force "v$installer_version"
git checkout --force "v$sdk_version"
fi
repos=(
runtime:installer:Microsoft.NETCore.App.Ref:true
msbuild:installer:Microsoft.Build:true
roslyn:installer:Microsoft.Net.Compilers.Toolset:true
sdk:installer:Microsoft.NET.Sdk:true
aspnetcore:installer:Microsoft.AspNetCore.App.Ref:true
aspnetcore_internal:installer:Microsoft.AspNetCore.App.Ref.Internal:false
runtime:sdk:Microsoft.NETCore.App.Ref:true
msbuild:sdk:Microsoft.Build:true
roslyn:sdk:Microsoft.Net.Compilers.Toolset:true
#sdk:sdk:Microsoft.NET.Sdk:true
aspnetcore:sdk:Microsoft.AspNetCore.App.Ref:true
aspnetcore_internal:sdk:Microsoft.AspNetCore.App.Ref.Internal:false
templating:sdk:Microsoft.TemplateEngine.Abstractions:true
)
cd ..
echo_version installer "$installer_version" >dotnet-versions
git add installer
echo_version sdk "$sdk_version" >dotnet-versions
git add sdk
for repo in "${repos[@]}"; do
IFS=: read -r -a path_name <<<"$repo"
xpath="string(/Dependencies/ProductDependencies/Dependency[@Name=\"${path_name[2]}\"]/@Version)"
Expand Down Expand Up @@ -131,5 +131,5 @@ done
} >>dotnet-versions

git add dotnet-versions
git commit --allow-empty --message="v$installer_version" --signoff
git tag "v$installer_version"
git commit --allow-empty --message="v$sdk_version" --signoff
git tag "v$sdk_version"
10 changes: 1 addition & 9 deletions dotnet-prepare
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,10 @@ function prepare_aspnetcore {
popd
}

function prepare_installer {
pushd installer
update_nuget_config
# https://github.com/dotnet/installer/pull/14173
backport "" 5501c7f23811
popd
}

if [ "$#" -gt 0 ]; then
projects=("$@")
else
projects=(runtime msbuild roslyn sdk aspnetcore installer)
projects=(runtime msbuild roslyn sdk aspnetcore)
fi

git submodule update --init --recursive -- "${projects[@]}"
Expand Down
Loading

0 comments on commit 45a23fa

Please sign in to comment.