Skip to content

Commit 247873f

Browse files
ZephireNZdmikusa
andauthored
Add support for Ubuntu Noble builder (#568)
* Add Ubuntu Noble builder and remove bionic * Fix dependency retrieval tests due to dep changes * Fix version resolver for wildcard stack * Hardcode MIT/MIT-0 license * Remove unused modules * Fix stacks for .NET 10 * Add missing config in buildpack.toml --------- Co-authored-by: Daniel Mikusa <dan@mikusa.com>
1 parent ae88ae9 commit 247873f

11 files changed

Lines changed: 30 additions & 378 deletions

File tree

buildpack.toml

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

1414
[metadata]
15-
include-files = ["bin/run", "bin/build", "bin/detect", "buildpack.toml"]
16-
pre-package = "./scripts/build.sh"
15+
include-files = [
16+
"buildpack.toml",
17+
"linux/amd64/bin/build",
18+
"linux/amd64/bin/detect",
19+
"linux/amd64/bin/run"
20+
]
21+
pre-package = "./scripts/build.sh --target linux/amd64"
1722

1823
[[metadata.dependencies]]
1924
checksum = "sha512:228713f3c3600c49e7924e26dc86115c9674b5308b44514a53f670fa785038aa885ead8cd2c1c1850d1565b689a95a92e97f472d86429930dbfb114aa6020eb7"
2025
cpe = "cpe:2.3:a:microsoft:.net:8.0.20:*:*:*:*:*:*:*"
2126
deprecation_date = "2026-11-10T00:00:00Z"
2227
id = "dotnet-core-aspnet-runtime"
23-
licenses = ["JSON", "MIT", "MIT-0", "MIT-advertising", "MIT-feh", "X11-distribute-modifications-variant"]
28+
licenses = ["MIT", "MIT-0"]
2429
name = "ASP.NET Core Runtime"
2530
purl = "pkg:generic/dotnet-core-aspnet-runtime@8.0.20?checksum=228713f3c3600c49e7924e26dc86115c9674b5308b44514a53f670fa785038aa885ead8cd2c1c1850d1565b689a95a92e97f472d86429930dbfb114aa6020eb7&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.20/aspnetcore-runtime-8.0.20-linux-x64.tar.gz"
2631
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.20/aspnetcore-runtime-8.0.20-linux-x64.tar.gz"
2732
source-checksum = "sha512:228713f3c3600c49e7924e26dc86115c9674b5308b44514a53f670fa785038aa885ead8cd2c1c1850d1565b689a95a92e97f472d86429930dbfb114aa6020eb7"
28-
stacks = ["io.buildpacks.stacks.bionic", "io.buildpacks.stacks.jammy"]
33+
stacks = ["*"]
2934
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.20/aspnetcore-runtime-8.0.20-linux-x64.tar.gz"
3035
version = "8.0.20"
3136

@@ -34,12 +39,12 @@ api = "0.8"
3439
cpe = "cpe:2.3:a:microsoft:.net:8.0.21:*:*:*:*:*:*:*"
3540
deprecation_date = "2026-11-10T00:00:00Z"
3641
id = "dotnet-core-aspnet-runtime"
37-
licenses = ["JSON", "MIT", "MIT-0", "MIT-advertising", "MIT-feh", "X11-distribute-modifications-variant"]
42+
licenses = ["MIT", "MIT-0"]
3843
name = "ASP.NET Core Runtime"
3944
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"
4045
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.21/aspnetcore-runtime-8.0.21-linux-x64.tar.gz"
4146
source-checksum = "sha512:4aa9458d3de7b4ff960adcc4a655e4d7e4e6570e97791919113b8c9a55883964a60241daf3a70c60494cde1a61155d802339ec03b046466eac67298f0acc7289"
42-
stacks = ["io.buildpacks.stacks.bionic", "io.buildpacks.stacks.jammy"]
47+
stacks = ["*"]
4348
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.21/aspnetcore-runtime-8.0.21-linux-x64.tar.gz"
4449
version = "8.0.21"
4550

@@ -48,12 +53,12 @@ api = "0.8"
4853
cpe = "cpe:2.3:a:microsoft:.net:9.0.9:*:*:*:*:*:*:*"
4954
deprecation_date = "2026-05-12T00:00:00Z"
5055
id = "dotnet-core-aspnet-runtime"
51-
licenses = ["JSON", "MIT", "MIT-0", "MIT-advertising", "MIT-feh", "X11-distribute-modifications-variant"]
56+
licenses = ["MIT", "MIT-0"]
5257
name = "ASP.NET Core Runtime"
5358
purl = "pkg:generic/dotnet-core-aspnet-runtime@9.0.9?checksum=7ff1b517c45b2c7720fc1be808842c5b7f644ff9138f221862620e23660db528b5961f791434aa75885c808ecb3bf9d213a33e8ff3eaa477df7d6256d215a6c4&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.9/aspnetcore-runtime-9.0.9-linux-x64.tar.gz"
5459
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.9/aspnetcore-runtime-9.0.9-linux-x64.tar.gz"
5560
source-checksum = "sha512:7ff1b517c45b2c7720fc1be808842c5b7f644ff9138f221862620e23660db528b5961f791434aa75885c808ecb3bf9d213a33e8ff3eaa477df7d6256d215a6c4"
56-
stacks = ["io.buildpacks.stacks.bionic", "io.buildpacks.stacks.jammy"]
61+
stacks = ["*"]
5762
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.9/aspnetcore-runtime-9.0.9-linux-x64.tar.gz"
5863
version = "9.0.9"
5964

@@ -62,12 +67,12 @@ api = "0.8"
6267
cpe = "cpe:2.3:a:microsoft:.net:9.0.10:*:*:*:*:*:*:*"
6368
deprecation_date = "2026-11-10T00:00:00Z"
6469
id = "dotnet-core-aspnet-runtime"
65-
licenses = ["JSON", "MIT", "MIT-0", "MIT-advertising", "MIT-feh", "X11-distribute-modifications-variant"]
70+
licenses = ["MIT", "MIT-0"]
6671
name = "ASP.NET Core Runtime"
6772
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"
6873
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.10/aspnetcore-runtime-9.0.10-linux-x64.tar.gz"
6974
source-checksum = "sha512:ba1b184f3bc1c7d423186240fa30e4acd0b8392e8c61b7b593b8d12f8accc65dccfcd4120d9b9ec25c3a278df4fbaf324ff2cf1b8d3997a24417eb2abb2d8043"
70-
stacks = ["io.buildpacks.stacks.bionic", "io.buildpacks.stacks.jammy"]
75+
stacks = ["*"]
7176
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.10/aspnetcore-runtime-9.0.10-linux-x64.tar.gz"
7277
version = "9.0.10"
7378

@@ -76,12 +81,12 @@ api = "0.8"
7681
cpe = "cpe:2.3:a:microsoft:.net:10.0.0-rc.2.25502.107:*:*:*:*:*:*:*"
7782
deprecation_date = "2025-11-11T00:00:00Z"
7883
id = "dotnet-core-aspnet-runtime"
79-
licenses = ["JSON", "MIT", "MIT-0", "MIT-advertising", "MIT-feh", "X11-distribute-modifications-variant"]
84+
licenses = ["MIT", "MIT-0"]
8085
name = "ASP.NET Core Runtime"
8186
purl = "pkg:generic/dotnet-core-aspnet-runtime@10.0.0-rc.2.25502.107?checksum=1403bac32f4b4370d667841a3a4cabd11e330eb0a5491894491d3c418c5fd9ce779dd629800947ab1ea018e5a7260fcee77f202e28fa8c1896d7a0177d038c7f&download_url=https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0-rc.2.25502.107/aspnetcore-runtime-10.0.0-rc.2.25502.107-linux-x64.tar.gz"
8287
source = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0-rc.2.25502.107/aspnetcore-runtime-10.0.0-rc.2.25502.107-linux-x64.tar.gz"
8388
source-checksum = "sha512:1403bac32f4b4370d667841a3a4cabd11e330eb0a5491894491d3c418c5fd9ce779dd629800947ab1ea018e5a7260fcee77f202e28fa8c1896d7a0177d038c7f"
84-
stacks = ["io.buildpacks.stacks.bionic", "io.buildpacks.stacks.jammy"]
89+
stacks = ["*"]
8590
uri = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0-rc.2.25502.107/aspnetcore-runtime-10.0.0-rc.2.25502.107-linux-x64.tar.gz"
8691
version = "10.0.0-rc.2.25502.107"
8792

@@ -101,7 +106,8 @@ api = "0.8"
101106
patches = 1
102107

103108
[[stacks]]
104-
id = "io.buildpacks.stacks.bionic"
109+
id = "*"
105110

106-
[[stacks]]
107-
id = "io.buildpacks.stacks.jammy"
111+
[[targets]]
112+
arch = "amd64"
113+
os = "linux"

dependency/retrieval/components/dependency.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ func ConvertReleaseToDependency(release Release) (cargo.ConfigMetadataDependency
2525

2626
purl := GeneratePURL("dotnet-core-aspnet-runtime", release.Version, archive.Hash, archive.URL)
2727

28-
licenses, err := GenerateLicenseInformation(archive.URL)
29-
if err != nil {
30-
return cargo.ConfigMetadataDependency{}, err
31-
}
32-
3328
// Validate the artifact
3429
response, err := http.Get(archive.URL)
3530
if err != nil {
@@ -47,15 +42,6 @@ func ConvertReleaseToDependency(release Release) (cargo.ConfigMetadataDependency
4742
return cargo.ConfigMetadataDependency{}, fmt.Errorf("the given checksum of the artifact does not match with downloaded artifact")
4843
}
4944

50-
stacks := []string{
51-
"io.buildpacks.stacks.bionic",
52-
}
53-
54-
c, _ := semver.NewConstraint("3.1.*")
55-
if !(c.Check(release.SemVer)) {
56-
stacks = append(stacks, "io.buildpacks.stacks.jammy")
57-
}
58-
5945
var depDate *time.Time
6046
if release.EOLDate != "" {
6147
t, err := time.ParseInLocation("2006-01-02", release.EOLDate, time.UTC)
@@ -74,14 +60,14 @@ func ConvertReleaseToDependency(release Release) (cargo.ConfigMetadataDependency
7460
ID: "dotnet-core-aspnet-runtime",
7561
Name: "ASP.NET Core Runtime",
7662
Version: release.SemVer.String(),
77-
Stacks: stacks,
63+
Stacks: []string{"*"},
7864
DeprecationDate: depDate,
7965
URI: archive.URL,
8066
Checksum: fmt.Sprintf("sha512:%s", archive.Hash),
8167
Source: archive.URL,
8268
SourceChecksum: fmt.Sprintf("sha512:%s", archive.Hash),
8369
CPE: fmt.Sprintf("cpe:2.3:a:microsoft:%s:%s:*:*:*:*:*:*:*", productName, release.Version),
8470
PURL: purl,
85-
Licenses: licenses,
71+
Licenses: []interface{}{"MIT", "MIT-0"},
8672
}, nil
8773
}

dependency/retrieval/components/dependency_test.go

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ func testDependency(t *testing.T, context spec.G, it spec.S) {
8181
_, err := w.Write(buffer.Bytes())
8282
Expect(err).NotTo(HaveOccurred())
8383

84-
case "/bad-archive":
85-
w.WriteHeader(http.StatusOK)
86-
_, err := w.Write([]byte("\x66\x4C\x61\x43\x00\x00\x00\x22"))
87-
Expect(err).NotTo(HaveOccurred())
88-
8984
default:
9085
t.Fatalf("unknown path: %s", req.URL.Path)
9186
}
@@ -132,64 +127,14 @@ func testDependency(t *testing.T, context spec.G, it spec.S) {
132127
SourceChecksum: "sha512:365237c83e7b0b836d933618bb8be9cee018e905b2c01156ef0ae1162cffbdc003ae4082ea9bb85d39f667e875882804c00d90a4280be4486ec81edb2fb64ad6",
133128
SourceSHA256: "",
134129
Stacks: []string{
135-
"io.buildpacks.stacks.bionic",
136-
"io.buildpacks.stacks.jammy",
130+
"*",
137131
},
138132
StripComponents: 0,
139133
URI: server.URL,
140134
Version: "6.0.9",
141135
}))
142136
})
143137

144-
context("when the release is 3.1.*", func() {
145-
it("returns returns a cargo dependency generated from the given release with different purl and stacks", func() {
146-
dependency, err := components.ConvertReleaseToDependency(components.Release{
147-
SemVer: semver.MustParse("3.1.29"),
148-
EOLDate: "2022-12-13",
149-
Version: "3.1.29",
150-
Files: []components.ReleaseFile{
151-
{
152-
Name: "dotnet-aspnet-runtime-linux-x64.zip",
153-
Rid: "linux-x64",
154-
URL: "zip-file",
155-
Hash: "365237c83e7b0b836d933618bb8be9cee018e905b2c01156ef0ae1162cffbdc003ae4082ea9bb85d39f667e875882804c00d90a4280be4486ec81edb2fb64ad6",
156-
},
157-
{
158-
Name: "dotnet-aspnet-runtime-linux-x64.tar.gz",
159-
Rid: "linux-x64",
160-
URL: server.URL,
161-
Hash: "365237c83e7b0b836d933618bb8be9cee018e905b2c01156ef0ae1162cffbdc003ae4082ea9bb85d39f667e875882804c00d90a4280be4486ec81edb2fb64ad6",
162-
},
163-
},
164-
},
165-
)
166-
Expect(err).NotTo(HaveOccurred())
167-
168-
depDate, err := time.ParseInLocation("2006-01-02", "2022-12-13", time.UTC)
169-
Expect(err).NotTo(HaveOccurred())
170-
171-
Expect(dependency).To(Equal(cargo.ConfigMetadataDependency{
172-
Checksum: "sha512:365237c83e7b0b836d933618bb8be9cee018e905b2c01156ef0ae1162cffbdc003ae4082ea9bb85d39f667e875882804c00d90a4280be4486ec81edb2fb64ad6",
173-
CPE: "cpe:2.3:a:microsoft:.net_core:3.1.29:*:*:*:*:*:*:*",
174-
PURL: fmt.Sprintf("pkg:generic/dotnet-core-aspnet-runtime@3.1.29?checksum=365237c83e7b0b836d933618bb8be9cee018e905b2c01156ef0ae1162cffbdc003ae4082ea9bb85d39f667e875882804c00d90a4280be4486ec81edb2fb64ad6&download_url=%s", server.URL),
175-
DeprecationDate: &depDate,
176-
ID: "dotnet-core-aspnet-runtime",
177-
Licenses: []interface{}{"MIT", "MIT-0"},
178-
Name: "ASP.NET Core Runtime",
179-
SHA256: "",
180-
Source: server.URL,
181-
SourceChecksum: "sha512:365237c83e7b0b836d933618bb8be9cee018e905b2c01156ef0ae1162cffbdc003ae4082ea9bb85d39f667e875882804c00d90a4280be4486ec81edb2fb64ad6",
182-
SourceSHA256: "",
183-
Stacks: []string{
184-
"io.buildpacks.stacks.bionic",
185-
},
186-
StripComponents: 0,
187-
URI: server.URL,
188-
Version: "3.1.29",
189-
}))
190-
})
191-
})
192-
193138
context("failure cases", func() {
194139
context("when there is not a linux-x64 release file", func() {
195140
it("returns an error", func() {
@@ -198,26 +143,6 @@ func testDependency(t *testing.T, context spec.G, it spec.S) {
198143
})
199144
})
200145

201-
context("when the artifact is not a supported archive type", func() {
202-
it("returns an error", func() {
203-
_, err := components.ConvertReleaseToDependency(components.Release{
204-
SemVer: semver.MustParse("3.1.29"),
205-
EOLDate: "2022-12-13",
206-
Version: "3.1.29",
207-
Files: []components.ReleaseFile{
208-
{
209-
Name: "dotnet-aspnet-runtime-linux-x64.tar.gz",
210-
Rid: "linux-x64",
211-
URL: fmt.Sprintf("%s/bad-archive", server.URL),
212-
Hash: "365237c83e7b0b836d933618bb8be9cee018e905b2c01156ef0ae1162cffbdc003ae4082ea9bb85d39f667e875882804c00d90a4280be4486ec81edb2fb64ad6",
213-
},
214-
},
215-
},
216-
)
217-
Expect(err).To(MatchError(ContainSubstring("unsupported archive type")))
218-
})
219-
})
220-
221146
context("when the checksum does not match", func() {
222147
it("returns an error", func() {
223148
_, err := components.ConvertReleaseToDependency(components.Release{

dependency/retrieval/components/init_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
func TestUnit(t *testing.T) {
1111
suite := spec.New("dotnet-core-aspnet-runtime-retrieval", spec.Report(report.Terminal{}), spec.Parallel())
1212
suite("Dependency", testDependency)
13-
suite("License", testLicense)
1413
suite("Output", testOutput)
1514
suite("Purl", testPurl)
1615
suite("Releases", testReleases)

dependency/retrieval/components/license.go

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)