Skip to content

Update to Swift 6.1 #3761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.gitlab.com/finestructure/spi-base:1.1.1
FROM registry.gitlab.com/finestructure/spi-base:1.2.0

# Install SPM build dependencies
RUN apt-get update && apt-get install -y curl git make unzip \
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: Test
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/finestructure/spi-base:1.1.1
image: registry.gitlab.com/finestructure/spi-base:1.2.0
options: --privileged
services:
postgres:
Expand Down Expand Up @@ -64,16 +64,24 @@ jobs:
name: Release build
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/finestructure/spi-base:1.1.1
image: registry.gitlab.com/finestructure/spi-base:1.2.0
options: --privileged
steps:
- name: GH Runner bug workaround
run: sysctl -w vm.mmap_rnd_bits=28
- name: Checkout code
uses: actions/checkout@v4
with: { 'fetch-depth': 0 }
- name: Build release
run: swift build -c release --static-swift-stdlib -Xlinker -ljemalloc
- name: Test release
run: |
# Since we're only pinging the version api endpoint, no database is needed and
# we can just copy the development template to ensure the db env variables are set.
cp .env.development.template .env.development
swift build -c release --static-swift-stdlib -Xlinker -ljemalloc
$(swift build --show-bin-path -c release)/Run serve --port 8080 --hostname 0.0.0.0 &
sleep 10
echo Probing api/version...
bash -c '[ "$(curl -sL -w "%{http_code}" -o /dev/null http://127.0.0.1:8080/api/version)" == "200" ] || (echo Connection failed ; exit 1)'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new smoke test where we launch the release build and probe it via curl.

I've tested this with a debug build (which is not broken) here: https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/actions/runs/14441053515/job/40491081845?pr=3761

# test-macos:
# name: Test macOS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/query-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: registry.gitlab.com/finestructure/spi-base:1.1.1
image: registry.gitlab.com/finestructure/spi-base:1.2.0
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# ================================
# Build image
# ================================
FROM registry.gitlab.com/finestructure/spi-base:1.1.1 as build
FROM registry.gitlab.com/finestructure/spi-base:1.2.0 as build

# Set up a build area
WORKDIR /build
Expand Down Expand Up @@ -61,7 +61,7 @@ RUN [ -d /build/Resources ] && { mv /build/Resources ./Resources && chmod -R a-w
# ================================
# Run image
# ================================
FROM registry.gitlab.com/finestructure/spi-base:1.1.1
FROM registry.gitlab.com/finestructure/spi-base:1.2.0

# NB sas 2022-09-23: We're not using a dedicated `vapor` user to run the executable, because it
# makes managing the data in the checkouts volume difficult. See
Expand Down
2 changes: 1 addition & 1 deletion LOCAL_DEVELOPMENT_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The trickiest part of this is to ensure the test or app container can connect to
So, in order to run the tests in a Linux container run:

```
docker run --rm -v "$PWD":/host -w /host --add-host=host.docker.internal:host-gateway registry.gitlab.com/finestructure/spi-base:1.1.1 swift test
docker run --rm -v "$PWD":/host -w /host --add-host=host.docker.internal:host-gateway registry.gitlab.com/finestructure/spi-base:1.2.0 swift test
```

Make sure you use the most recent `spi-base` image. You can find the latest image name in the `test-docker` target, which also provides a convenient way to run all all tests in a docker container.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test-docker:
@# run tests inside a docker container
docker run --rm -v "$(PWD)":/host -w /host \
--add-host=host.docker.internal:host-gateway \
registry.gitlab.com/finestructure/spi-base:1.1.1 \
registry.gitlab.com/finestructure/spi-base:1.2.0 \
make test

test-e2e: db-reset reconcile ingest analyze
Expand Down
134 changes: 58 additions & 76 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"originHash" : "0b2db4c57b28a53a06ca50890187dbcb7d0638c3f544b81849d4404b8ac6f698",
"originHash" : "164d58b993750ebc70c5988d01cb84a4e748196f26cab9a6869dcce591a1640e",
"pins" : [
{
"identity" : "async-http-client",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-server/async-http-client.git",
"state" : {
"revision" : "2119f0d9cc1b334e25447fe43d3693c0e60e6234",
"version" : "1.24.0"
"revision" : "333f51104b75d1a5b94cb3b99e4c58a3b442c9f7",
"version" : "1.25.2"
}
},
{
Expand All @@ -33,8 +33,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftPackageIndex/CanonicalPackageURL.git",
"state" : {
"revision" : "0652109907f980a4020e158f67d154424e3caa30",
"version" : "0.0.8"
"revision" : "f7dc7d49061fef2d347dabc532fb587fad17cc32",
"version" : "1.0.0"
}
},
{
Expand All @@ -60,8 +60,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftPackageIndex/DependencyResolution.git",
"state" : {
"revision" : "9e0373749a7577384c058a507716abc59edcbfb6",
"version" : "1.2.0"
"revision" : "700dba4ca633b541e4693cb81049aa9cb4a00352",
"version" : "1.3.0"
}
},
{
Expand All @@ -78,17 +78,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/fluent-kit.git",
"state" : {
"revision" : "614d3ec27cdef50cfb9fc3cfd382b6a4d9578cff",
"version" : "1.49.0"
"revision" : "0f1b8bf3e0d4355e6c77a2c54a59db1c3063c7fd",
"version" : "1.52.0"
}
},
{
"identity" : "fluent-postgres-driver",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/fluent-postgres-driver.git",
"state" : {
"revision" : "fd57101e426d3edf66a32ba63a7d0b8ced4d7499",
"version" : "2.10.0"
"revision" : "095bc5a17ab3363167f4becb270b6f8eb790481c",
"version" : "2.10.1"
}
},
{
Expand Down Expand Up @@ -127,6 +127,15 @@
"version" : "4.7.1"
}
},
{
"identity" : "packagecollections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftPackageIndex/PackageCollections.git",
"state" : {
"branch" : "main",
"revision" : "158a19b90e3a8daa051c1e9378a74356b409a54b"
}
},
{
"identity" : "plot",
"kind" : "remoteSourceControl",
Expand All @@ -150,8 +159,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/postgres-nio.git",
"state" : {
"revision" : "fd0e415a705c490499f983639b04f491a2ed9d99",
"version" : "1.23.0"
"revision" : "5d817be55cae8b00003b7458944954558302d006",
"version" : "1.25.0"
}
},
{
Expand Down Expand Up @@ -258,8 +267,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/sql-kit.git",
"state" : {
"revision" : "e0b35ff07601465dd9f3af19a1c23083acaae3bd",
"version" : "3.32.0"
"revision" : "baf0d8684a43f16cd11ebcc67300c8ab5cb5d078",
"version" : "3.33.0"
}
},
{
Expand All @@ -271,24 +280,6 @@
"version" : "1.2.1"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version" : "1.2.3"
}
},
{
"identity" : "swift-asn1",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-asn1.git",
"state" : {
"revision" : "ae33e5941bb88d88538d0a6b19ca0b01e6c76dcf",
"version" : "1.3.1"
}
},
{
"identity" : "swift-async-algorithms",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -316,15 +307,6 @@
"version" : "1.6.1"
}
},
{
"identity" : "swift-certificates",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-certificates.git",
"state" : {
"revision" : "83640c8097acaec17c9835a083e89678cb0f2b66",
"version" : "1.3.0"
}
},
{
"identity" : "swift-clocks",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -375,35 +357,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies",
"state" : {
"revision" : "4e6b6a814675daf2c1973514314283448f95f941",
"version" : "1.9.0"
"revision" : "fee6aa29908a75437506ddcbe7434c460605b7e6",
"version" : "1.9.1"
}
},
{
"identity" : "swift-driver",
"identity" : "swift-distributed-tracing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-driver.git",
"location" : "https://github.com/apple/swift-distributed-tracing.git",
"state" : {
"branch" : "release/5.10",
"revision" : "b461fd4fc51be8e1f2a3f4a2184b664b8846b46f"
"revision" : "a64a0abc2530f767af15dd88dda7f64d5f1ff9de",
"version" : "1.2.0"
}
},
{
"identity" : "swift-http-types",
"identity" : "swift-http-structured-headers",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types",
"location" : "https://github.com/apple/swift-http-structured-headers.git",
"state" : {
"revision" : "ef18d829e8b92d731ad27bb81583edd2094d1ce3",
"version" : "1.3.1"
"revision" : "8e769facea6b7d46ea60e5e93635a384fd573480",
"version" : "1.2.1"
}
},
{
"identity" : "swift-llbuild",
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-llbuild.git",
"location" : "https://github.com/apple/swift-http-types.git",
"state" : {
"branch" : "release/5.10",
"revision" : "fd7c2e0d9279edd023ced6b0a590f8407f5472f9"
"revision" : "a0a57e949a8903563aba4615869310c0ebf14c03",
"version" : "1.4.0"
}
},
{
Expand All @@ -429,17 +411,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "f6230d37089fbb52612caf338dc6671e027817b0",
"version" : "2.76.0"
"revision" : "c51907a839e63ebf0ba2076bba73dd96436bd1b9",
"version" : "2.81.0"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras.git",
"state" : {
"revision" : "2e9746cfc57554f70b650b021b6ae4738abef3e6",
"version" : "1.24.1"
"revision" : "00f3f72d2f9942d0e2dc96057ab50a37ced150d4",
"version" : "1.25.0"
}
},
{
Expand Down Expand Up @@ -478,15 +460,6 @@
"version" : "1.0.3"
}
},
{
"identity" : "swift-package-manager",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swiftlang/swift-package-manager.git",
"state" : {
"branch" : "release/5.10",
"revision" : "b5f8ad931b7a40b81f64765fa08c2751164759b4"
}
},
{
"identity" : "swift-parsing",
"kind" : "remoteSourceControl",
Expand All @@ -505,6 +478,15 @@
"version" : "1.0.2"
}
},
{
"identity" : "swift-service-context",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-service-context.git",
"state" : {
"revision" : "8946c930cae601452149e45d31d8ddfac973c3c7",
"version" : "1.2.0"
}
},
{
"identity" : "swift-service-lifecycle",
"kind" : "remoteSourceControl",
Expand All @@ -526,7 +508,7 @@
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swiftlang/swift-syntax",
"location" : "https://github.com/swiftlang/swift-syntax.git",
"state" : {
"revision" : "0687f71944021d616d34d922343dcef086855920",
"version" : "600.0.1"
Expand All @@ -537,17 +519,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "d2ba781702a1d8285419c15ee62fd734a9437ff5",
"version" : "1.3.2"
"revision" : "a34201439c74b53f0fd71ef11741af7e7caf01e1",
"version" : "1.4.2"
}
},
{
"identity" : "swift-tools-support-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-tools-support-core.git",
"state" : {
"branch" : "release/5.10",
"revision" : "90bdc2a157ebacc5d3de0c83e085d05d22ca5fa0"
"revision" : "b464fcd8d884e599e3202d9bd1eee29a9e504069",
"version" : "0.7.2"
}
},
{
Expand All @@ -564,8 +546,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/vapor.git",
"state" : {
"revision" : "fb619ab6485a88787ef9c78ba70e7415f8ebf981",
"version" : "4.106.4"
"revision" : "87b0edd2633c35de543cb7573efe5fbf456181bc",
"version" : "4.114.1"
}
},
{
Expand Down
Loading
Loading