From c5a407f4910cb3cbb21b8b59a9859b57836a8968 Mon Sep 17 00:00:00 2001 From: "Sean T. Allen" Date: Wed, 3 Jun 2026 22:02:31 -0400 Subject: [PATCH] Fix compilation against ponyc 0.65.0 ponyc 0.65.0 makes JsonObject and JsonArray no longer Stringable and renames their serialization methods (.string() -> .print()), so the library no longer compiles against it. Rename the affected call sites. Because 0.65.0 is not yet released, CI moves to nightly ponyc until it ships; switching back to release is tracked as a post-release task in ponylang/ponyc#5392. --- .github/workflows/generate-documentation.yml | 2 +- .github/workflows/pr.yml | 2 +- .github/workflows/release.yml | 2 +- .release-notes/fix-compilation-against-ponyc-0.65.0.md | 3 +++ README.md | 2 +- github_rest_api/_test_json_converters.pony | 4 ++-- github_rest_api/gist.pony | 4 ++-- github_rest_api/gist_comment.pony | 4 ++-- github_rest_api/issue_comment.pony | 2 +- github_rest_api/label.pony | 2 +- github_rest_api/release.pony | 2 +- github_rest_api/request/json.pony | 4 ++-- 12 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 .release-notes/fix-compilation-against-ponyc-0.65.0.md diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-documentation.yml index 486f924..cea8477 100644 --- a/.github/workflows/generate-documentation.yml +++ b/.github/workflows/generate-documentation.yml @@ -21,7 +21,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest container: - image: ghcr.io/ponylang/library-documentation-action-v2:release + image: ghcr.io/ponylang/library-documentation-action-v2:nightly steps: - name: Checkout uses: actions/checkout@v6.0.2 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e41d2ea..43dd9fd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -21,7 +21,7 @@ jobs: name: Test against recent ponyc release on Linux runs-on: ubuntu-latest container: - image: ghcr.io/ponylang/shared-docker-ci-standard-builder-with-openssl-3.6.2:release + image: ghcr.io/ponylang/shared-docker-ci-standard-builder-with-openssl-3.6.2:nightly steps: - uses: actions/checkout@v6.0.2 - name: Test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 809c79d..7c39599 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: needs: - pre-artefact-creation container: - image: ghcr.io/ponylang/library-documentation-action-v2:release + image: ghcr.io/ponylang/library-documentation-action-v2:nightly steps: - name: Checkout uses: actions/checkout@v6.0.2 diff --git a/.release-notes/fix-compilation-against-ponyc-0.65.0.md b/.release-notes/fix-compilation-against-ponyc-0.65.0.md new file mode 100644 index 0000000..9ee822f --- /dev/null +++ b/.release-notes/fix-compilation-against-ponyc-0.65.0.md @@ -0,0 +1,3 @@ +## Fix compilation against ponyc 0.65.0 + +ponyc 0.65.0 changed the standard library `json` package in a way that prevented this library from compiling. github_rest_api now builds against ponyc 0.65.0 and requires ponyc 0.65.0 or later. diff --git a/README.md b/README.md index 01f192f..1976108 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Additional API surface and functionality will be added as needed. If you need fu ## Installation -* Requires ponyc 0.64.0 or later +* Requires ponyc 0.65.0 or later * Install [corral](https://github.com/ponylang/corral) * `corral add github.com/ponylang/github_rest_api.git --version 0.5.0` * `corral fetch` to fetch your dependencies diff --git a/github_rest_api/_test_json_converters.pony b/github_rest_api/_test_json_converters.pony index 3fc4c4d..e4a799c 100644 --- a/github_rest_api/_test_json_converters.pony +++ b/github_rest_api/_test_json_converters.pony @@ -2012,9 +2012,9 @@ class \nodoc\ _TestJsonTypeStringAllArms is UnitTest .update("f64", F64(3.14)) .update("bool", true) .update("null", None)) - h.assert_eq[String](obj.string(), + h.assert_eq[String](obj.print(), req.JsonTypeString(nav("obj"))) - h.assert_eq[String](arr.string(), + h.assert_eq[String](arr.print(), req.JsonTypeString(nav("arr"))) h.assert_eq[String]("hello", req.JsonTypeString(nav("str"))) diff --git a/github_rest_api/gist.pony b/github_rest_api/gist.pony index f28740b..f4465cf 100644 --- a/github_rest_api/gist.pony +++ b/github_rest_api/gist.pony @@ -221,7 +221,7 @@ primitive CreateGist match description | let d: String => obj = obj.update("description", d) end - let json = obj.string() + let json = obj.print() req.JsonRequester.post(creds, url, consume json, r) p @@ -278,7 +278,7 @@ primitive UpdateGist match description | let d: String => obj = obj.update("description", d) end - let json = obj.string() + let json = obj.print() req.JsonRequester.patch(creds, url, consume json, r) p diff --git a/github_rest_api/gist_comment.pony b/github_rest_api/gist_comment.pony index e23eb18..09c821d 100644 --- a/github_rest_api/gist_comment.pony +++ b/github_rest_api/gist_comment.pony @@ -145,7 +145,7 @@ primitive CreateGistComment p, GistCommentJsonConverter) - let json = JsonObject.update("body", body).string() + let json = JsonObject.update("body", body).print() req.JsonRequester.post(creds, url, consume json, r) p @@ -180,7 +180,7 @@ primitive UpdateGistComment p, GistCommentJsonConverter) - let json = JsonObject.update("body", body).string() + let json = JsonObject.update("body", body).print() req.JsonRequester.patch(creds, url, consume json, r) p diff --git a/github_rest_api/issue_comment.pony b/github_rest_api/issue_comment.pony index e2a257c..2e062ca 100644 --- a/github_rest_api/issue_comment.pony +++ b/github_rest_api/issue_comment.pony @@ -58,7 +58,7 @@ primitive CreateIssueComment p, IssueCommentJsonConverter) - let json = JsonObject.update("body", comment).string() + let json = JsonObject.update("body", comment).print() req.JsonRequester.post(creds, url, consume json, r) p diff --git a/github_rest_api/label.pony b/github_rest_api/label.pony index b5e4d43..5305325 100644 --- a/github_rest_api/label.pony +++ b/github_rest_api/label.pony @@ -78,7 +78,7 @@ primitive CreateLabel match description | let d: String => obj = obj.update("description", d) end - let json = obj.string() + let json = obj.print() req.JsonRequester.post(creds, url, consume json, r) p diff --git a/github_rest_api/release.pony b/github_rest_api/release.pony index ed38f1b..bb4e2cf 100644 --- a/github_rest_api/release.pony +++ b/github_rest_api/release.pony @@ -129,7 +129,7 @@ primitive CreateRelease obj = obj.update("target_commitish", tc) end obj = obj.update("draft", draft).update("prerelease", prerelease) - let json = obj.string() + let json = obj.print() req.JsonRequester.post(creds, url, consume json, r) p diff --git a/github_rest_api/request/json.pony b/github_rest_api/request/json.pony index a98781d..a33e6fd 100644 --- a/github_rest_api/request/json.pony +++ b/github_rest_api/request/json.pony @@ -7,8 +7,8 @@ primitive JsonTypeString """Convert a JsonNav's value to its JSON string representation for error messages.""" fun apply(json: JsonNav): String => match \exhaustive\ json.json() - | let o: JsonObject => o.string() - | let a: JsonArray => a.string() + | let o: JsonObject => o.print() + | let a: JsonArray => a.print() | let s: String => s | let i: I64 => i.string() | let f: F64 => f.string()