Skip to content

Commit

Permalink
[automated] Merge branch 'release/9.0.1xx' => 'main' (#43326)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpopMSFT committed Sep 19, 2024
2 parents f007eb7 + 85c613c commit a4c23bf
Show file tree
Hide file tree
Showing 20 changed files with 173 additions and 32 deletions.
3 changes: 0 additions & 3 deletions build/RunTestsOnHelix.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ set PATH=%DOTNET_ROOT%;%PATH%
set DOTNET_MULTILEVEL_LOOKUP=0
set TestFullMSBuild=%1

set TestExecutionDirectory=%CD%\testExecutionDirectory
mkdir %TestExecutionDirectory%

REM Use powershell to call partical Arcade logic to get full framework msbuild path and assign it
if "%TestFullMSBuild%"=="true" (
FOR /F "tokens=*" %%g IN ('PowerShell -ExecutionPolicy ByPass -File "%HELIX_CORRELATION_PAYLOAD%\t\eng\print-full-msbuild-path.ps1"') do (SET DOTNET_SDK_TEST_MSBUILD_PATH=%%g)
Expand Down
28 changes: 14 additions & 14 deletions eng/ManualVersions.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
Basically: In this file, choose the highest version when resolving merge conflicts.
-->
<PropertyGroup>
<MicrosoftWindowsSDKNETRef10_0_17763PackageVersion>10.0.17763.39</MicrosoftWindowsSDKNETRef10_0_17763PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_18362PackageVersion>10.0.18362.39</MicrosoftWindowsSDKNETRef10_0_18362PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_19041PackageVersion>10.0.19041.39</MicrosoftWindowsSDKNETRef10_0_19041PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_20348PackageVersion>10.0.20348.39</MicrosoftWindowsSDKNETRef10_0_20348PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_22000PackageVersion>10.0.22000.39</MicrosoftWindowsSDKNETRef10_0_22000PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_22621PackageVersion>10.0.22621.39</MicrosoftWindowsSDKNETRef10_0_22621PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_26100PackageVersion>10.0.26100.39</MicrosoftWindowsSDKNETRef10_0_26100PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_17763PackageVersionNet6>10.0.17763.38</MicrosoftWindowsSDKNETRef10_0_17763PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_18362PackageVersionNet6>10.0.18362.38</MicrosoftWindowsSDKNETRef10_0_18362PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_19041PackageVersionNet6>10.0.19041.38</MicrosoftWindowsSDKNETRef10_0_19041PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_20348PackageVersionNet6>10.0.20348.38</MicrosoftWindowsSDKNETRef10_0_20348PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_22000PackageVersionNet6>10.0.22000.38</MicrosoftWindowsSDKNETRef10_0_22000PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_22621PackageVersionNet6>10.0.22621.38</MicrosoftWindowsSDKNETRef10_0_22621PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_26100PackageVersionNet6>10.0.26100.38</MicrosoftWindowsSDKNETRef10_0_26100PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_17763PackageVersion>10.0.17763.45</MicrosoftWindowsSDKNETRef10_0_17763PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_18362PackageVersion>10.0.18362.45</MicrosoftWindowsSDKNETRef10_0_18362PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_19041PackageVersion>10.0.19041.45</MicrosoftWindowsSDKNETRef10_0_19041PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_20348PackageVersion>10.0.20348.45</MicrosoftWindowsSDKNETRef10_0_20348PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_22000PackageVersion>10.0.22000.45</MicrosoftWindowsSDKNETRef10_0_22000PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_22621PackageVersion>10.0.22621.45</MicrosoftWindowsSDKNETRef10_0_22621PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_26100PackageVersion>10.0.26100.45</MicrosoftWindowsSDKNETRef10_0_26100PackageVersion>
<MicrosoftWindowsSDKNETRef10_0_17763PackageVersionNet6>10.0.17763.43</MicrosoftWindowsSDKNETRef10_0_17763PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_18362PackageVersionNet6>10.0.18362.43</MicrosoftWindowsSDKNETRef10_0_18362PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_19041PackageVersionNet6>10.0.19041.43</MicrosoftWindowsSDKNETRef10_0_19041PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_20348PackageVersionNet6>10.0.20348.43</MicrosoftWindowsSDKNETRef10_0_20348PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_22000PackageVersionNet6>10.0.22000.43</MicrosoftWindowsSDKNETRef10_0_22000PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_22621PackageVersionNet6>10.0.22621.43</MicrosoftWindowsSDKNETRef10_0_22621PackageVersionNet6>
<MicrosoftWindowsSDKNETRef10_0_26100PackageVersionNet6>10.0.26100.43</MicrosoftWindowsSDKNETRef10_0_26100PackageVersionNet6>
</PropertyGroup>

</Project>
124 changes: 124 additions & 0 deletions src/Cli/dotnet/Telemetry/DevDeviceIDGetter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Win32;

namespace Microsoft.DotNet.Cli.Telemetry
{
internal static class DeviceIdGetter
{
public static string GetDeviceId()
{
string deviceId = GetCachedDeviceId();

// Check if the device Id is already cached
if (string.IsNullOrEmpty(deviceId))
{
// Generate a new guid
deviceId = Guid.NewGuid().ToString("D").ToLowerInvariant();

// Cache the new device Id
try
{
CacheDeviceId(deviceId);
}
catch
{
// If caching fails, return empty string to avoid sending a non-stored id
deviceId = "";
}
}

return deviceId;
}

private static string GetCachedDeviceId()
{
string deviceId = null;

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Get device Id from Windows registry
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\DeveloperTools"))
{
deviceId = key?.GetValue("deviceid") as string;
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
// Get device Id from Linux cache file
string cacheFilePath;
string xdgCacheHome = Environment.GetEnvironmentVariable("XDG_CACHE_HOME");
if (!string.IsNullOrEmpty(xdgCacheHome))
{
cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceid");
}
else
{
cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid");
}

if (File.Exists(cacheFilePath))
{
deviceId = File.ReadAllText(cacheFilePath);
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// Get device Id from macOS cache file
string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid");
if (File.Exists(cacheFilePath))
{
deviceId = File.ReadAllText(cacheFilePath);
}
}

return deviceId;
}

private static void CacheDeviceId(string deviceId)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// Cache device Id in Windows registry
using (var key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\DeveloperTools"))
{
key.SetValue("deviceid", deviceId);
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
// Cache device Id in Linux cache file
string cacheFilePath;
string xdgCacheHome = Environment.GetEnvironmentVariable("XDG_CACHE_HOME");
if (!string.IsNullOrEmpty(xdgCacheHome))
{
cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceId");
}
else
{
cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid");
}

CreateDirectoryAndWriteToFile(cacheFilePath, deviceId);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
// Cache device Id in macOS cache file
string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid");

CreateDirectoryAndWriteToFile(cacheFilePath, deviceId);
}
}

private static void CreateDirectoryAndWriteToFile(string filePath, string content)
{
string directory = Path.GetDirectoryName(filePath);
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
File.WriteAllText(filePath, content);
}
}
}
5 changes: 5 additions & 0 deletions src/Cli/dotnet/Telemetry/TelemetryCommonProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ public TelemetryCommonProperties(
Func<string> getCurrentDirectory = null,
Func<string, string> hasher = null,
Func<string> getMACAddress = null,
Func<string> getDeviceId = null,
IDockerContainerDetector dockerContainerDetector = null,
IUserLevelCacheWriter userLevelCacheWriter = null,
ICIEnvironmentDetector ciEnvironmentDetector = null)
{
_getCurrentDirectory = getCurrentDirectory ?? Directory.GetCurrentDirectory;
_hasher = hasher ?? Sha256Hasher.Hash;
_getMACAddress = getMACAddress ?? MacAddressGetter.GetMacAddress;
_getDeviceId = getDeviceId ?? DeviceIdGetter.GetDeviceId;
_dockerContainerDetector = dockerContainerDetector ?? new DockerContainerDetectorForTelemetry();
_userLevelCacheWriter = userLevelCacheWriter ?? new UserLevelCacheWriter();
_ciEnvironmentDetector = ciEnvironmentDetector ?? new CIEnvironmentDetectorForTelemetry();
Expand All @@ -31,6 +33,7 @@ public TelemetryCommonProperties(
private Func<string> _getCurrentDirectory;
private Func<string, string> _hasher;
private Func<string> _getMACAddress;
private Func<string> _getDeviceId;
private IUserLevelCacheWriter _userLevelCacheWriter;
private const string OSVersion = "OS Version";
private const string OSPlatform = "OS Platform";
Expand All @@ -40,6 +43,7 @@ public TelemetryCommonProperties(
private const string ProductVersion = "Product Version";
private const string TelemetryProfile = "Telemetry Profile";
private const string CurrentPathHash = "Current Path Hash";
private const string DeviceId = "devdeviceid";
private const string MachineId = "Machine ID";
private const string MachineIdOld = "Machine ID Old";
private const string DockerContainer = "Docker Container";
Expand Down Expand Up @@ -81,6 +85,7 @@ public Dictionary<string, string> GetTelemetryCommonProperties()
CliFolderPathCalculator.DotnetUserProfileFolderPath,
$"{MachineIdCacheKey}.v1.dotnetUserLevelCache"),
GetMachineId)},
{DeviceId, _getDeviceId()},
{KernelVersion, GetKernelVersion()},
{InstallationType, ExternalTelemetryProperties.GetInstallationType()},
{ProductType, ExternalTelemetryProperties.GetProductType()},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ src/runtime/src/mono/mono/mini/mini-windows.c|unknown-license-reference
src/runtime/src/native/external/libunwind/doc/libunwind-ia64.*|generic-exception
src/runtime/src/native/external/zlib-ng/cmake/detect-arch.cmake|unknown-license-reference
src/runtime/src/native/external/zlib-ng/cmake/detect-coverage.cmake|other-permissive,tsl-2020,unknown-license-reference
src/runtime/src/native/external/zlib-ng/cmake/detect-intrinsics.cmake|unknown-license-reference
src/runtime/src/native/external/zlib-ng/cmake/detect-sanitizer.cmake|unknown-license-reference
src/runtime/src/tests/JIT/Performance/CodeQuality/V8/Crypto/Crypto.cs|unknown-license-reference

Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ The following are names of parameters or literal values and should not be transl
<data name="WorkloadNotInstalled" xml:space="preserve">
<value>NETSDK1147: To build this project, the following workloads must be installed: {0}
To install these workloads, run the following command: dotnet workload restore</value>
<comment>{StrBegins="NETSDK1147: "} LOCALIZATION: Do not localize "dotnet workload restore"</comment>
<comment>{StrBegins="NETSDK1147: "}{Locked="dotnet workload restore"}</comment>
</data>
<data name="WindowsSDKVersionConflicts" xml:space="preserve">
<value>NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll. Please update to a newer .NET SDK in order to reference this assembly.</value>
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Tasks/Common/Resources/xlf/Strings.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a4c23bf

Please sign in to comment.