-
Notifications
You must be signed in to change notification settings - Fork 11
148 lines (131 loc) · 8.18 KB
/
build_gcc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Build .NET SDK (GCC)
on: [workflow_dispatch, pull_request]
jobs:
build_with_gcc:
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
env:
PACKAGESDIR: ${{ github.workspace }}/packages
DOWNLOADDIR: ${{ github.workspace }}/downloads
OUTPUTDIR: ${{ github.workspace }}/output
RUNTIME_VERSION: 9.0.0-rtm.24528.9
SDK_VERSION: 9.0.100
ASPNETCORE_VERSION: 9.0.0-rtm.24529.3
ROOTFS_DIR: /
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install prerequisities
run: |
if [ ${{ matrix.os }} == 'ubuntu-22.04' ]; then
sudo sed -i -E 's|^deb ([^ ]+) (.*)$|deb [arch=amd64] \1 \2\ndeb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports/ \2|' /etc/apt/sources.list
else
echo "Types: deb" | sudo tee /etc/apt/sources.list.d/ubuntu.sources
echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Suites: noble noble-updates noble-backports" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Components: main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Architectures: riscv64" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Types: deb" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "URIs: http://archive.ubuntu.com/ubuntu/" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Suites: noble noble-updates noble-backports" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Components: main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Architectures: amd64" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Types: deb" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "URIs: http://security.ubuntu.com/ubuntu/" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Suites: noble-security" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Components: main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
echo "Architectures: amd64" | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
fi
sudo dpkg --add-architecture riscv64 && \
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
ca-certificates \
python3-minimal \
python3-libxml2 \
git \
wget \
curl \
cmake \
locales \
build-essential \
crossbuild-essential-riscv64 \
libkrb5-dev:riscv64 \
libssl-dev:riscv64 \
libicu-dev:riscv64 \
liblttng-ust-dev:riscv64 \
liblttng-ust-dev
sudo locale-gen en_US.UTF-8
python3 -m pip install --upgrade pip
python3 -m pip install gdown
gdown https://drive.google.com/uc?id=1U3JaUqWyRYvlhfA3lVEfwu56em-Gwonl
mkdir xuantie-gcc && cd xuantie-gcc
tar -xf ${{ github.workspace }}/xuantie-gcc-v2.8.0.tar.gz
- name: Clone repositories
run: |
git clone --depth 1 -b v9.0.0 https://github.com/dotnet/runtime
# git clone --depth 1 -b release/9.0 https://github.com/dotnet/aspnetcore --recurse-submodules
# git clone --depth 1 -b v9.0.100 https://github.com/dotnet/sdk
- name: Build runtime
run: |
mkdir -p ${PACKAGESDIR}
mkdir -p ${DOWNLOADDIR}
mkdir -p ${OUTPUTDIR}
cd runtime
git apply ../runtime.patch
sed -i "s|WITH_RVV OFF|WITH_RVV ON|" src/native/external/zlib-ng.cmake
sed -i "s|<PublishTrimmed>true</PublishTrimmed>|<PublishTrimmed Condition=\"\'$\(TargetArchitecture\)\' != \'riscv64\'\">true</PublishTrimmed>|" src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
./build.sh --ci -c Release --cross --arch riscv64 --gcc --cmakeargs -DCLR_CMAKE_USE_SYSTEM_ZLIB=true
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Host.linux-riscv64.*.nupkg ${PACKAGESDIR}
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.linux-riscv64.*.nupkg ${PACKAGESDIR}
mkdir -p ${DOWNLOADDIR}/Runtime/${RUNTIME_VERSION}
cp artifacts/packages/Release/Shipping/dotnet-runtime-*-linux-riscv64.tar.gz ${DOWNLOADDIR}/Runtime/${RUNTIME_VERSION}
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Host.linux-riscv64.*.nupkg ${OUTPUTDIR}
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.linux-riscv64.*.nupkg ${OUTPUTDIR}
cd .. && rm -r runtime
- name: Build aspnetcore
run: |
cd aspnetcore
sed -i "s|ppc64le|riscv64|" src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
sed -i "s|\$(BaseIntermediateOutputPath)\$(DotNetRuntimeArchiveFileName)|${DOWNLOADDIR}/Runtime/${RUNTIME_VERSION}/dotnet-runtime-9.0.0-linux-riscv64.tar.gz|" src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
./eng/build.sh --pack --ci -c Release -arch riscv64
cp artifacts/packages/Release/Shipping/Microsoft.AspNetCore.App.Runtime.linux-riscv64.*.nupkg ${PACKAGESDIR}
mkdir -p ${DOWNLOADDIR}/aspnetcore/Runtime/${ASPNETCORE_VERSION}
cp artifacts/installers/Release/aspnetcore-runtime-*-linux-riscv64.tar.gz ${DOWNLOADDIR}/aspnetcore/Runtime/${ASPNETCORE_VERSION}/aspnetcore-runtime-9.0.0-linux-riscv64.tar.gz
cp artifacts/installers/Release/aspnetcore_base_runtime.version ${DOWNLOADDIR}/aspnetcore/Runtime/${ASPNETCORE_VERSION}
cp artifacts/packages/Release/Shipping/Microsoft.AspNetCore.App.Runtime.linux-riscv64.*.nupkg ${OUTPUTDIR}
cp artifacts/packages/Release/Shipping/Microsoft.DotNet.Web.*.nupkg ${PACKAGESDIR}
cd .. && rm -r aspnetcore
- name: Build SDK
run: |
cd sdk
sed -i "s|linux-arm64|linux-riscv64|" src/Installer/redist-installer/targets/GenerateBundledVersions.targets
sed -i "s|linux-arm64|linux-riscv64|" src/SourceBuild/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj
sed -i s'|ppc64le|riscv64|' Directory.Build.props
sed -i s'|ppc64le|riscv64|' src/SourceBuild/content/Directory.Build.props
sed -i s'|ppc64le|riscv64|' src/Installer/redist-installer/targets/Crossgen.targets
sed -i s"|<clear />|<clear />\n<add key='local' value='${PACKAGESDIR}' />|" NuGet.config
./build.sh --pack --ci -c Release --warnAsError false /p:Architecture=riscv64 /p:Version=${SDK_VERSION} /p:PublicBaseURL=file://${DOWNLOADDIR}/
mkdir -p ${DOWNLOADDIR}/Sdk/${SDK_VERSION}
cp artifacts/packages/Release/NonShipping/dotnet-toolset-internal-*.zip ${DOWNLOADDIR}/Sdk/${SDK_VERSION}/dotnet-toolset-internal-${SDK_VERSION}.zip
cp artifacts/packages/Release/Shipping/Microsoft.DotNet.Common.*.nupkg ${PACKAGESDIR}
cp artifacts/packages/Release/Shipping/dotnet-sdk-*-linux-riscv64.tar.gz ${OUTPUTDIR}/dotnet-sdk-${SDK_VERSION}-linux-riscv64-gcc-${{ matrix.os }}.tar.gz
cp artifacts/packages/Release/Shipping/dotnet-sdk-*-linux-riscv64.tar.gz.sha512 ${OUTPUTDIR}/dotnet-sdk-${SDK_VERSION}-linux-riscv64-gcc-${{ matrix.os }}.tar.gz.sha512
- name: Upload .NET
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/') != true
with:
name: "dotnet-sdk-linux-riscv64-gcc-${{ matrix.os }}"
path: "${{ github.workspace }}/output/dotnet-sdk-*.tar.gz*"
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ github.workspace }}/output/dotnet-sdk-*.tar.gz*