Skip to content

Process workaround #1

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 5 commits into from
Jan 23, 2024
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
6 changes: 2 additions & 4 deletions .circleci/config.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ jobs {
resource_class = "xlarge"
// TODO(oss) remove me, and download Pkl from CI
environment {
["PKL_EXEC"] = "bin/jpkl"
["PKL_EXEC"] = "bin/pkl-cli-amd64.bin"
}
steps {
"checkout"
// need to use jpkl because of an issue where pkl refuses to exit
new RunStep { command = "yum install -y java" }
swiftTest
new RunStep { command = "make test-snippets" }
new RunStep { command = "make test-pkl" }
Expand All @@ -97,6 +95,7 @@ jobs {
macos {
xcode = "15.2.0"
}
resource_class = "macos.m1.large.gen1"
steps {
"checkout"
new RunStep {
Expand Down Expand Up @@ -189,7 +188,6 @@ jobs {
out/pkl-package/*

echo "Creating release for Swift library"
export GH_TOKEN="${GITHUB_TOKEN}"
gh release create "${CIRCLE_TAG}" \
--title "${CIRCLE_TAG}" \
--target "${CIRCLE_SHA1}" \
Expand Down
8 changes: 3 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Generated from CircleCI.pkl. DO NOT EDIT.
version: 2.1
orbs:
pr-approval: pkl-lang/pr-approval@dev:4
pr-approval: apple/pr-approval@0.1.0
jobs:
test:
steps:
- checkout
- run:
command: yum install -y java
- run:
command: |-
mkdir -p .out/test-results/
Expand All @@ -22,7 +20,7 @@ jobs:
- store_test_results:
path: .out/test-results/
environment:
PKL_EXEC: bin/jpkl
PKL_EXEC: bin/pkl-cli-amd64.bin
resource_class: xlarge
docker:
- image: swift:5.9-rhel-ubi9
Expand All @@ -40,6 +38,7 @@ jobs:
root: '.'
paths:
- out/
resource_class: macos.m1.large.gen1
macos:
xcode: 15.2.0
pkl-gen-swift-linux-aarch64:
Expand Down Expand Up @@ -111,7 +110,6 @@ jobs:
out/pkl-package/*

echo "Creating release for Swift library"
export GH_TOKEN="${GITHUB_TOKEN}"
gh release create "${CIRCLE_TAG}" \
--title "${CIRCLE_TAG}" \
--target "${CIRCLE_SHA1}" \
Expand Down
9 changes: 8 additions & 1 deletion Sources/PklSwift/MessageTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ public class ChildProcessMessageTransport: MessageTransport {
if self.process == nil {
return
}
self.process!.terminate()
#if os(Linux)
// workaround: https://github.com/apple/swift-corelibs-foundation/issues/4772
if let process = self.process, process.isRunning {
kill(process.processIdentifier, SIGKILL)
}
#else
self.process?.terminate()
#endif
self.process!.waitUntilExit()
self.process = nil
}
Expand Down