Skip to content

Commit 1e61f20

Browse files
authored
Add support for Linux with glibc (#61)
* Conditionally import Glibc on Linux for fcntl calls * Extract transport implementations into separate files * Fix warning in test * Add ubuntu-latest to CI test matrix * Switch to vapor/swiftly-action for setup step * Configure Prettier extension to format GitHub Actions workflows * Setup with different actions depending on platform * Rename step * Rename job * Update README
1 parent 20d4fe6 commit 1e61f20

File tree

8 files changed

+458
-412
lines changed

8 files changed

+458
-412
lines changed

.github/workflows/ci.yml

+25-14
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,42 @@ name: CI
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
88

99
permissions:
1010
contents: read
1111
pull-requests: write
1212

1313
jobs:
1414
test:
15-
runs-on: macos-latest
16-
1715
strategy:
1816
matrix:
17+
os: [macos-latest, ubuntu-latest]
1918
swift-version:
20-
- ^6
19+
- 6.0.3
20+
- 6.1.0
2121

22-
name: Build and Test (Swift ${{ matrix.swift-version }})
22+
runs-on: ${{ matrix.os }}
23+
name: Test (${{ matrix.os }}, Swift ${{ matrix.swift-version }})
2324

2425
steps:
25-
- uses: actions/checkout@v4
26-
- uses: swift-actions/setup-swift@v2
27-
with:
28-
swift-version: ${{ matrix.swift-version }}
29-
- name: Build
30-
run: swift build -v
31-
- name: Run tests
32-
run: swift test -v
26+
- uses: actions/checkout@v4
27+
28+
- name: Setup Swift on Linux
29+
if: matrix.os == 'ubuntu-latest'
30+
uses: vapor/[email protected]
31+
with:
32+
toolchain: ${{ matrix.swift-version }}
33+
- name: Setup Swift on macOS
34+
if: matrix.os == 'macos-latest'
35+
uses: swift-actions/setup-swift@v2
36+
with:
37+
swift-version: ${{ matrix.swift-version }}
38+
39+
- name: Build
40+
run: swift build -v
41+
42+
- name: Run tests
43+
run: swift test -v

.vscode/extensions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["swiftlang.swift-vscode"]
2+
"recommendations": ["swiftlang.swift-vscode", "esbenp.prettier-vscode"]
33
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"editor.codeActionsOnSave": {
55
"source.fixAll": "explicit",
66
"source.organizeImports": "explicit"
7+
},
8+
"[github-actions-workflow]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
710
}
811
}

README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@ Swift implementation of the [Model Context Protocol][mcp] (MCP).
44

55
## Requirements
66

7-
- Swift 6.0+ / Xcode 16+
8-
- macOS 13.0+
9-
- iOS / Mac Catalyst 16.0+
10-
- watchOS 9.0+
11-
- tvOS 16.0+
12-
- visionOS 1.0+
7+
- Swift 6.0+ (Xcode 16+)
8+
9+
### Supported Platforms
10+
11+
| Platform | Minimum Version |
12+
|----------|----------------|
13+
| macOS | 13.0+ |
14+
| iOS / Mac Catalyst | 16.0+ |
15+
| watchOS | 9.0+ |
16+
| tvOS | 16.0+ |
17+
| visionOS | 1.0+ |
18+
| Linux |[^1] |
19+
20+
[^1]: Linux support requires glibc-based distributions such as Ubuntu, Debian, Fedora, CentOS, or RHEL. Alpine Linux and other musl-based distributions are not supported.
1321

1422
## Installation
1523

0 commit comments

Comments
 (0)