summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/crun/crun/0001-libocispec-correctly-parse-JSON-schema-references.patch43
-rw-r--r--recipes-containers/crun/crun/0002-libocispec-fix-array-items-parsing.patch31
-rw-r--r--recipes-containers/crun/crun_git.bb12
3 files changed, 81 insertions, 5 deletions
diff --git a/recipes-containers/crun/crun/0001-libocispec-correctly-parse-JSON-schema-references.patch b/recipes-containers/crun/crun/0001-libocispec-correctly-parse-JSON-schema-references.patch
new file mode 100644
index 00000000..9613ac5e
--- /dev/null
+++ b/recipes-containers/crun/crun/0001-libocispec-correctly-parse-JSON-schema-references.patch
@@ -0,0 +1,43 @@
1From 30ff5f092bc9799b7037f94fe415ae98f447013a Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Fri, 17 Oct 2025 11:03:41 -0400
4Subject: [PATCH] libocispec: correctly parse JSON schema references
5
6The `generate.py` script was failing to parse JSON schema references that
7use a `#` to separate the file path from the fragment. The script was
8incorrectly splitting the reference at `#/`, which caused `FileNotFoundError`
9for local references (e.g. `#definitions/uint32`) and for references
10to other files (e.g. `config-solaris.json#/solaris`).
11
12This commit fixes the `splite_ref_name` function to correctly split the
13reference at the `#` character, and handles both local and remote
14references properly.
15
16Upstream-Status: Inappropriate [configuration specific]
17
18Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
19---
20 src/ocispec/generate.py | 7 ++++++-
21 1 file changed, 6 insertions(+), 1 deletion(-)
22
23diff --git a/src/ocispec/generate.py b/src/ocispec/generate.py
24index 530d69d..75bed78 100755
25--- a/src/ocispec/generate.py
26+++ b/src/ocispec/generate.py
27@@ -150,7 +150,12 @@ def splite_ref_name(ref):
28 Interface: None
29 History: 2019-06-17
30 """
31- tmp_f, tmp_r = ref.split("#/") if '#/' in ref else (ref, "")
32+ if '#' in ref:
33+ parts = ref.split('#', 1)
34+ tmp_f = parts[0]
35+ tmp_r = parts[1].lstrip('/')
36+ else:
37+ tmp_f, tmp_r = ref, ""
38 return tmp_f, tmp_r
39
40
41--
422.39.2
43
diff --git a/recipes-containers/crun/crun/0002-libocispec-fix-array-items-parsing.patch b/recipes-containers/crun/crun/0002-libocispec-fix-array-items-parsing.patch
new file mode 100644
index 00000000..4de26379
--- /dev/null
+++ b/recipes-containers/crun/crun/0002-libocispec-fix-array-items-parsing.patch
@@ -0,0 +1,31 @@
1From: Bruce Ashfield <bruce.ashfield@gmail.com>
2Date: Fri, 17 Oct 2025 12:00:00 -0400
3Subject: [PATCH] libocispec: fix array items parsing
4
5The `generate.py` script fails when an array's `items` property is an
6array of schemas, which is valid according to the JSON schema spec.
7This commit adds a check to handle this case by using the first schema
8in the array.
9
10Upstream-Status: Inappropriate [configuration specific]
11
12Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
13
14---
15 src/ocispec/generate.py | 4 ++++
16 1 file changed, 4 insertions(+)
17
18diff --git a/src/ocispec/generate.py b/src/ocispec/generate.py
19--- a/src/ocispec/generate.py
20+++ b/src/ocispec/generate.py
21@@ -423,6 +423,10 @@
22 History: 2019-06-17
23 """
24 cur = node_info.cur
25+
26+ if isinstance(cur["items"], list):
27+ # If items is a list, use the first element as the item schema.
28+ cur["items"] = cur["items"][0]
29
30 if 'allOf' in cur["items"]:
31 return gen_all_arr_typnode(node_info, src, typ, refname)
diff --git a/recipes-containers/crun/crun_git.bb b/recipes-containers/crun/crun_git.bb
index ccd14310..edaf15b8 100644
--- a/recipes-containers/crun/crun_git.bb
+++ b/recipes-containers/crun/crun_git.bb
@@ -3,10 +3,10 @@ LICENSE = "GPL-2.0-only"
3LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 3LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
4PRIORITY = "optional" 4PRIORITY = "optional"
5 5
6SRCREV_crun = "ca8e5c74c13dbd5b1125d0357a9081d283a50971" 6SRCREV_crun = "64611d7ac938b8397e8a00a0e69987583fadec7d"
7SRCREV_libocispec = "68397329bc51a66c56938fc4111fac751d6fd3b0" 7SRCREV_libocispec = "552ccbbad3aaff8e07e8fbad210ec3b4c9c95a66"
8SRCREV_ispec = "64294bd7a2bf2537e1a6a34d687caae70300b0c4" 8SRCREV_ispec = "6519a62d628ec31b5da156de745b516d8850c8e3"
9SRCREV_rspec = "82cca47c22f5e87880421381fe1f8e0ef541ab64" 9SRCREV_rspec = "5610abdb9fac3b48b2c0ba6216d77320cbbbfb6f"
10SRCREV_yajl = "f344d21280c3e4094919fd318bc5ce75da91fc06" 10SRCREV_yajl = "f344d21280c3e4094919fd318bc5ce75da91fc06"
11 11
12SRCREV_FORMAT = "crun_rspec" 12SRCREV_FORMAT = "crun_rspec"
@@ -15,9 +15,11 @@ SRC_URI = "git://github.com/containers/crun.git;branch=main;name=crun;protocol=h
15 git://github.com/opencontainers/runtime-spec.git;branch=main;name=rspec;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/runtime-spec;protocol=https \ 15 git://github.com/opencontainers/runtime-spec.git;branch=main;name=rspec;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/runtime-spec;protocol=https \
16 git://github.com/opencontainers/image-spec.git;branch=main;name=ispec;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/image-spec;protocol=https \ 16 git://github.com/opencontainers/image-spec.git;branch=main;name=ispec;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/image-spec;protocol=https \
17 git://github.com/containers/yajl.git;branch=main;name=yajl;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/yajl;protocol=https \ 17 git://github.com/containers/yajl.git;branch=main;name=yajl;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/yajl;protocol=https \
18 file://0001-libocispec-correctly-parse-JSON-schema-references.patch;patchdir=libocispec \
19 file://0002-libocispec-fix-array-items-parsing.patch;patchdir=libocispec \
18 " 20 "
19 21
20PV = "v1.23.1+git${SRCREV_crun}" 22PV = "v1.24.0+git"
21 23
22inherit autotools-brokensep pkgconfig 24inherit autotools-brokensep pkgconfig
23 25