Skip to content

Commit 244f3d4

Browse files
committed
apply patch for s390x and ppc64le
1 parent d8b82f4 commit 244f3d4

12 files changed

Lines changed: 55 additions & 12 deletions

File tree

src/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
<PropertyGroup Condition="'$(BUILD_OS)' == 'Linux' AND '$(PackageRuntime)' == 'linux-arm64'">
4545
<DefineConstants>$(DefineConstants);ARM64</DefineConstants>
4646
</PropertyGroup>
47+
<PropertyGroup Condition="'$(BUILD_OS)' == 'Linux' AND '$(PackageRuntime)' == 'linux-s390x'">
48+
<DefineConstants>$(DefineConstants);S390X</DefineConstants>
49+
</PropertyGroup>
50+
<PropertyGroup Condition="'$(BUILD_OS)' == 'Linux' AND '$(PackageRuntime)' == 'linux-ppc64le'">
51+
<DefineConstants>$(DefineConstants);PPC64LE</DefineConstants>
52+
</PropertyGroup>
4753

4854
<!-- Set TRACE/DEBUG vars -->
4955
<PropertyGroup>

src/Misc/externals.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,11 @@ fi
177177
if [[ "$PACKAGERUNTIME" == "linux-arm" ]]; then
178178
acquireExternalTool "$NODE_URL/v${NODE20_VERSION}/node-v${NODE20_VERSION}-linux-armv7l.tar.gz" node20 fix_nested_dir
179179
fi
180+
181+
if [[ "$PACKAGERUNTIME" == "linux-ppc64le" ]]; then
182+
acquireExternalTool "$NODE_URL/v${NODE20_VERSION}/node-v${NODE20_VERSION}-linux-ppc64le.tar.gz" node20 fix_nested_dir
183+
fi
184+
185+
if [[ "$PACKAGERUNTIME" == "linux-s390x" ]]; then
186+
acquireExternalTool "$NODE_URL/v${NODE20_VERSION}/node-v${NODE20_VERSION}-linux-s390x.tar.gz" node20 fix_nested_dir
187+
fi

src/Runner.Common/Constants.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public enum Architecture
5959
X86,
6060
X64,
6161
Arm,
62-
Arm64
62+
Arm64,
63+
Ppc64le,
64+
S390x
6365
}
6466

6567
public static class Runner
@@ -82,6 +84,10 @@ public static class Runner
8284
public static readonly Architecture PlatformArchitecture = Architecture.Arm;
8385
#elif ARM64
8486
public static readonly Architecture PlatformArchitecture = Architecture.Arm64;
87+
#elif S390X
88+
public static readonly Architecture PlatformArchitecture = Architecture.S390x;
89+
#elif PPC64LE
90+
public static readonly Architecture PlatformArchitecture = Architecture.Ppc64le;
8591
#else
8692
public static readonly Architecture PlatformArchitecture = Architecture.X64;
8793
#endif

src/Runner.Common/Util/VarUtil.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public static string OSArchitecture
5353
return "ARM";
5454
case Constants.Architecture.Arm64:
5555
return "ARM64";
56+
case Constants.Architecture.Ppc64le:
57+
return "PPC64LE";
58+
case Constants.Architecture.S390x:
59+
return "S390X";
5660
default:
5761
throw new NotSupportedException(); // Should never reach here.
5862
}

src/Sdk/Sdk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<RuntimeIdentifiers>win-x64;win-x86;linux-x64;linux-arm64;linux-arm;osx-x64;osx-arm64;win-arm64</RuntimeIdentifiers>
77
<!-- <SelfContained>true</SelfContained> -->
88
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
9-
<NoWarn>NU1701;NU1603;SYSLIB0050;SYSLIB0051</NoWarn>
9+
<NoWarn>NU1701;NU1603;NU1902;CS0672;SYSLIB0050;SYSLIB0051</NoWarn>
1010
<Version>$(Version)</Version>
1111
<DefineConstants>TRACE</DefineConstants>
1212
<LangVersion>8.0</LangVersion>

src/Test/L0/ConstantGenerationL0.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public void BuildConstantGenerateSucceed()
2020
"linux-x64",
2121
"linux-arm",
2222
"linux-arm64",
23+
"linux-s390x",
24+
"linux-ppc64le",
2325
"osx-x64",
2426
"osx-arm64"
2527
};

src/Test/L0/Listener/SelfUpdaterL0.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !(OS_WINDOWS && ARM64)
1+
#if !(OS_WINDOWS && ARM64) && !PPC64LE && !S390X
22
using System;
33
using System.Collections.Generic;
44
using System.IO;
@@ -16,6 +16,7 @@
1616

1717
namespace GitHub.Runner.Common.Tests.Listener
1818
{
19+
#if !S390X && !PPC64LE // Self-update is not currently supported on S390X / PPC64LE
1920
public sealed class SelfUpdaterL0
2021
{
2122
private Mock<IRunnerServer> _runnerServer;
@@ -291,5 +292,6 @@ public async void TestSelfUpdateAsync_ValidateHash()
291292
}
292293
}
293294
}
295+
#endif
294296
}
295297
#endif

src/Test/L0/Listener/SelfUpdaterV2L0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !(OS_WINDOWS && ARM64)
1+
#if !(OS_WINDOWS && ARM64) && !PPC64LE && !S390X
22
using System;
33
using System.Collections.Generic;
44
using System.IO;

src/Test/L0/Worker/StepHostL0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private TestHostContext CreateTestContext([CallerMemberName] String testName = "
3131
return hc;
3232
}
3333

34-
#if OS_LINUX
34+
#if OS_LINUX && !PPC64LE && !S390X
3535
[Fact]
3636
[Trait("Level", "L0")]
3737
[Trait("Category", "Worker")]

src/dev.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash -x
22

33
###############################################################################
44
#
@@ -17,7 +17,7 @@ LAYOUT_DIR="$SCRIPT_DIR/../_layout"
1717
DOWNLOAD_DIR="$SCRIPT_DIR/../_downloads/netcore2x"
1818
PACKAGE_DIR="$SCRIPT_DIR/../_package"
1919
DOTNETSDK_ROOT="$SCRIPT_DIR/../_dotnetsdk"
20-
DOTNETSDK_VERSION="8.0.407"
20+
DOTNETSDK_VERSION="8.0.114"
2121
DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION"
2222
RUNNER_VERSION=$(cat runnerversion)
2323

@@ -54,6 +54,8 @@ elif [[ "$CURRENT_PLATFORM" == 'linux' ]]; then
5454
case $CPU_NAME in
5555
armv7l) RUNTIME_ID="linux-arm";;
5656
aarch64) RUNTIME_ID="linux-arm64";;
57+
ppc64le) RUNTIME_ID="linux-ppc64le";;
58+
s390x) RUNTIME_ID="linux-s390x";;
5759
esac
5860
fi
5961
elif [[ "$CURRENT_PLATFORM" == 'darwin' ]]; then
@@ -80,7 +82,7 @@ if [[ "$CURRENT_PLATFORM" == 'windows' ]]; then
8082
exit 1
8183
fi
8284
elif [[ "$CURRENT_PLATFORM" == 'linux' ]]; then
83-
if [[ ("$RUNTIME_ID" != 'linux-x64') && ("$RUNTIME_ID" != 'linux-x86') && ("$RUNTIME_ID" != 'linux-arm64') && ("$RUNTIME_ID" != 'linux-arm') ]]; then
85+
if [[ ("$RUNTIME_ID" != 'linux-x64') && ("$RUNTIME_ID" != 'linux-x86') && ("$RUNTIME_ID" != 'linux-arm64') && ("$RUNTIME_ID" != 'linux-arm') && ("$RUNTIME_ID" != 'linux-ppc64le') && ("$RUNTIME_ID" != 'linux-s390x') ]]; then
8486
echo "Failed: Can't build $RUNTIME_ID package $CURRENT_PLATFORM" >&2
8587
exit 1
8688
fi
@@ -200,7 +202,7 @@ function package ()
200202
}
201203

202204
# Install .NET SDK
203-
if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet") ]]; then
205+
if [[ "${RUNTIME_ID}" != "linux-ppc64le" && "${RUNTIME_ID}" != "linux-s390x" && ((! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTNETSDK_VERSION}") || (! -e "${DOTNETSDK_INSTALLDIR}/dotnet")) ]]; then
204206

205207
# Download dotnet SDK to ../_dotnetsdk directory
206208
heading "Ensure Dotnet SDK"

0 commit comments

Comments
 (0)