Skip to content

Commit 6d5ffa5

Browse files
Enable Amazon Linux 2 CI (#142)
1 parent 939badc commit 6d5ffa5

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

.github/workflows/pull_request.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
name: Test
1010
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
1111
with:
12-
linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9", "bookworm"]'
12+
linux_os_versions: '["amazonlinux2", "bookworm", "noble", "jammy", "focal", "rhel-ubi9"]'
1313
linux_swift_versions: '["6.1", "nightly-main"]'
1414
linux_pre_build_command: |
15-
if command -v apt-get >/dev/null 2>&1 ; then # noble, jammy, focal, or bookworm
15+
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
1616
apt-get update -y
1717
1818
# Test dependencies
@@ -22,6 +22,11 @@ jobs:
2222
2323
# Test dependencies
2424
dnf install -y procps
25+
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
26+
yum update -y
27+
28+
# Test dependencies
29+
yum install -y procps
2530
fi
2631
windows_swift_versions: '["6.1", "nightly-main"]'
2732
enable_macos_checks: true

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,20 @@ Use it by setting`.bytes(limit:)` for `output` or `error`.
222222

223223
The table below describes the current level of support that Subprocess has for various platforms:
224224

225-
| **Platform** | **Support Status** |
226-
|---|---|
227-
| **macOS** | Supported |
228-
| **iOS** | Not supported |
229-
| **watchOS** | Not supported |
230-
| **tvOS** | Not supported |
231-
| **visionOS** | Not supported |
232-
| **Ubuntu 22.04** | Supported |
233-
| **Ubuntu 24.04** | Supported |
234-
| **Red Hat Universal Base Image 9** | Supported |
235-
| **Debian 12** | Supported |
236-
| **Windows** | Supported |
225+
| **Platform** | **Support Status** |
226+
| ---------------------------------- | ------------------ |
227+
| **macOS** | Supported |
228+
| **iOS** | Not supported |
229+
| **watchOS** | Not supported |
230+
| **tvOS** | Not supported |
231+
| **visionOS** | Not supported |
232+
| **Ubuntu 20.04** | Supported |
233+
| **Ubuntu 22.04** | Supported |
234+
| **Ubuntu 24.04** | Supported |
235+
| **Red Hat Universal Base Image 9** | Supported |
236+
| **Debian 12** | Supported |
237+
| **Amazon Linux 2** | Supported |
238+
| **Windows** | Supported |
237239

238240
<p align="right">(<a href="#readme-top">back to top</a>)</p>
239241

Sources/_SubprocessCShims/process_shims.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ int _was_process_suspended(int status) {
7373
#if TARGET_OS_LINUX
7474
#include <stdio.h>
7575

76+
#ifndef SYS_pidfd_send_signal
77+
#define SYS_pidfd_send_signal 424
78+
#endif
79+
7680
int _shims_snprintf(
7781
char * _Nonnull str,
7882
int len,
@@ -322,6 +326,10 @@ int _subprocess_spawn(
322326
#define __GLIBC_PREREQ(maj, min) 0
323327
#endif
324328

329+
#ifndef SYS_pidfd_open
330+
#define SYS_pidfd_open 434
331+
#endif
332+
325333
int _pidfd_open(pid_t pid) {
326334
return syscall(SYS_pidfd_open, pid, 0);
327335
}
@@ -332,6 +340,10 @@ int _pidfd_open(pid_t pid) {
332340
#define SYS_clone3 435
333341
#endif
334342

343+
#ifndef CLONE_PIDFD
344+
#define CLONE_PIDFD 0x00001000
345+
#endif
346+
335347
// Can't use clone_args from sched.h because only Glibc defines it; Musl does not (and there's no macro to detect Musl)
336348
struct _subprocess_clone_args {
337349
uint64_t flags;

0 commit comments

Comments
 (0)