Skip to content

Commit fecfde4

Browse files
committed
C#: Specifically download .NET for Arm architecture.
1 parent b11123a commit fecfde4

File tree

1 file changed

+19
-9
lines changed
  • csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching

1 file changed

+19
-9
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ BuildScript GetInstall(string pwsh) =>
254254
else
255255
{
256256
var dotnetInstallPath = actions.PathCombine(tempWorkingDirectory, ".dotnet", "dotnet-install.sh");
257-
258257
var downloadDotNetInstallSh = BuildScript.DownloadFile(
259258
"https://dot.net/v1/dotnet-install.sh",
260259
dotnetInstallPath,
@@ -269,14 +268,25 @@ BuildScript GetInstall(string pwsh) =>
269268
prelude = downloadDotNetInstallSh & chmod.Script;
270269
postlude = shouldCleanUp ? BuildScript.DeleteFile(dotnetInstallPath) : BuildScript.Success;
271270

272-
getInstall = version => new CommandBuilder(actions).
273-
RunCommand(dotnetInstallPath).
274-
Argument("--channel").
275-
Argument("release").
276-
Argument("--version").
277-
Argument(version).
278-
Argument("--install-dir").
279-
Argument(path).Script;
271+
getInstall = version =>
272+
{
273+
var cb = new CommandBuilder(actions).
274+
RunCommand(dotnetInstallPath).
275+
Argument("--channel").
276+
Argument("release").
277+
Argument("--version").
278+
Argument(version);
279+
280+
// Request ARM64 architecture on Apple Silicon machines
281+
if (actions.IsRunningOnAppleSilicon())
282+
{
283+
cb.Argument("--architecture").
284+
Argument("arm64");
285+
}
286+
287+
return cb.Argument("--install-dir").
288+
Argument(path).Script;
289+
};
280290
}
281291

282292
var dotnetInfo = new CommandBuilder(actions).

0 commit comments

Comments
 (0)