Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1655a06

Browse files
authored
Merge pull request #20847 from dotnet-maestro-bot/merge/release/2.1-to-release/2.2
[automated] Merge branch 'release/2.1' => 'release/2.2'
2 parents e887df8 + 4a4f528 commit 1655a06

File tree

16 files changed

+191
-88
lines changed

16 files changed

+191
-88
lines changed

BuildToolsVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.0-preview1-03131-04
1+
2.2.0-preview1-03131-04

cross/armel/tizen-fetch.sh

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ ! -d $TMPDIR ]; then
5151
mkdir -p $TMPDIR
5252
fi
5353

54-
TIZEN_URL=http://download.tizen.org/releases/daily/tizen
54+
TIZEN_URL=http://download.tizen.org/releases/milestone/tizen
5555
BUILD_XML=build.xml
5656
REPOMD_XML=repomd.xml
5757
PRIMARY_XML=primary.xml
@@ -154,23 +154,18 @@ fetch_tizen_pkgs()
154154
done
155155
}
156156

157-
Inform "Initialize arm 4.0-base"
158-
fetch_tizen_pkgs_init arm 4.0-base
157+
Inform "Initialize arm base"
158+
fetch_tizen_pkgs_init standard base
159159
Inform "fetch common packages"
160-
fetch_tizen_pkgs armv7l gcc glibc glibc-devel
160+
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel
161161
fetch_tizen_pkgs noarch linux-glibc-devel
162162
Inform "fetch coreclr packages"
163-
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel
163+
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
164164
Inform "fetch corefx packages"
165-
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel
165+
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel
166166

167-
Inform "Initialize standard 4.0-unified"
168-
fetch_tizen_pkgs_init standard 4.0-unified
169-
Inform "fetch common packages"
170-
fetch_tizen_pkgs armv7l libicu-devel
171-
Inform "fetch coreclr packages"
172-
fetch_tizen_pkgs armv7l tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
167+
Inform "Initialize standard unified"
168+
fetch_tizen_pkgs_init standard unified
173169
Inform "fetch corefx packages"
174-
fetch_tizen_pkgs armv7l gssdp gssdp-devel krb5 krb5-devel libcurl libcurl-devel
175-
170+
fetch_tizen_pkgs armv7l gssdp gssdp-devel
176171

cross/armel/tizen/tizen-dotnet.ks

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ rootpw tizen
88
desktop --autologinuser=root
99
user --name root --groups audio,video --password 'tizen'
1010

11-
repo --name=standard --baseurl=http://download.tizen.org/releases/daily/tizen/4.0-unified/latest/repos/standard/packages/ --ssl_verify=no
12-
repo --name=base --baseurl=http://download.tizen.org/releases/daily/tizen/4.0-base/latest/repos/arm/packages/ --ssl_verify=no
11+
repo --name=standard --baseurl=http://download.tizen.org/releases/milestone/tizen/unified/latest/repos/standard/packages/ --ssl_verify=no
12+
repo --name=base --baseurl=http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/ --ssl_verify=no
1313

1414
%packages
1515
tar

netci.groovy

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ class Constants {
217217
'Checked'
218218
]
219219
],
220+
'Tizen': [
221+
'armem': [
222+
'Checked'
223+
]
224+
],
220225
]
221226

222227
// A set of scenarios that are valid for arm/arm64/armlb tests run on hardware. This is a map from valid scenario name
@@ -999,7 +1004,7 @@ def static getDockerImageName(def architecture, def os, def isBuild) {
9991004
return "microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180404203310"
10001005
}
10011006
else if (os == 'Tizen') {
1002-
return "hqueue/dotnetcore:ubuntu1404_cross_prereqs_v4-tizen_rootfs"
1007+
return "tizendotnet/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180426002255-tizen-rootfs-5.0m1"
10031008
}
10041009
}
10051010
else if (architecture == 'arm') {
@@ -1737,15 +1742,21 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
17371742
case 'Ubuntu16.04':
17381743
assert scenario != 'innerloop'
17391744
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
1740-
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1745+
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
17411746
break
17421747

17431748
case 'Tizen':
17441749
architecture = 'armel'
17451750

1746-
assert scenario != 'innerloop'
1747-
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
1748-
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1751+
if (scenario == 'innerloop') {
1752+
if (configuration == 'Checked') {
1753+
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build and Test")
1754+
}
1755+
}
1756+
else {
1757+
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
1758+
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1759+
}
17491760
break
17501761
}
17511762

@@ -1808,7 +1819,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
18081819
// Only Checked is an innerloop trigger.
18091820
if (configuration == 'Checked')
18101821
{
1811-
Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1822+
Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
18121823
}
18131824
break
18141825
case 'normal':
@@ -1859,7 +1870,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
18591870
switch (scenario) {
18601871
case 'innerloop':
18611872
if (configuration == 'Debug' && !isFlowJob) {
1862-
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build")
1873+
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build", triggerString)
18631874
}
18641875

18651876
break
@@ -1887,7 +1898,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
18871898
switch (scenario) {
18881899
case 'innerloop':
18891900
if (configuration == 'Checked') {
1890-
Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1901+
Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
18911902
}
18921903

18931904
break

src/corefx/System.Globalization.Native/icushim.cpp

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ FOR_ALL_ICU_FUNCTIONS
1919
static void* libicuuc = nullptr;
2020
static void* libicui18n = nullptr;
2121

22-
// .x.x.x, considering the max number of decimal digits for each component
23-
static const int MaxICUVersionStringLength = 33;
22+
#define VERSION_PREFIX_NONE ""
23+
#define VERSION_PREFIX_SUSE "suse"
24+
25+
// .[suse]x.x.x, considering the max number of decimal digits for each component
26+
static const int MaxICUVersionStringLength = sizeof(VERSION_PREFIX_SUSE) + 33;
2427

2528
#ifdef __APPLE__
2629

27-
bool FindICULibs(char* symbolName, char* symbolVersion)
30+
bool FindICULibs(const char* versionPrefix, char* symbolName, char* symbolVersion)
2831
{
2932
#ifndef OSX_ICU_LIBRARY_PATH
3033
static_assert(false, "The ICU Library path is not defined");
@@ -63,11 +66,11 @@ static const int MaxSubICUVersion = 5;
6366
// 1. Only majorVer is not equal to -1 => result is baseFileName.majorver
6467
// 2. Only majorVer and minorVer are not equal to -1 => result is baseFileName.majorver.minorVer
6568
// 3. All components are not equal to -1 => result is baseFileName.majorver.minorVer.subver
66-
void GetVersionedLibFileName(const char* baseFileName, int majorVer, int minorVer, int subVer, char* result)
69+
void GetVersionedLibFileName(const char* baseFileName, int majorVer, int minorVer, int subVer, const char* versionPrefix, char* result)
6770
{
6871
assert(majorVer != -1);
6972

70-
int nameLen = sprintf(result, "%s.%d", baseFileName, majorVer);
73+
int nameLen = sprintf(result, "%s.%s%d", baseFileName, versionPrefix, majorVer);
7174

7275
if (minorVer != -1)
7376
{
@@ -110,16 +113,16 @@ bool FindSymbolVersion(int majorVer, int minorVer, int subVer, char* symbolName,
110113
}
111114

112115
// Try to open the necessary ICU libraries
113-
bool OpenICULibraries(int majorVer, int minorVer, int subVer, char* symbolName, char* symbolVersion)
116+
bool OpenICULibraries(int majorVer, int minorVer, int subVer, const char* versionPrefix, char* symbolName, char* symbolVersion)
114117
{
115118
char libicuucName[64];
116119
char libicui18nName[64];
117120

118121
static_assert(sizeof("libicuuc.so") + MaxICUVersionStringLength <= sizeof(libicuucName), "The libicuucName is too small");
119-
GetVersionedLibFileName("libicuuc.so", majorVer, minorVer, subVer, libicuucName);
122+
GetVersionedLibFileName("libicuuc.so", majorVer, minorVer, subVer, versionPrefix, libicuucName);
120123

121124
static_assert(sizeof("libicui18n.so") + MaxICUVersionStringLength <= sizeof(libicui18nName), "The libicui18nName is too small");
122-
GetVersionedLibFileName("libicui18n.so", majorVer, minorVer, subVer, libicui18nName);
125+
GetVersionedLibFileName("libicui18n.so", majorVer, minorVer, subVer, versionPrefix, libicui18nName);
123126

124127
libicuuc = dlopen(libicuucName, RTLD_LAZY);
125128
if (libicuuc != nullptr)
@@ -142,7 +145,7 @@ bool OpenICULibraries(int majorVer, int minorVer, int subVer, char* symbolName,
142145
// environment variable.
143146
// The format of the string in this variable is majorVer[.minorVer[.subVer]] (the brackets
144147
// indicate optional parts).
145-
bool FindLibUsingOverride(char* symbolName, char* symbolVersion)
148+
bool FindLibUsingOverride(const char* versionPrefix, char* symbolName, char* symbolVersion)
146149
{
147150
char* versionOverride = getenv("CLR_ICU_VERSION_OVERRIDE");
148151
if (versionOverride != nullptr)
@@ -154,7 +157,7 @@ bool FindLibUsingOverride(char* symbolName, char* symbolVersion)
154157
int matches = sscanf(versionOverride, "%d.%d.%d", &first, &second, &third);
155158
if (matches > 0)
156159
{
157-
if (OpenICULibraries(first, second, third, symbolName, symbolVersion))
160+
if (OpenICULibraries(first, second, third, versionPrefix, symbolName, symbolVersion))
158161
{
159162
return true;
160163
}
@@ -165,21 +168,21 @@ bool FindLibUsingOverride(char* symbolName, char* symbolVersion)
165168
}
166169

167170
// Search for library files with names including the major version.
168-
bool FindLibWithMajorVersion(char* symbolName, char* symbolVersion)
171+
bool FindLibWithMajorVersion(const char* versionPrefix, char* symbolName, char* symbolVersion)
169172
{
170173
// ICU packaging documentation (http://userguide.icu-project.org/packaging)
171174
// describes applications link against the major (e.g. libicuuc.so.54).
172175

173176
// Select the version of ICU present at build time.
174-
if (OpenICULibraries(MinICUVersion, -1, -1, symbolName, symbolVersion))
177+
if (OpenICULibraries(MinICUVersion, -1, -1, versionPrefix, symbolName, symbolVersion))
175178
{
176179
return true;
177180
}
178181

179182
// Select the highest supported version of ICU present on the local machine
180183
for (int i = MaxICUVersion; i > MinICUVersion; i--)
181184
{
182-
if (OpenICULibraries(i, -1, -1, symbolName, symbolVersion))
185+
if (OpenICULibraries(i, -1, -1, versionPrefix, symbolName, symbolVersion))
183186
{
184187
return true;
185188
}
@@ -190,13 +193,13 @@ bool FindLibWithMajorVersion(char* symbolName, char* symbolVersion)
190193

191194
// Select the highest supported version of ICU present on the local machine
192195
// Search for library files with names including the major and minor version.
193-
bool FindLibWithMajorMinorVersion(char* symbolName, char* symbolVersion)
196+
bool FindLibWithMajorMinorVersion(const char* versionPrefix, char* symbolName, char* symbolVersion)
194197
{
195198
for (int i = MaxICUVersion; i >= MinICUVersion; i--)
196199
{
197200
for (int j = MaxMinorICUVersion; j >= MinMinorICUVersion; j--)
198201
{
199-
if (OpenICULibraries(i, j, -1, symbolName, symbolVersion))
202+
if (OpenICULibraries(i, j, -1, versionPrefix, symbolName, symbolVersion))
200203
{
201204
return true;
202205
}
@@ -208,15 +211,15 @@ bool FindLibWithMajorMinorVersion(char* symbolName, char* symbolVersion)
208211

209212
// Select the highest supported version of ICU present on the local machine
210213
// Search for library files with names including the major, minor and sub version.
211-
bool FindLibWithMajorMinorSubVersion(char* symbolName, char* symbolVersion)
214+
bool FindLibWithMajorMinorSubVersion(const char* versionPrefix, char* symbolName, char* symbolVersion)
212215
{
213216
for (int i = MaxICUVersion; i >= MinICUVersion; i--)
214217
{
215218
for (int j = MaxMinorICUVersion; j >= MinMinorICUVersion; j--)
216219
{
217220
for (int k = MaxSubICUVersion; k >= MinSubICUVersion; k--)
218221
{
219-
if (OpenICULibraries(i, j, k, symbolName, symbolVersion))
222+
if (OpenICULibraries(i, j, k, versionPrefix, symbolName, symbolVersion))
220223
{
221224
return true;
222225
}
@@ -227,12 +230,13 @@ bool FindLibWithMajorMinorSubVersion(char* symbolName, char* symbolVersion)
227230
return false;
228231
}
229232

230-
bool FindICULibs(char* symbolName, char* symbolVersion)
233+
234+
bool FindICULibs(const char* versionPrefix, char* symbolName, char* symbolVersion)
231235
{
232-
return FindLibUsingOverride(symbolName, symbolVersion) ||
233-
FindLibWithMajorVersion(symbolName, symbolVersion) ||
234-
FindLibWithMajorMinorVersion(symbolName, symbolVersion) ||
235-
FindLibWithMajorMinorSubVersion(symbolName, symbolVersion);
236+
return FindLibUsingOverride(versionPrefix, symbolName, symbolVersion) ||
237+
FindLibWithMajorVersion(versionPrefix, symbolName, symbolVersion) ||
238+
FindLibWithMajorMinorVersion(versionPrefix, symbolName, symbolVersion) ||
239+
FindLibWithMajorMinorSubVersion(versionPrefix, symbolName, symbolVersion);
236240
}
237241

238242
#endif // __APPLE__
@@ -246,8 +250,15 @@ extern "C" int32_t GlobalizationNative_LoadICU()
246250
char symbolName[128];
247251
char symbolVersion[MaxICUVersionStringLength + 1] = "";
248252

249-
if (!FindICULibs(symbolName, symbolVersion))
250-
return 0;
253+
if (!FindICULibs(VERSION_PREFIX_NONE, symbolName, symbolVersion))
254+
{
255+
#ifndef __APPLE__
256+
if (!FindICULibs(VERSION_PREFIX_SUSE, symbolName, symbolVersion))
257+
#endif
258+
{
259+
return 0;
260+
}
261+
}
251262

252263
// Get pointers to all the ICU functions that are needed
253264
#define PER_FUNCTION_BLOCK(fn, lib) \
@@ -290,4 +301,4 @@ void ShutdownICUShim()
290301
dlclose(libicui18n);
291302
libicui18n = nullptr;
292303
}
293-
}
304+
}

src/gc/unix/cgroup.cpp

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Module Name:
3333
#define PROC_CGROUP_FILENAME "/proc/self/cgroup"
3434
#define PROC_STATM_FILENAME "/proc/self/statm"
3535
#define MEM_LIMIT_FILENAME "/memory.limit_in_bytes"
36+
#define MEM_USAGE_FILENAME "/memory.usage_in_bytes"
3637
#define CFS_QUOTA_FILENAME "/cpu.cfs_quota_us"
3738
#define CFS_PERIOD_FILENAME "/cpu.cfs_period_us"
3839

@@ -74,6 +75,27 @@ class CGroup
7475
return result;
7576
}
7677

78+
bool GetPhysicalMemoryUsage(size_t *val)
79+
{
80+
char *mem_usage_filename = nullptr;
81+
bool result = false;
82+
83+
if (m_memory_cgroup_path == nullptr)
84+
return result;
85+
86+
size_t len = strlen(m_memory_cgroup_path);
87+
len += strlen(MEM_USAGE_FILENAME);
88+
mem_usage_filename = (char*)malloc(len+1);
89+
if (mem_usage_filename == nullptr)
90+
return result;
91+
92+
strcpy(mem_usage_filename, m_memory_cgroup_path);
93+
strcat(mem_usage_filename, MEM_USAGE_FILENAME);
94+
result = ReadMemoryValueFromFile(mem_usage_filename, val);
95+
free(mem_usage_filename);
96+
return result;
97+
}
98+
7799
bool GetCpuLimit(uint32_t *val)
78100
{
79101
long long quota;
@@ -427,19 +449,24 @@ size_t GetRestrictedPhysicalMemoryLimit()
427449
return physical_memory_limit;
428450
}
429451

430-
bool GetWorkingSetSize(size_t* val)
452+
bool GetPhysicalMemoryUsed(size_t* val)
431453
{
432454
bool result = false;
433455
size_t linelen;
434456
char* line = nullptr;
457+
CGroup cgroup;
435458

436459
if (val == nullptr)
437460
return false;
438461

462+
// Linux uses cgroup usage to trigger oom kills.
463+
if (cgroup.GetPhysicalMemoryUsage(val))
464+
return true;
465+
466+
// process resident set size.
439467
FILE* file = fopen(PROC_STATM_FILENAME, "r");
440468
if (file != nullptr && getline(&line, &linelen, file) != -1)
441469
{
442-
443470
char* context = nullptr;
444471
char* strTok = strtok_r(line, " ", &context);
445472
strTok = strtok_r(nullptr, " ", &context);

src/gc/unix/gcenv.unix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static uint8_t* g_helperPage = 0;
5656
static pthread_mutex_t g_flushProcessWriteBuffersMutex;
5757

5858
size_t GetRestrictedPhysicalMemoryLimit();
59-
bool GetWorkingSetSize(size_t* val);
59+
bool GetPhysicalMemoryUsed(size_t* val);
6060
bool GetCpuLimit(uint32_t* val);
6161

6262
static size_t g_RestrictedPhysicalMemoryLimit = 0;
@@ -623,7 +623,7 @@ void GCToOSInterface::GetMemoryStatus(uint32_t* memory_load, uint64_t* available
623623

624624
// Get the physical memory in use - from it, we can get the physical memory available.
625625
// We do this only when we have the total physical memory available.
626-
if (total > 0 && GetWorkingSetSize(&used))
626+
if (total > 0 && GetPhysicalMemoryUsed(&used))
627627
{
628628
available = total > used ? total-used : 0;
629629
load = (uint32_t)(((float)used * 100) / (float)total);

0 commit comments

Comments
 (0)