Skip to content

Commit 8d36bdc

Browse files
Support ARM64 (#587)
* Support ARM64 * Temporarily remove deps * Updating buildpack.toml with new versions 8.0.21, 8.0.22, 9.0.10, 9.0.11, 10.0.0 * Rename function --------- Co-authored-by: paketo-bot <paketobuildpacks@gmail.com>
1 parent b3057e4 commit 8d36bdc

15 files changed

Lines changed: 381 additions & 602 deletions

buildpack.toml

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ api = "0.8"
1212
uri = "https://github.com/paketo-buildpacks/dotnet-core-aspnet-runtime/blob/main/LICENSE"
1313

1414
[metadata]
15-
include-files = ["buildpack.toml", "linux/amd64/bin/build", "linux/amd64/bin/detect", "linux/amd64/bin/run"]
16-
pre-package = "./scripts/build.sh --target linux/amd64"
15+
include-files = ["buildpack.toml", "linux/amd64/bin/build", "linux/amd64/bin/detect", "linux/amd64/bin/run", "linux/arm64/bin/build", "linux/arm64/bin/detect", "linux/arm64/bin/run"]
16+
pre-package = "./scripts/build.sh --target linux/amd64 --target linux/arm64"
1717

1818
[[metadata.dependencies]]
19+
arch = "amd64"
1920
checksum = "sha512:4aa9458d3de7b4ff960adcc4a655e4d7e4e6570e97791919113b8c9a55883964a60241daf3a70c60494cde1a61155d802339ec03b046466eac67298f0acc7289"
2021
cpe = "cpe:2.3:a:microsoft:.net:8.0.21:*:*:*:*:*:*:*"
2122
deprecation_date = "2026-11-10T00:00:00Z"
2223
id = "dotnet-core-aspnet-runtime"
2324
licenses = ["MIT", "MIT-0"]
2425
name = "ASP.NET Core Runtime"
26+
os = "linux"
2527
purl = "pkg:generic/dotnet-core-aspnet-runtime@8.0.21?checksum=4aa9458d3de7b4ff960adcc4a655e4d7e4e6570e97791919113b8c9a55883964a60241daf3a70c60494cde1a61155d802339ec03b046466eac67298f0acc7289&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.21/aspnetcore-runtime-8.0.21-linux-x64.tar.gz"
2628
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.21/aspnetcore-runtime-8.0.21-linux-x64.tar.gz"
2729
source-checksum = "sha512:4aa9458d3de7b4ff960adcc4a655e4d7e4e6570e97791919113b8c9a55883964a60241daf3a70c60494cde1a61155d802339ec03b046466eac67298f0acc7289"
@@ -30,12 +32,30 @@ api = "0.8"
3032
version = "8.0.21"
3133

3234
[[metadata.dependencies]]
35+
arch = "arm64"
36+
checksum = "sha512:db04b085c4ce1d732e55be57efe771b4be4c6bcf9b5359fbf88993b19026d77e7e108a41ab0c447da100306df8dfde90bc9c206cefb1856f7da6b618b6ceda32"
37+
cpe = "cpe:2.3:a:microsoft:.net:8.0.21:*:*:*:*:*:*:*"
38+
deprecation_date = "2026-11-10T00:00:00Z"
39+
id = "dotnet-core-aspnet-runtime"
40+
licenses = ["MIT", "MIT-0"]
41+
name = "ASP.NET Core Runtime"
42+
os = "linux"
43+
purl = "pkg:generic/dotnet-core-aspnet-runtime@8.0.21?checksum=db04b085c4ce1d732e55be57efe771b4be4c6bcf9b5359fbf88993b19026d77e7e108a41ab0c447da100306df8dfde90bc9c206cefb1856f7da6b618b6ceda32&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.21/aspnetcore-runtime-8.0.21-linux-arm64.tar.gz"
44+
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.21/aspnetcore-runtime-8.0.21-linux-arm64.tar.gz"
45+
source-checksum = "sha512:db04b085c4ce1d732e55be57efe771b4be4c6bcf9b5359fbf88993b19026d77e7e108a41ab0c447da100306df8dfde90bc9c206cefb1856f7da6b618b6ceda32"
46+
stacks = ["*"]
47+
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.21/aspnetcore-runtime-8.0.21-linux-arm64.tar.gz"
48+
version = "8.0.21"
49+
50+
[[metadata.dependencies]]
51+
arch = "amd64"
3352
checksum = "sha512:842fb896e6d496875cd6bb6943779ca8a7a9684170d7200b7ab2b53433aa151a9a1800998f9da5582237a690996d8168822e50b8d4be8cf9a512cbe7a2240e88"
3453
cpe = "cpe:2.3:a:microsoft:.net:8.0.22:*:*:*:*:*:*:*"
3554
deprecation_date = "2026-11-10T00:00:00Z"
3655
id = "dotnet-core-aspnet-runtime"
3756
licenses = ["MIT", "MIT-0"]
3857
name = "ASP.NET Core Runtime"
58+
os = "linux"
3959
purl = "pkg:generic/dotnet-core-aspnet-runtime@8.0.22?checksum=842fb896e6d496875cd6bb6943779ca8a7a9684170d7200b7ab2b53433aa151a9a1800998f9da5582237a690996d8168822e50b8d4be8cf9a512cbe7a2240e88&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.22/aspnetcore-runtime-8.0.22-linux-x64.tar.gz"
4060
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.22/aspnetcore-runtime-8.0.22-linux-x64.tar.gz"
4161
source-checksum = "sha512:842fb896e6d496875cd6bb6943779ca8a7a9684170d7200b7ab2b53433aa151a9a1800998f9da5582237a690996d8168822e50b8d4be8cf9a512cbe7a2240e88"
@@ -44,12 +64,30 @@ api = "0.8"
4464
version = "8.0.22"
4565

4666
[[metadata.dependencies]]
67+
arch = "arm64"
68+
checksum = "sha512:538eb7ce62c77f383606906f38f9aa9911339c2ad4ee849c5fb552491c1bc812492395f2975510eb808410263baf06f0771c7caf0b46695251e6c9273111288f"
69+
cpe = "cpe:2.3:a:microsoft:.net:8.0.22:*:*:*:*:*:*:*"
70+
deprecation_date = "2026-11-10T00:00:00Z"
71+
id = "dotnet-core-aspnet-runtime"
72+
licenses = ["MIT", "MIT-0"]
73+
name = "ASP.NET Core Runtime"
74+
os = "linux"
75+
purl = "pkg:generic/dotnet-core-aspnet-runtime@8.0.22?checksum=538eb7ce62c77f383606906f38f9aa9911339c2ad4ee849c5fb552491c1bc812492395f2975510eb808410263baf06f0771c7caf0b46695251e6c9273111288f&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.22/aspnetcore-runtime-8.0.22-linux-arm64.tar.gz"
76+
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.22/aspnetcore-runtime-8.0.22-linux-arm64.tar.gz"
77+
source-checksum = "sha512:538eb7ce62c77f383606906f38f9aa9911339c2ad4ee849c5fb552491c1bc812492395f2975510eb808410263baf06f0771c7caf0b46695251e6c9273111288f"
78+
stacks = ["*"]
79+
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.22/aspnetcore-runtime-8.0.22-linux-arm64.tar.gz"
80+
version = "8.0.22"
81+
82+
[[metadata.dependencies]]
83+
arch = "amd64"
4784
checksum = "sha512:ba1b184f3bc1c7d423186240fa30e4acd0b8392e8c61b7b593b8d12f8accc65dccfcd4120d9b9ec25c3a278df4fbaf324ff2cf1b8d3997a24417eb2abb2d8043"
4885
cpe = "cpe:2.3:a:microsoft:.net:9.0.10:*:*:*:*:*:*:*"
4986
deprecation_date = "2026-11-10T00:00:00Z"
5087
id = "dotnet-core-aspnet-runtime"
5188
licenses = ["MIT", "MIT-0"]
5289
name = "ASP.NET Core Runtime"
90+
os = "linux"
5391
purl = "pkg:generic/dotnet-core-aspnet-runtime@9.0.10?checksum=ba1b184f3bc1c7d423186240fa30e4acd0b8392e8c61b7b593b8d12f8accc65dccfcd4120d9b9ec25c3a278df4fbaf324ff2cf1b8d3997a24417eb2abb2d8043&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.10/aspnetcore-runtime-9.0.10-linux-x64.tar.gz"
5492
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.10/aspnetcore-runtime-9.0.10-linux-x64.tar.gz"
5593
source-checksum = "sha512:ba1b184f3bc1c7d423186240fa30e4acd0b8392e8c61b7b593b8d12f8accc65dccfcd4120d9b9ec25c3a278df4fbaf324ff2cf1b8d3997a24417eb2abb2d8043"
@@ -58,12 +96,30 @@ api = "0.8"
5896
version = "9.0.10"
5997

6098
[[metadata.dependencies]]
99+
arch = "arm64"
100+
checksum = "sha512:ef2696a1b8080312e87af8bf1335971a49a0b7d074b0a6276473e58e5460ecb55d1908413d34d3265c6dd5cfc8c1c60ab04fcb509c940b20e61ea5ae49d04926"
101+
cpe = "cpe:2.3:a:microsoft:.net:9.0.10:*:*:*:*:*:*:*"
102+
deprecation_date = "2026-11-10T00:00:00Z"
103+
id = "dotnet-core-aspnet-runtime"
104+
licenses = ["MIT", "MIT-0"]
105+
name = "ASP.NET Core Runtime"
106+
os = "linux"
107+
purl = "pkg:generic/dotnet-core-aspnet-runtime@9.0.10?checksum=ef2696a1b8080312e87af8bf1335971a49a0b7d074b0a6276473e58e5460ecb55d1908413d34d3265c6dd5cfc8c1c60ab04fcb509c940b20e61ea5ae49d04926&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.10/aspnetcore-runtime-9.0.10-linux-arm64.tar.gz"
108+
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.10/aspnetcore-runtime-9.0.10-linux-arm64.tar.gz"
109+
source-checksum = "sha512:ef2696a1b8080312e87af8bf1335971a49a0b7d074b0a6276473e58e5460ecb55d1908413d34d3265c6dd5cfc8c1c60ab04fcb509c940b20e61ea5ae49d04926"
110+
stacks = ["*"]
111+
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.10/aspnetcore-runtime-9.0.10-linux-arm64.tar.gz"
112+
version = "9.0.10"
113+
114+
[[metadata.dependencies]]
115+
arch = "amd64"
61116
checksum = "sha512:0a3c6a20dd2b00928cd22aca0c99d1ddd36ba93e9909a15097b952b54097e0b817454db7beae482a895d1877c281218fffee0f3f07f6a0cbe521e4c39cda5d4a"
62117
cpe = "cpe:2.3:a:microsoft:.net:9.0.11:*:*:*:*:*:*:*"
63118
deprecation_date = "2026-11-10T00:00:00Z"
64119
id = "dotnet-core-aspnet-runtime"
65120
licenses = ["MIT", "MIT-0"]
66121
name = "ASP.NET Core Runtime"
122+
os = "linux"
67123
purl = "pkg:generic/dotnet-core-aspnet-runtime@9.0.11?checksum=0a3c6a20dd2b00928cd22aca0c99d1ddd36ba93e9909a15097b952b54097e0b817454db7beae482a895d1877c281218fffee0f3f07f6a0cbe521e4c39cda5d4a&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-x64.tar.gz"
68124
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-x64.tar.gz"
69125
source-checksum = "sha512:0a3c6a20dd2b00928cd22aca0c99d1ddd36ba93e9909a15097b952b54097e0b817454db7beae482a895d1877c281218fffee0f3f07f6a0cbe521e4c39cda5d4a"
@@ -72,19 +128,53 @@ api = "0.8"
72128
version = "9.0.11"
73129

74130
[[metadata.dependencies]]
131+
arch = "arm64"
132+
checksum = "sha512:bcf66a56f780b720f663e4f276ebbffeb1f8117523d19fe12c545c53f929ce1036710ba078f3019767ccd19e915dc457d60dad426f926b0be46cef74c01143e8"
133+
cpe = "cpe:2.3:a:microsoft:.net:9.0.11:*:*:*:*:*:*:*"
134+
deprecation_date = "2026-11-10T00:00:00Z"
135+
id = "dotnet-core-aspnet-runtime"
136+
licenses = ["MIT", "MIT-0"]
137+
name = "ASP.NET Core Runtime"
138+
os = "linux"
139+
purl = "pkg:generic/dotnet-core-aspnet-runtime@9.0.11?checksum=bcf66a56f780b720f663e4f276ebbffeb1f8117523d19fe12c545c53f929ce1036710ba078f3019767ccd19e915dc457d60dad426f926b0be46cef74c01143e8&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-arm64.tar.gz"
140+
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-arm64.tar.gz"
141+
source-checksum = "sha512:bcf66a56f780b720f663e4f276ebbffeb1f8117523d19fe12c545c53f929ce1036710ba078f3019767ccd19e915dc457d60dad426f926b0be46cef74c01143e8"
142+
stacks = ["*"]
143+
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-arm64.tar.gz"
144+
version = "9.0.11"
145+
146+
[[metadata.dependencies]]
147+
arch = "amd64"
75148
checksum = "sha512:73314cf4815f551ee6f980273836568c66020fde7e87b7fe27f8224bb6ece5e767bf2a80e42bc5aad383dcb38c823f4b2b25d0fffcbb0fbd73fa82f20e66e8cf"
76149
cpe = "cpe:2.3:a:microsoft:.net:10.0.0:*:*:*:*:*:*:*"
77150
deprecation_date = "2028-11-14T00:00:00Z"
78151
id = "dotnet-core-aspnet-runtime"
79152
licenses = ["MIT", "MIT-0"]
80153
name = "ASP.NET Core Runtime"
154+
os = "linux"
81155
purl = "pkg:generic/dotnet-core-aspnet-runtime@10.0.0?checksum=73314cf4815f551ee6f980273836568c66020fde7e87b7fe27f8224bb6ece5e767bf2a80e42bc5aad383dcb38c823f4b2b25d0fffcbb0fbd73fa82f20e66e8cf&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-x64.tar.gz"
82156
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-x64.tar.gz"
83157
source-checksum = "sha512:73314cf4815f551ee6f980273836568c66020fde7e87b7fe27f8224bb6ece5e767bf2a80e42bc5aad383dcb38c823f4b2b25d0fffcbb0fbd73fa82f20e66e8cf"
84158
stacks = ["*"]
85159
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-x64.tar.gz"
86160
version = "10.0.0"
87161

162+
[[metadata.dependencies]]
163+
arch = "arm64"
164+
checksum = "sha512:0ed022f7a7a2bf0660b2d4cdcb94a5444b9b9ece87f22a60a2029137630fd91385c61a19b1301e81bef363b5b890924d53a7c824e58bd4edd327723aa72c6fb5"
165+
cpe = "cpe:2.3:a:microsoft:.net:10.0.0:*:*:*:*:*:*:*"
166+
deprecation_date = "2028-11-14T00:00:00Z"
167+
id = "dotnet-core-aspnet-runtime"
168+
licenses = ["MIT", "MIT-0"]
169+
name = "ASP.NET Core Runtime"
170+
os = "linux"
171+
purl = "pkg:generic/dotnet-core-aspnet-runtime@10.0.0?checksum=0ed022f7a7a2bf0660b2d4cdcb94a5444b9b9ece87f22a60a2029137630fd91385c61a19b1301e81bef363b5b890924d53a7c824e58bd4edd327723aa72c6fb5&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-arm64.tar.gz"
172+
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-arm64.tar.gz"
173+
source-checksum = "sha512:0ed022f7a7a2bf0660b2d4cdcb94a5444b9b9ece87f22a60a2029137630fd91385c61a19b1301e81bef363b5b890924d53a7c824e58bd4edd327723aa72c6fb5"
174+
stacks = ["*"]
175+
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-arm64.tar.gz"
176+
version = "10.0.0"
177+
88178
[[metadata.dependency-constraints]]
89179
constraint = "8.0.*"
90180
id = "dotnet-core-aspnet-runtime"
@@ -96,13 +186,17 @@ api = "0.8"
96186
patches = 2
97187

98188
[[metadata.dependency-constraints]]
99-
constraint = "~10.0.0-0"
189+
constraint = "10.0.*"
100190
id = "dotnet-core-aspnet-runtime"
101-
patches = 1
191+
patches = 2
102192

103193
[[stacks]]
104194
id = "*"
105195

106196
[[targets]]
107197
arch = "amd64"
108198
os = "linux"
199+
200+
[[targets]]
201+
arch = "arm64"
202+
os = "linux"

dependency/retrieval/components/dependency.go

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,87 @@ import (
77
"time"
88

99
"github.com/Masterminds/semver/v3"
10+
"github.com/paketo-buildpacks/libdependency/retrieve"
11+
"github.com/paketo-buildpacks/libdependency/versionology"
1012
"github.com/paketo-buildpacks/packit/v2/cargo"
1113
)
1214

13-
func ConvertReleaseToDependency(release Release) (cargo.ConfigMetadataDependency, error) {
15+
func GenerateMetadata(version versionology.VersionFetcher, platform retrieve.Platform) ([]versionology.Dependency, error) {
16+
runtimeRelease := version.(RuntimeRelease)
17+
18+
arch := platform.Arch
19+
if platform.Arch == "amd64" {
20+
arch = "x64"
21+
}
22+
rid := fmt.Sprintf("%s-%s", platform.OS, arch)
23+
1424
var archive ReleaseFile
15-
for _, file := range release.Files {
16-
if file.Rid == "linux-x64" && strings.HasSuffix(file.Name, ".tar.gz") {
25+
for _, file := range runtimeRelease.Files {
26+
if file.Rid == rid && strings.HasSuffix(file.Name, ".tar.gz") {
1727
archive = file
1828
break
1929
}
2030
}
2131

2232
if (archive == ReleaseFile{}) {
23-
return cargo.ConfigMetadataDependency{}, fmt.Errorf("could not find release file for linux/x64")
33+
return nil, fmt.Errorf("could not find release file for %s", rid)
2434
}
2535

26-
purl := GeneratePURL("dotnet-core-aspnet-runtime", release.Version, archive.Hash, archive.URL)
27-
2836
// Validate the artifact
2937
response, err := http.Get(archive.URL)
3038
if err != nil {
31-
return cargo.ConfigMetadataDependency{}, err
39+
return nil, err
3240
}
3341
defer response.Body.Close()
3442

3543
vr := cargo.NewValidatedReader(response.Body, fmt.Sprintf("sha512:%s", archive.Hash))
3644
valid, err := vr.Valid()
3745
if err != nil {
38-
return cargo.ConfigMetadataDependency{}, err
46+
return nil, err
3947
}
4048

4149
if !valid {
42-
return cargo.ConfigMetadataDependency{}, fmt.Errorf("the given checksum of the artifact does not match with downloaded artifact")
50+
return nil, fmt.Errorf("the given checksum of the artifact does not match with downloaded artifact")
4351
}
4452

4553
var depDate *time.Time
46-
if release.EOLDate != "" {
47-
t, err := time.ParseInLocation("2006-01-02", release.EOLDate, time.UTC)
54+
if runtimeRelease.EOLDate != "" {
55+
t, err := time.ParseInLocation("2006-01-02", runtimeRelease.EOLDate, time.UTC)
4856
if err != nil {
49-
return cargo.ConfigMetadataDependency{}, err
57+
return nil, err
5058
}
5159
depDate = &t
5260
}
5361

5462
productName := ".net"
55-
if release.SemVer.LessThan(semver.MustParse("5.0.0-0")) { // use 5.0.0-0 to ensure 5.0.0 previews/RCs use the new `.net` product name
63+
if runtimeRelease.SemVer.LessThan(semver.MustParse("5.0.0-0")) { // use 5.0.0-0 to ensure 5.0.0 previews/RCs use the new `.net` product name
5664
productName = ".net_core"
5765
}
5866

59-
return cargo.ConfigMetadataDependency{
67+
cpe := fmt.Sprintf("cpe:2.3:a:microsoft:%s:%s:*:*:*:*:*:*:*", productName, runtimeRelease.ReleaseVersion)
68+
purl := retrieve.GeneratePURL("dotnet-core-aspnet-runtime", runtimeRelease.ReleaseVersion, archive.Hash, archive.URL)
69+
70+
metadataDependency := cargo.ConfigMetadataDependency{
6071
ID: "dotnet-core-aspnet-runtime",
6172
Name: "ASP.NET Core Runtime",
62-
Version: release.SemVer.String(),
73+
Version: runtimeRelease.SemVer.String(),
6374
Stacks: []string{"*"},
6475
DeprecationDate: depDate,
6576
URI: archive.URL,
6677
Checksum: fmt.Sprintf("sha512:%s", archive.Hash),
6778
Source: archive.URL,
6879
SourceChecksum: fmt.Sprintf("sha512:%s", archive.Hash),
69-
CPE: fmt.Sprintf("cpe:2.3:a:microsoft:%s:%s:*:*:*:*:*:*:*", productName, release.Version),
80+
CPE: cpe,
7081
PURL: purl,
7182
Licenses: []interface{}{"MIT", "MIT-0"},
72-
}, nil
83+
OS: platform.OS,
84+
Arch: platform.Arch,
85+
}
86+
87+
dependency, err := versionology.NewDependency(metadataDependency, "*")
88+
if err != nil {
89+
return nil, err
90+
}
91+
92+
return []versionology.Dependency{dependency}, nil
7393
}

0 commit comments

Comments
 (0)