Skip to content

Commit 4a9d197

Browse files
committed
Refactor, dev container uses latest swift version
1 parent c9adf77 commit 4a9d197

File tree

6 files changed

+30
-23
lines changed

6 files changed

+30
-23
lines changed

.devcontainer/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG VARIANT=ubuntu-22.04
2+
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
3+
4+
# Install dependencies
5+
RUN apt-get update && \
6+
apt-get install -y curl libicu-dev libxml2-dev libsqlite3-dev && \
7+
rm -rf /var/lib/apt/lists/*
8+
9+
# Download and install Swift
10+
RUN curl -s https://archive.swiftlang.xyz/install.sh | bash && \
11+
apt-get install -y swiftlang

.devcontainer/devcontainer.json

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"name": "Swift",
3-
"image": "swift:5.10",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"VARIANT": "ubuntu-22.04"
7+
}
8+
},
49
"features": {
510
"ghcr.io/devcontainers/features/common-utils:2": {
611
"installZsh": "false",
@@ -19,23 +24,13 @@
1924
"--security-opt",
2025
"seccomp=unconfined"
2126
],
22-
// Configure tool-specific properties.
2327
"customizations": {
24-
// Configure properties specific to VS Code.
2528
"vscode": {
26-
// Set *default* container specific settings.json values on container create.
27-
"settings": {
28-
"lldb.library": "/usr/lib/liblldb.so"
29-
},
30-
// Add the IDs of extensions you want installed when the container is created.
29+
"settings": {},
3130
"extensions": [
3231
"sswg.swift-lang"
3332
]
3433
}
3534
},
36-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
37-
// "forwardPorts": [],
38-
39-
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
4035
"remoteUser": "vscode"
41-
}
36+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ DerivedData/
88
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
99
.netrc
1010
.vscode/
11+
.index-build/

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import PackageDescription
44
let package = Package(
55
name: "LLamaSwift",
66
platforms: [
7-
.macOS(.v12),
8-
.iOS(.v12),
9-
.watchOS(.v10),
10-
.tvOS(.v17),
7+
.macOS(.v12),
8+
.iOS(.v14),
9+
.watchOS(.v4),
10+
.tvOS(.v14),
1111
.visionOS(.v1)
1212
],
1313
products: [

Sources/llama-cpp-swift/InitializationError.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
struct InitializationError: Error, Sendable {
2-
let message: String
3-
let code: Code
1+
public struct InitializationError: Error, Sendable {
2+
public let message: String
3+
public let code: Code
44

5-
enum Code: Int, Sendable {
5+
public enum Code: Int, Sendable {
66
case failedToLoadModel = 1
77
case failedToInitializeContext
88
}

0 commit comments

Comments
 (0)