Skip to content

Commit fbec627

Browse files
amih90Ami Hollander
authored andcommitted
Add preliminary support for linux-arm64 (#3584)
Co-authored-by: Ami Hollander <amhollan@microsoft.com>
1 parent 567c325 commit fbec627

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ sudo apt-get install azure-functions-core-tools-2
206206
Using your preferred tool, unzip the downloaded release. To unzip into an `azure-functions-cli` directory using the `unzip` tool, run this command from the directory containing the downloaded release zip:
207207

208208
```bash
209-
unzip -d azure-functions-cli Azure.Functions.Cli.linux-x64.*.zip
209+
unzip -d azure-functions-cli Azure.Functions.Cli.linux-*.*.zip
210210
```
211211

212212
3. Make the `func` command executable

build/Settings.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ private static string config(string @default = null, [CallerMemberName] string k
4848
"min.win-x86",
4949
"min.win-x64",
5050
"linux-x64",
51+
"linux-arm64",
5152
"osx-x64",
5253
"osx-arm64",
5354
"win-x86",
@@ -60,6 +61,7 @@ private static string config(string @default = null, [CallerMemberName] string k
6061
{ "win-x64", "WINDOWS" },
6162
{ "win-arm64", "WINDOWS"},
6263
{ "linux-x64", "LINUX" },
64+
{ "linux-arm64", "LINUX" },
6365
{ "osx-x64", "OSX" },
6466
{ "osx-arm64", "OSX" },
6567
{ "min.win-x86", "WINDOWS" },
@@ -95,6 +97,7 @@ private static string config(string @default = null, [CallerMemberName] string k
9597
{
9698
"linux",
9799
"linux-x64",
100+
"linux-arm64",
98101
"unix",
99102
"linux-musl-x64"
100103
};
@@ -121,6 +124,7 @@ private static Dictionary<string, string[]> GetPowerShell72Runtimes()
121124
{ "win-x64", _winPowershellRuntimes },
122125
{ "win-arm64", _winPowershellRuntimes },
123126
{ "linux-x64", _linPowershellRuntimes },
127+
{ "linux-arm64", _linPowershellRuntimes },
124128
{ "osx-x64", _osxPowershellRuntimes },
125129
{ "osx-arm64", _osxARMPowershellRuntimes }
126130
};
@@ -135,6 +139,7 @@ private static Dictionary<string, string[]> GetPowerShell74Runtimes()
135139
{ "win-x64", _winPowershellRuntimesNet8 },
136140
{ "win-arm64", _winPowershellRuntimesNet8 },
137141
{ "linux-x64", _linPowershellRuntimes },
142+
{ "linux-arm64", _linPowershellRuntimes },
138143
{ "osx-x64", _osxPowershellRuntimes },
139144
{ "osx-arm64", _osxARMPowershellRuntimes }
140145
};
@@ -152,6 +157,7 @@ private static Dictionary<string, string[]> GetPowerShell74Runtimes()
152157
{ "win-x64", _winPowershellRuntimes },
153158
{ "win-arm64", _winPowershellRuntimes },
154159
{ "linux-x64", _linPowershellRuntimes },
160+
{ "linux-arm64", _linPowershellRuntimes },
155161
{ "osx-x64", _osxPowershellRuntimes },
156162
// NOTE: PowerShell 7.0 does not support arm. First version supporting it is 7.2
157163
// https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.2#supported-versions
@@ -180,15 +186,15 @@ private static Dictionary<string, string[]> GetPowerShell74Runtimes()
180186
public static readonly string OutputDir = Path.Combine(Path.GetFullPath(".."), "artifacts");
181187

182188
public static readonly string SBOMManifestTelemetryDir = Path.Combine(OutputDir, "SBOMManifestTelemetry");
183-
189+
184190
public static string TargetFramework = "net6.0";
185191

186192
public static readonly string NupkgPublishDir = Path.GetFullPath($"../src/Azure.Functions.Cli/bin/Release/{TargetFramework}/publish");
187-
193+
188194
public static readonly string PreSignTestDir = "PreSignTest";
189195

190196
public static readonly string SignTestDir = "SignTest";
191-
197+
192198
public static readonly string DotnetIsolatedItemTemplates = $"https://www.nuget.org/api/v2/package/Microsoft.Azure.Functions.Worker.ItemTemplates/{DotnetIsolatedItemTemplatesVersion}";
193199

194200
public static readonly string DotnetIsolatedProjectTemplates = $"https://www.nuget.org/api/v2/package/Microsoft.Azure.Functions.Worker.ProjectTemplates/{DotnetIsolatedProjectTemplatesVersion}";
@@ -275,7 +281,7 @@ public class SignInfo
275281
"Grpc.AspNetCore.Server.dll",
276282
"Grpc.Core.dll",
277283
"Grpc.Core.Api.dll",
278-
"Grpc.Net.Client.dll",
284+
"Grpc.Net.Client.dll",
279285
"Grpc.Net.ClientFactory.dll",
280286
"Grpc.Net.Common.dll",
281287
"grpc_csharp_ext.x64.dll",

src/Cli/func/Azure.Functions.Cli.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>net8.0</TargetFramework>
44
<OutputType>Exe</OutputType>
55
<AssemblyName>func</AssemblyName>
6-
<RuntimeIdentifiers>win-x64;win-x86;win-arm64;linux-x64;osx-x64;osx-arm64</RuntimeIdentifiers>
6+
<RuntimeIdentifiers>win-x64;win-x86;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
77
<Nullable>disable</Nullable>
88
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
99
</PropertyGroup>

src/Cli/func/npm/lib/install.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ if (os.platform() === 'win32') {
3636
platform = 'osx-x64';
3737
}
3838
} else if (os.platform() === 'linux') {
39-
platform = 'linux-x64';
39+
if (os.arch() === 'arm64') {
40+
platform = 'linux-arm64';
41+
} else {
42+
platform = 'linux-x64';
43+
}
4044
} else {
4145
throw Error('platform ' + os.platform() + ' isn\'t supported');
4246
}

0 commit comments

Comments
 (0)