Skip to content

Commit ae16dff

Browse files
committed
arm hacks
1 parent b9a9719 commit ae16dff

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

DotnetCLIVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.300
1+
3.0.100-preview7-012821

init-tools.sh

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -138,29 +138,6 @@ if [ ! -e "$__DOTNET_PATH" ]; then
138138
__DOTNET_PKG=dotnet-sdk-${__DOTNET_TOOLS_VERSION}-$__PKG_RID-$__PKG_ARCH
139139
__DOTNET3_PKG=dotnet-sdk-${__DOTNET3_TOOLS_VERSION}-$__PKG_RID-$__PKG_ARCH
140140
fi
141-
mkdir -p "$__DOTNET_PATH"
142-
143-
echo "Installing dotnet cli..."
144-
__DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.tar.gz"
145-
146-
install_dotnet_cli() {
147-
if [[ -z "${DotNetBootstrapCliTarPath-}" ]]; then
148-
echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'"
149-
rm -rf -- "$__DOTNET_PATH/*"
150-
# curl has HTTPS CA trust-issues less often than wget, so lets try that first.
151-
if command -v curl > /dev/null; then
152-
curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
153-
else
154-
wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
155-
fi
156-
else
157-
echo "Copying '$DotNetBootstrapCliTarPath' to '$__DOTNET_PATH/dotnet.tar'"
158-
cp $DotNetBootstrapCliTarPath $__DOTNET_PATH/dotnet.tar
159-
fi
160-
cd "$__DOTNET_PATH"
161-
tar -xf "$__DOTNET_PATH/dotnet.tar"
162-
}
163-
execute_with_retry install_dotnet_cli >> "$__init_tools_log" 2>&1
164141

165142
mkdir -p "$__DOTNET3_PATH"
166143

@@ -186,6 +163,13 @@ if [ ! -e "$__DOTNET_PATH" ]; then
186163
}
187164
execute_with_retry install_dotnet3_cli >> "$__init_tools_log" 2>&1
188165

166+
echo "Using dotnet 3.0 cli as dotnet cli..."
167+
# Use dotnet3 sdk
168+
ln -s "$__DOTNET3_PATH" "$__DOTNET_PATH"
169+
# Roll forward 2.x to 3.x
170+
__DOTNET_RUNTIME_VERSION=$(basename $(ls -d $__DOTNET_PATH/shared/Microsoft.NETCore.App/3.*))
171+
ln -s "$__DOTNET_PATH/shared/Microsoft.NETCore.App/$__DOTNET_RUNTIME_VERSION" "$__DOTNET_PATH/shared/Microsoft.NETCore.App/2.2.0"
172+
189173
cd "$__scriptpath"
190174
fi
191175

@@ -214,6 +198,9 @@ if [ -n "${DotNetBootstrapCliTarPath-}" ]; then
214198
fi
215199

216200
echo "Initializing BuildTools..."
201+
echo "Updating crossgen location"
202+
# note: this codegen is broken ('Jit Compiler has wrong version identifier'), but so far that doesn't stop the build.
203+
sed -i 's@__crossgen=$__packagesDir/.*/crossgen@__crossgen=$__packagesDir/runtime.$__packageRid.microsoft.netcore.runtime.coreclr/3.0.0*/tools/crossgen@g' "$__PACKAGES_DIR/microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION/lib/crossgen.sh"
217204
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR $__PACKAGES_DIR" >> "$__init_tools_log"
218205

219206
# Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
@@ -239,6 +226,16 @@ BUILDTOOLS_CROSSGEN_FEED=https://api.nuget.org/v3/index.json "$__scriptpath/Tool
239226
# CoreCLR expects this and has no way to pass in the dotnetcli directory
240227
ln -s $__DOTNET_PATH $__TOOLRUNTIME_DIR/.dotnet
241228

229+
echo "Adding libgit2sharp arm64 support"
230+
# Take debian-arm64 (OpenSSL 1.1 compatible) .so file from NuGet.org package and put in in the runtime folder (where no-one will remove it).
231+
__LIBGIT2SHARP_BINARIES_SOURCE_BUILD_SO_FILENAME=libgit2-572e4d8.so
232+
__LIBGIT2SHARP_BINARIES_NUGET_VERSION=2.0.289
233+
__LIBGIT2SHARP_BINARIES_URL=https://www.nuget.org/api/v2/package/LibGit2Sharp.NativeBinaries/$__LIBGIT2SHARP_BINARIES_NUGET_VERSION
234+
curl --retry 10 -sSL --create-dirs -o $__PACKAGES_DIR/libgit2sharp.nativebinaries.$__LIBGIT2SHARP_BINARIES_NUGET_VERSION.zip ${__LIBGIT2SHARP_BINARIES_URL}
235+
mkdir -p $__PACKAGES_DIR/libgit2sharp.nativebinaries/$__LIBGIT2SHARP_BINARIES_NUGET_VERSION
236+
unzip $__PACKAGES_DIR/libgit2sharp.nativebinaries.$__LIBGIT2SHARP_BINARIES_NUGET_VERSION.zip -d $__PACKAGES_DIR/libgit2sharp.nativebinaries/$__LIBGIT2SHARP_BINARIES_NUGET_VERSION
237+
cp $__PACKAGES_DIR/libgit2sharp.nativebinaries/$__LIBGIT2SHARP_BINARIES_NUGET_VERSION/runtimes/debian-arm64/native/*.so $__DOTNET_PATH/shared/Microsoft.NETCore.App/$__DOTNET_RUNTIME_VERSION/$__LIBGIT2SHARP_BINARIES_SOURCE_BUILD_SO_FILENAME
238+
242239
mkdir -p "$(dirname "$__BUILD_TOOLS_SEMAPHORE")" && touch "$__BUILD_TOOLS_SEMAPHORE"
243240
mkdir -p "$(dirname "$__BUILD_TOOLS_ARCADE_SEMAPHORE")" && touch "$__BUILD_TOOLS_ARCADE_SEMAPHORE"
244241

0 commit comments

Comments
 (0)