Skip to content

Commit c4b3ff4

Browse files
author
Jason Zhai
committed
update
1 parent 51d5de3 commit c4b3ff4

File tree

4 files changed

+27
-56
lines changed

4 files changed

+27
-56
lines changed

build/RunTestsOnHelix.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ install_dependencies() {
77
echo "Detected OS: $ID $VERSION_ID"
88
case "$ID" in
99
centos)
10-
sudo dnf install -y epel-release || echo "Warning: Failed to install epel-release"
1110
sudo dnf config-manager --set-enabled crb || echo "Warning: Failed to enable CRB repository"
1211
sudo dnf install -y zlib-devel libunwind || echo "Warning: Failed to install zlib-devel or libunwind"
1312
;;
1413
fedora)
15-
sudo dnf install -y zlib-devel clang || echo "Warning: Failed to install clang"
14+
sudo dnf install -y zlib-devel clang libicu || echo "Warning: Failed to install clang"
1615
;;
1716
alpine)
1817
sudo apk add --no-cache zlib-dev musl-dev clang || echo "Warning: Failed to install clang"

eng/pipelines/templates/jobs/sdk-job-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ parameters:
5353
helixTargetContainer: $(helixTargetContainerPrefix)alpine-3.18-helix-amd64
5454
runtimeIdentifier: linux-musl-x64
5555
# Use HostOSName when running on alpine.
56-
osProperties: /p:HostOSName=linux-musl
56+
osProperties: /p:HostOSName=linux-musl /p:UseCrossgen=false
5757
# SBOM generation is not supported for alpine.
5858
enableSbom: false
5959
runTests: true

test/Microsoft.NET.TestFramework/EnvironmentInfo.cs

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -101,70 +101,32 @@ public static bool SupportsTargetFramework(string targetFramework)
101101
return false;
102102
}
103103
}
104-
else if (osId.Equals("debian", StringComparison.OrdinalIgnoreCase))
104+
else if (osId.Equals("centos", StringComparison.OrdinalIgnoreCase))
105105
{
106106
if (nugetFramework.Version < new Version(2, 0, 0, 0))
107107
{
108108
return false;
109109
}
110110
}
111-
else if (Version.TryParse(versionString, out Version? osVersion))
111+
else if (osId.Equals("debian", StringComparison.OrdinalIgnoreCase))
112112
{
113-
if (osId.Equals("fedora", StringComparison.OrdinalIgnoreCase))
113+
if (nugetFramework.Version < new Version(2, 0, 0, 0))
114114
{
115-
if (osVersion.Major <= 27)
116-
{
117-
if (nugetFramework.Version < new Version(2, 1, 0, 0))
118-
{
119-
return true;
120-
}
121-
else
122-
{
123-
return false;
124-
}
125-
}
126-
else if (osVersion.Major == 28)
127-
{
128-
if (nugetFramework.Version < new Version(2, 1, 0, 0))
129-
{
130-
return false;
131-
}
132-
else
133-
{
134-
return true;
135-
}
136-
}
137-
else if (osVersion.Major >= 29)
138-
{
139-
if (nugetFramework.Version < new Version(2, 2, 0, 0))
140-
{
141-
return false;
142-
}
143-
else
144-
{
145-
return true;
146-
}
147-
}
115+
return false;
148116
}
149-
else if (osId.Equals("rhel", StringComparison.OrdinalIgnoreCase))
117+
}
118+
else if (osId.Equals("fedora", StringComparison.OrdinalIgnoreCase))
119+
{
120+
if (nugetFramework.Version < new Version(2, 2, 0, 0))
150121
{
151-
if (osVersion.Major == 6)
152-
{
153-
if (nugetFramework.Version < new Version(2, 0, 0, 0))
154-
{
155-
return false;
156-
}
157-
}
122+
return false;
158123
}
159-
else if (osId.Equals("ubuntu", StringComparison.OrdinalIgnoreCase))
124+
}
125+
else if (osId.Equals("ubuntu", StringComparison.OrdinalIgnoreCase))
126+
{
127+
if (nugetFramework.Version < new Version(2, 0, 0, 0))
160128
{
161-
if (osVersion > new Version(16, 04))
162-
{
163-
if (nugetFramework.Version < new Version(2, 0, 0, 0))
164-
{
165-
return false;
166-
}
167-
}
129+
return false;
168130
}
169131
}
170132
}

test/dotnet.Tests/CommandTests/Workload/Restore/GivenDotnetWorkloadRestore.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ public void ProjectsThatDoNotSupportWorkloadsAndAreTransitivelyReferencedDoNotBr
6060

6161
private bool IsRunningInContainer()
6262
{
63-
return File.Exists("/.dockerenv") && (RuntimeInformation.OSDescription.Contains("Ubuntu") || RuntimeInformation.OSDescription.Contains("Debian"));
63+
if (!File.Exists("/.dockerenv"))
64+
{
65+
return false;
66+
}
67+
68+
string osDescription = RuntimeInformation.OSDescription.ToLowerInvariant();
69+
return osDescription.Contains("alpine") ||
70+
osDescription.Contains("centos") ||
71+
osDescription.Contains("debian") ||
72+
osDescription.Contains("fedora") ||
73+
osDescription.Contains("ubuntu");
6474
}
6575
}

0 commit comments

Comments
 (0)