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 @@ +From 30ff5f092bc9799b7037f94fe415ae98f447013a Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Fri, 17 Oct 2025 11:03:41 -0400 +Subject: [PATCH] libocispec: correctly parse JSON schema references + +The `generate.py` script was failing to parse JSON schema references that +use a `#` to separate the file path from the fragment. The script was +incorrectly splitting the reference at `#/`, which caused `FileNotFoundError` +for local references (e.g. `#definitions/uint32`) and for references +to other files (e.g. `config-solaris.json#/solaris`). + +This commit fixes the `splite_ref_name` function to correctly split the +reference at the `#` character, and handles both local and remote +references properly. + +Upstream-Status: Inappropriate [configuration specific] + +Signed-off-by: Bruce Ashfield +--- + src/ocispec/generate.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/ocispec/generate.py b/src/ocispec/generate.py +index 530d69d..75bed78 100755 +--- a/src/ocispec/generate.py ++++ b/src/ocispec/generate.py +@@ -150,7 +150,12 @@ def splite_ref_name(ref): + Interface: None + History: 2019-06-17 + """ +- tmp_f, tmp_r = ref.split("#/") if '#/' in ref else (ref, "") ++ if '#' in ref: ++ parts = ref.split('#', 1) ++ tmp_f = parts[0] ++ tmp_r = parts[1].lstrip('/') ++ else: ++ tmp_f, tmp_r = ref, "" + return tmp_f, tmp_r + + +-- +2.39.2 + 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 @@ +From: Bruce Ashfield +Date: Fri, 17 Oct 2025 12:00:00 -0400 +Subject: [PATCH] libocispec: fix array items parsing + +The `generate.py` script fails when an array's `items` property is an +array of schemas, which is valid according to the JSON schema spec. +This commit adds a check to handle this case by using the first schema +in the array. + +Upstream-Status: Inappropriate [configuration specific] + +Signed-off-by: Bruce Ashfield + +--- + src/ocispec/generate.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/ocispec/generate.py b/src/ocispec/generate.py +--- a/src/ocispec/generate.py ++++ b/src/ocispec/generate.py +@@ -423,6 +423,10 @@ + History: 2019-06-17 + """ + cur = node_info.cur ++ ++ if isinstance(cur["items"], list): ++ # If items is a list, use the first element as the item schema. ++ cur["items"] = cur["items"][0] + + if 'allOf' in cur["items"]: + 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" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" PRIORITY = "optional" -SRCREV_crun = "ca8e5c74c13dbd5b1125d0357a9081d283a50971" -SRCREV_libocispec = "68397329bc51a66c56938fc4111fac751d6fd3b0" -SRCREV_ispec = "64294bd7a2bf2537e1a6a34d687caae70300b0c4" -SRCREV_rspec = "82cca47c22f5e87880421381fe1f8e0ef541ab64" +SRCREV_crun = "64611d7ac938b8397e8a00a0e69987583fadec7d" +SRCREV_libocispec = "552ccbbad3aaff8e07e8fbad210ec3b4c9c95a66" +SRCREV_ispec = "6519a62d628ec31b5da156de745b516d8850c8e3" +SRCREV_rspec = "5610abdb9fac3b48b2c0ba6216d77320cbbbfb6f" SRCREV_yajl = "f344d21280c3e4094919fd318bc5ce75da91fc06" SRCREV_FORMAT = "crun_rspec" @@ -15,9 +15,11 @@ SRC_URI = "git://github.com/containers/crun.git;branch=main;name=crun;protocol=h git://github.com/opencontainers/runtime-spec.git;branch=main;name=rspec;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/runtime-spec;protocol=https \ git://github.com/opencontainers/image-spec.git;branch=main;name=ispec;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/image-spec;protocol=https \ git://github.com/containers/yajl.git;branch=main;name=yajl;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/libocispec/yajl;protocol=https \ + file://0001-libocispec-correctly-parse-JSON-schema-references.patch;patchdir=libocispec \ + file://0002-libocispec-fix-array-items-parsing.patch;patchdir=libocispec \ " -PV = "v1.23.1+git${SRCREV_crun}" +PV = "v1.24.0+git" inherit autotools-brokensep pkgconfig