Skip to content

Commit

Permalink
Rollback changes and switch to HabitatInfo.ProcessRuntimeIdString.
Browse files Browse the repository at this point in the history
  • Loading branch information
ww898 committed May 17, 2024
1 parent 06a35c8 commit 21e52fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
11 changes: 2 additions & 9 deletions JetBrains.Profiler.SelfApi/src/Impl/ConsoleProfiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,11 @@ public ConsoleProfiler(string executable, string arguments, string messageServic
_presentableName = presentableName;
_isApiReady = isApiReady;

// Note(ww898): Process architecture is inherited by default in macOS ARM64. Here we turn off this behavior!!!
var isX64ProcessUnderMacOsArm64 = HabitatInfo.Platform == JetPlatform.MacOsX &&
HabitatInfo.OSArchitecture == JetArchitecture.Arm64 &&
HabitatInfo.ProcessArchitecture == JetArchitecture.X64;
var effectiveExecutable = isX64ProcessUnderMacOsArm64 ? "/usr/bin/arch" : executable;
var effectiveArguments = isX64ProcessUnderMacOsArm64 ? $"-arm64 \"${executable}\" ${arguments}" : arguments;

var commandRegex = BuildCommandRegex("([a-zA-Z-]*)", "(.*)");
var si = new ProcessStartInfo
{
FileName = effectiveExecutable,
Arguments = effectiveArguments,
FileName = executable,
Arguments = arguments,
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardInput = true,
Expand Down
3 changes: 2 additions & 1 deletion JetBrains.Profiler.SelfApi/src/Impl/PrerequisiteBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ private async Task DoDownloadAsync(
Trace.Info("Prerequisite.Download: targetPath = `{0}`", downloadTo);
Directory.CreateDirectory(downloadTo);

var nupkgName = GetPackageName() + "." + HabitatInfo.OSRuntimeIdString;
// Note(ww898): Process architecture is inherited by default in macOS ARM64. So use only process architecture!
var nupkgName = GetPackageName() + "." + HabitatInfo.ProcessRuntimeIdString;
string nupkgFolder, nupkgPath, readyMarker;

var downloadProgress = new SubProgress(progress, 0, downloadWeight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Supported frameworks:
<PackageProjectUrl>https://github.com/JetBrains/profiler-self-api/blob/master/README.md</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>jetbrains profiler profiling memory performance net dotnet netcore dotnetcore netstandard windows uwp macos mac linux musl glibc x86 x64 arm64 x86-64 x86_64 aarch64</PackageTags>
<Version>2.5.5-preview1</Version>
<Version>2.5.5-preview2</Version>
</PropertyGroup>
<ItemGroup>
<None Include="../../icon.png" Pack="true" Visible="false" PackagePath="" />
Expand Down

0 comments on commit 21e52fb

Please sign in to comment.