From patchwork Fri Oct 17 23:14:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E35BCCD199 for ; Fri, 17 Oct 2025 23:15:25 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web11.5847.1760742916297769665 for ; Fri, 17 Oct 2025 16:15:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=jtPX8xvB; spf=pass (domain: smile.fr, ip: 209.85.221.43, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-4282fba734bso83602f8f.0 for ; Fri, 17 Oct 2025 16:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1760742914; x=1761347714; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fzMMQHSugdmZyCp1JeztustF68R3ezVs71jCXstAZnY=; b=jtPX8xvBQFQU9hcCBnVRO8tH2O9UpV2SD7EtEmJwd0wGXRmtHWmSr4u1o1ZyIsfo9A v0gX3rSAMC6G6ENp6xdCe4NgK0HlCHIhWCMjqbH4BtQyFT8sUIElx43fbzZTHgL+dxTK 028uY96AzNsjYFTTnx+yAgC9IaIsrsKYsLB8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760742914; x=1761347714; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fzMMQHSugdmZyCp1JeztustF68R3ezVs71jCXstAZnY=; b=kovOjKKZUetnWcv1oRmISU1JEfus4Kl59WQACrb/fzCX7SeKwtOTFpgwsQ65v+qqai 2EIycteT+KWblrubb2Estzqr0MjkmA4joShhR0jrUqIvia8LVImYYsMxcuK+wH0WfLra YDoV4+2rVmiac9DGYJtfgWmwIubO4nqKXINNq/MFo8ExzJDu28l9H7G5pl/gbc/m9hS9 WpMyBRiZqm3gBT7cMfmqdo1tvmWMnbdPwmOBStf/ykBOz5v2YQCAlF5xxR8wy4ePcR89 1csxJwvC41InX3Xe3JplerHYIv9eRy+60txCEamZo9V8nOMPNmnpwb3CRe9R3J133Mj+ 3Y7g== X-Gm-Message-State: AOJu0YyNeiv0Hg5bYg3i/Gls92OWroVn5HF3cOMmjdWJa6Mk9X3d9h2p YazcLiraWVrq7I/zvXeDWEepIh8TxIPzI3Sc43NeiwQbyP7Clga5AS52k0KNB/CwGRpa7z1CC1r qqMKx4Ug= X-Gm-Gg: ASbGncueOTc1wAj02CCrcB3YLDdAd8a9drv6pQjC9LmNFNnvE4LVm1VBS6rq9XrDKvO FlCQbMQlDfWvuZ9y5uUIt1DShzPyYctWCRctyY5+FFvN3pbPriytfrdmeMSxPwBKWjr93qtDyxz d756N+KEyfQzKi4A1VSv4FQfM2of5D3IgazTp5OXfgQzPBaFrP0cJ2fQxCba6hmJd9ZuEiUzab6 wr5yAGjYjMfADFyi91sdP880i+weKz779imLbF9AllB43hz2hhqh5zZze3PPlPo6elsRzIjlwXy mt5FOrHRKQ6RrCdWJxPdWxQkxp4HuUsgK9we/QPJNUDt8OfkaqfmFEguWKJi7Oe5Hfm2ley2DY0 PcGzD7Gw5R+Nrq9NCoaPx5cW09WDcXn0Cuba++UGSmWNFNXBLljTCZoDgHfWWYrQmrkKral4fAt ellbw/ZKJ65NxLsyAn4GYHIixCUP0twgbd+iMR2cV/xnKoCEvEBJ5Ze+mc49tsuQEgsr+901+St za1aKfOD9+e X-Google-Smtp-Source: AGHT+IEZRRiB2i6317Jd5Y2JzDzV1fCUe5/TjugHwi0Q2Y/+Ogj1og1r/juQkhR7I5kJfdMPIuX3Wg== X-Received: by 2002:a05:6000:2082:b0:425:7e40:1e02 with SMTP id ffacd0b85a97d-42704d49a0amr3190603f8f.7.1760742914486; Fri, 17 Oct 2025 16:15:14 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-427ea5b3d4csm1638330f8f.19.2025.10.17.16.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 16:15:14 -0700 (PDT) From: Yoann Congal To: bitbake-devel@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 1/5] schemas: import layers.schema.json from OE-Core Date: Sat, 18 Oct 2025 01:14:40 +0200 Message-Id: <20251017231444.374436-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251017231444.374436-1-yoann.congal@smile.fr> References: <20251017231444.374436-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Oct 2025 23:15:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18187 From: Yoann Congal Import the current version of layers.schema.json (as of 39ae9a1061fcfe8c30df511b6f00e407b80ffc4c) layers.schema.json is used for the "sources" property of the bitbake-setup configuration file. Signed-off-by: Yoann Congal --- schemas/layers.schema.json | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 schemas/layers.schema.json diff --git a/schemas/layers.schema.json b/schemas/layers.schema.json new file mode 100644 index 000000000..659ee8da4 --- /dev/null +++ b/schemas/layers.schema.json @@ -0,0 +1,76 @@ +{ + "description": "OpenEmbedder Layer Setup Manifest", + "type": "object", + "additionalProperties": false, + "required": [ + "version" + ], + "properties": { + "version": { + "description": "The version of this document; currently '1.0'", + "enum": ["1.0"] + }, + "sources": { + "description": "The dict of layer sources", + "type": "object", + "patternProperties": { ".*" : { + "type": "object", + "description": "The upstream source from which a set of layers may be fetched", + "additionalProperties": false, + "required": [ + "path" + ], + "properties": { + "path": { + "description": "The path where this layer source will be placed when fetching", + "type": "string" + }, + "contains_this_file": { + "description": "Whether the directory with the layer source also contains this json description. Tools may want to skip the checkout of the source then.", + "type": "boolean" + }, + "git-remote": { + "description": "A remote git source from which to fetch", + "type": "object", + "additionalProperties": false, + "required": [ + "rev" + ], + "properties": { + "branch": { + "description": "The git branch to fetch (optional)", + "type": "string" + }, + "rev": { + "description": "The git revision to checkout", + "type": "string" + }, + "describe": { + "description": "The output of 'git describe' (human readable description of the revision using tags in revision history).", + "type": "string" + }, + "remotes": { + "description": "The dict of git remotes to add to this repository", + "type": "object", + "patternProperties": { ".*" : { + "description": "A git remote", + "type": "object", + "addtionalProperties": false, + "required": [ + "uri" + ], + "properties": { + "uri": { + "description": "The URI for the remote", + "type": "string" + } + } + }} + } + } + } + } + } + }} + } +} From patchwork Fri Oct 17 23:14:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BFE0CCD1A5 for ; Fri, 17 Oct 2025 23:15:25 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web11.5848.1760742917300515683 for ; Fri, 17 Oct 2025 16:15:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=MuYK+RvP; spf=pass (domain: smile.fr, ip: 209.85.221.45, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4282fba734bso83606f8f.0 for ; Fri, 17 Oct 2025 16:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1760742915; x=1761347715; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c0JingrpYfcCn9RgosdQhIaESi8TGd6IafPSLiMwi8A=; b=MuYK+RvPRrUOw2xe0ZnxifiYOq/OibBmORg9+hnz/U1YLy9ek1i7vAS1vcVWfoBpu0 aKHaWqwkY8KLEnKoMwGJklt8EdeQnSSLm5ZISTdWh1uD1Sk7/OuGe+jcmmJKu4CThTMt PXQfeXrYVlzxfQGqM9jS3uWJfntVAmvtHN7KU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760742915; x=1761347715; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c0JingrpYfcCn9RgosdQhIaESi8TGd6IafPSLiMwi8A=; b=qWXIdNo27reeIYRvim1BR7m0Ii5qsYfLgWqSTxKxWfxnaQCIlSa7wsfq8aT6TJ7VlH m2NOfhMDLhyo1AhRDaqf2z7dtit+KJzpsEbTvir5H0Yuno7bRXfMR16Pn0FS8/6on9tL VsqbkQuxuhOarbnTdeBf72OwD3FLHr/8SuBFpcLOFC/vg3EF2kSXEcdijfy8LSPmPpIU puzDTBjxzXFUIfTf6crARrJPe/dqsQVmV6SPwT+IuJmkX+L7idRJjRF3G0KtR56K5ST6 fMsY26sOu2F/lAns+Atm8bvEZbWEYTkGj1uNE0sJGwqkuzo79D995Qioe8a5kXz2FFC0 BqAg== X-Gm-Message-State: AOJu0YxjmwX2YKOU9xTkZqQpm7e6DMLUtqo7b7MS+hZd2nhgQvH8MyR6 kU666aZwBqunLhasoLCIAkXPLb0vJO6CaJ3sI8RDHwWrFHhCQv8m3Gbu+3Svz6bGcchnK7wrusb tNDQCXw4= X-Gm-Gg: ASbGncuWzRWUPzvoeJLY8bn33OtSkWVAFLdjcb+lQdF2Hepq2LoDpwKlwXw7f/rRTLU vDk0Mi1LRNfCIBfE2daKgG6EeP1A22qT5UGxcyViEJy0BJEqwaNzOhDltgCTAKsMnA/DSttwIRK AdrbeOx3o+NAmz4doYfWCqQZFNTKbeF7I6gR4TZFMkvN/qkWSA+WDpSfoHUR7tWJdsVka4jljQR T+lBqL1H21VUnc1L5jmksrxdclDqXqCyRaUCjXzi2/rnJACJEla8IaHhlGU+kDkWjoUGeDLt2Yb f4E9rJokmsJlj7+qstLDRpG26YlBrb6hIem5aMbbVZLloSaZsJWcS/WHMbIIvkVHYH0aoPjgQwY eC+2FaH6PUk2jl0Ad+3jCLSX8P2cA1Squkw0KQiyvwVRM6iNLqX+UP+WkdU3m/RcokGJqfU/9/D G4WHcbAsN8ucnYeYGWZIzwa42p5+T6nUKC1502F+On5fLb+eegwDGfXDDkzbPAHCK5xYKZkeRcz nnfnjEJ/ze/8qk9tErdvqY= X-Google-Smtp-Source: AGHT+IGq88gU9d5RN74BG1xKT4U0+V0QILbFMn3Wx3xy2diTwkXxfInUVI0gb4icMK7BjFykkk/lDg== X-Received: by 2002:a5d:5d11:0:b0:425:825d:25d5 with SMTP id ffacd0b85a97d-42704d9e995mr3578248f8f.45.1760742915496; Fri, 17 Oct 2025 16:15:15 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-427ea5b3d4csm1638330f8f.19.2025.10.17.16.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 16:15:14 -0700 (PDT) From: Yoann Congal To: bitbake-devel@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 2/5] schemas: add $schema specification to the layers schema Date: Sat, 18 Oct 2025 01:14:41 +0200 Message-Id: <20251017231444.374436-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251017231444.374436-1-yoann.congal@smile.fr> References: <20251017231444.374436-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Oct 2025 23:15:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18188 From: Yoann Congal JSON schemas exist in different iterations. It is recommanded to specify which specification the schema follows with "$schema"[0]. [0]: https://json-schema.org/understanding-json-schema/reference/schema Signed-off-by: Yoann Congal --- schemas/layers.schema.json | 1 + 1 file changed, 1 insertion(+) diff --git a/schemas/layers.schema.json b/schemas/layers.schema.json index 659ee8da4..6d05a1f84 100644 --- a/schemas/layers.schema.json +++ b/schemas/layers.schema.json @@ -1,4 +1,5 @@ { + "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "OpenEmbedder Layer Setup Manifest", "type": "object", "additionalProperties": false, From patchwork Fri Oct 17 23:14:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C1BECCD1AA for ; Fri, 17 Oct 2025 23:15:25 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web11.5849.1760742917846864206 for ; Fri, 17 Oct 2025 16:15:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=QAmnhWbg; spf=pass (domain: smile.fr, ip: 209.85.221.51, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-426f1574a14so1476201f8f.3 for ; Fri, 17 Oct 2025 16:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1760742916; x=1761347716; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FihqOw83/3BqydENvAtKluDIncNWS15FK1Evg7jj5Oo=; b=QAmnhWbg1W2MSWwauQqSer02KM+lB95y/03fAzb4wJRnHN0XfihzAEJmxDfGeq2Fu+ oTMYi8dUO+XnTU3NL8r8s/tvNp8ZLcuooph76YNxJkJj2hPvguf5NqG/pf24Ep1rvr/l G/YN/xa2a4+Yq+s7D0NHA6yaq51botnv/Iaa0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760742916; x=1761347716; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FihqOw83/3BqydENvAtKluDIncNWS15FK1Evg7jj5Oo=; b=mXhhB2efXTxHh4h+NC1ZJjgCz1OjJonnnJkaChR4ItVCn4OF3q+RgZ2rLV6e4/KR9K 0brXIsBEo8rI1FotFAPZAwOoJGMQJ8Jlp+cHrFb5WIqzfXh0xLGOykW2Jjx6EJlkCHXB Yvn6Fz8O1+eovI3+WWLGI7vkOwpECZG9hTIMfW67FJaj69tiugSJA1o/QY7JO+Q4trRw oADQ3hX3lWdeVihMvTDyS0Q2Os6X85CTEISwFJn67cvVKmN8c5d47HVJYuxYC2Clve4e HRmdPdiYTglUhkWgGdxpnsPdrE9jNSvMzH3fJU0V+LdRyt7NA4xG2VLwY68GRMXxiq2B WmaA== X-Gm-Message-State: AOJu0YwNIhfsKpg/YNPudNjj9h88zTcDj24QEn80HgBLA/W52MaBtVte /zurjmFb/oUifoU2yT9Y03tVTpdx7b8wk2pE/xpD7exJkjICOXVsfIQhl4BpwCD7lLckQzlr2s/ RD4HTe9s= X-Gm-Gg: ASbGncuwz2cZQfJBtP8JRCR1fyX4XCzqqXETaMHpkK2o+IcI6+WRZCAFzSBBuunNDzH iL9Nj5hrySe8mKmEFNoQhILn9S5E2ZhL9wIDe8Z+/cMZQigb1pGtTNBdYPKavNOaolsKdP4uAGv lptWyASKurqBlI5zmi/Ih/rDmv3noGDoYLVdi9XXzgn3AjScSHSkpvygLSb90XPptj8d+3f8ZjK ycqa8EJb6phWdcEeCrdlCKIakc+Rq7BYMeiYduweG1ZtSw2DJGreTo1FJ5PLUodsUaT3om4apDu chsdTw8INeKDJjnICd37JayELpNMLUPLxwKlU6dByFUMargjQYHpNTQJemggzxUBVmXmTq8Y2Z8 patJhXvP+Jyukq/DBy7Fv8eB+crpZdhk1SDOExMAcwGIj2IZJsvzam3QbWw61n9KM8SMsxaGXKd XlVoHeTcLH0pwNv9O0eoJcL+JC6HgzQj6zzAv+q4GnliNvnMXdzPNMQ+BIJy85qSQa5XFdphJuz 3sC3fn2gT0TaHTWaZi+z/8= X-Google-Smtp-Source: AGHT+IFC6y5CL6V91WeQdQtd+B+OScSturcQzCI18DNinJsj8P0wC6N5RvNHpmK8+kWZng14C3gKzg== X-Received: by 2002:a05:6000:2303:b0:427:6c7:66f8 with SMTP id ffacd0b85a97d-42706c76a55mr2840623f8f.52.1760742915912; Fri, 17 Oct 2025 16:15:15 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-427ea5b3d4csm1638330f8f.19.2025.10.17.16.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 16:15:15 -0700 (PDT) From: Yoann Congal To: bitbake-devel@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 3/5] schemas: Add bitbake-setup JSON schema Date: Sat, 18 Oct 2025 01:14:42 +0200 Message-Id: <20251017231444.374436-4-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251017231444.374436-1-yoann.congal@smile.fr> References: <20251017231444.374436-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Oct 2025 23:15:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18189 From: Yoann Congal This schema validates configurations in default-registry as well as the configurations used in bitbake-setup selftests. Note: it uses a reference to the layers schema for the "sources" section. One can validate a bitbake-setup configuration with: pip install check-jsonschema check-jsonschema --schemafile ./schemas/bitbake-setup.schema.json --base-uri=file://. $BB_SETUP_CONF RFC: I don't know how strict/loose I should make the schema. I've tried to match what does accept/reject the current bitbake-setup: * If present, a "bb-layer" can be an empty array. * bb-setup accepts "configurations = []" but it results in a impossible choice in interactive mode. I rejected that in the schema and plan to fix that in bb-setup as well. * In each configuration, "name" and "description" are optional but the flatten configuration must have them. I don't know if we can/want to represent that in the schema. * bb-setup need at least one of "bb-layers" or "oe-template", that is not enforced in the current schema. * '"additionalProperties": false' makes "comments":"..." impossible right now, I plan to add them later. Also, I'm not sure this is the right path to store schemas. Signed-off-by: Yoann Congal --- schemas/bitbake-setup.schema.json | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 schemas/bitbake-setup.schema.json diff --git a/schemas/bitbake-setup.schema.json b/schemas/bitbake-setup.schema.json new file mode 100644 index 000000000..a5cef7633 --- /dev/null +++ b/schemas/bitbake-setup.schema.json @@ -0,0 +1,108 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "Schema for bitbake-setup configuration files", + "type": "object", + "required": [ + "description", + "bitbake-setup", + "version" + ], + "properties": { + "description": { + "type": "string", + "description": "Description of the bitbake-setup configuration file" + }, + "sources": { + "$ref": "/schemas/layers.schema.json#/properties/sources" + }, + "bitbake-setup": { + "type": "object", + "description": "BitBake-setup configurations", + "required": [ + "configurations" + ], + "properties": { + "configurations": { + "type": "array", + "minItems": 1, + "$anchor": "configurations", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the configuration" + }, + "description": { + "type": "string", + "description": "Human-readable description of the configuration" + }, + "bb-layers": { + "type": "array", + "description": "List of BitBake layers to include", + "items": { + "type": "string" + } + }, + "oe-template": { + "type": "string", + "description": "OE-template configuration" + }, + "oe-fragments": { + "$anchor": "oe-fragments", + "type": "array", + "description": "List of BitBake configuration fragments to enable", + "items": { + "type": "string" + } + }, + "oe-fragments-one-of": { + "type": "object", + "description": "Mutually exclusive bitbake configuration fragment", + "patternProperties": { + ".*": { + "type": "object", + "required": [ + "description", + "options" + ], + "properties": { + "description": { + "type": "string", + "description": "Human-readable description of the fragment category" + }, + "options": { + "$ref": "#oe-fragments" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "configurations": { + "$ref": "#configurations" + }, + "bb-env-passthrough-additions": { + "type": "array", + "description": "List of environment variables to include in BB_ENV_PASSTHROUGH_ADDITIONS", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "version": { + "description": "The version of this document; currently '1.0'", + "enum": [ + "1.0" + ] + } + }, + "additionalProperties": false +} From patchwork Fri Oct 17 23:14:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 104BDCCD184 for ; Fri, 17 Oct 2025 23:15:25 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web10.5876.1760742918464621553 for ; Fri, 17 Oct 2025 16:15:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=NL42MVNC; spf=pass (domain: smile.fr, ip: 209.85.128.43, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-47106fc51faso26748315e9.0 for ; Fri, 17 Oct 2025 16:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1760742916; x=1761347716; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TanCxKK4WRONBkwvniAxY86hYDc8lq4CyhbwbvBOTTI=; b=NL42MVNCRYDRe9ZrkxhiL6X3UMqprgxWRgwcTw8f4IVFP+/X3UcJeR+N+KqaWKH7vh dQR1x8zqIeXmT9tyoyNKdBmpr7EIXFaD1P9wWBv0q6YmCbmDR3kffvJlXPQuLqLWrJ27 BjiuG5alpxTwxjIOh7jKc7zSKb0432pTOZ12A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760742916; x=1761347716; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TanCxKK4WRONBkwvniAxY86hYDc8lq4CyhbwbvBOTTI=; b=TytOHCLn02Qgdnbn/rmw4kYGHESPljhjKZUHpLBkucxdQ1Xi5Nzadvpx5s+6fDbRV4 iZnigCPvIc3XRbZhkre5uiKYN4tUgOQXXGlq/+9oQG3UvTBkCIz4rJu8Sj/bSsybHOjt 614N2kUmJm5ob8yDkF/7RuyX/AiHsjm7w0hMSdG2aE4k+EHeSFDhwYxLRXAq5V5RI07+ i+EwhTwztPJ9ugLp+FpnjoUF6jwox4cEM54018Tv+genIF6Yw9iwkk4erBwibRlR1c/d wc9F8IgE5AVL+z8ljbJ7h5NfB1OA/hOEnImhAd9RyQHb460GSTLLXd/eqXPOm0Ab7+bk Dk6w== X-Gm-Message-State: AOJu0YyK60eHYdB33dxXLGGzDQHWBbXR6+MGr0DLXqlTMDokGuOEYD+w ibrtvT/RJnXOBiCaok45SDrogl61gmkA8Qws5h/671M2cK65LH1bbXIKup0rEJu618wB2LAUv/J Sd0yu7zI= X-Gm-Gg: ASbGncuGeXbOoz9ACmCJ77AguzGFyzGZBNl8nztq89rr6orctWEMIxrt8bR62IcOaRN Q+l917NNyUEeXq3h7k0USqJKo9mA1Gbf5K8ze3SCFIJ0Y6RfowD8mhIUGNMN0AImMRIzs3Qf75X DI5AgOf5Rrp+vs8+A3SLSAIQCuhOnhooZlrtG6fPt8fxGWOT0B00NTeD9C7O2WM/yyNZcyzoCx6 6SI8lKohWmsqsQKG+/1HJtC20uGJgWQN7A4mIbghkYatvcruVozg5papLArI7uU4lNZHm46wXw7 RDLckLRxXblriQ/O5Cu/EQxH9IvD6w9M4c2A9RPZj+1SDIFv9rZF6zd/PgsD/X5d8cOyUttV8z8 VqS7yfxWH4+HVgc3joyBkUGR44N3PJF+YIPWVenm47heov/iu6KrvSKO2VVrCWgw8palVwaGgRb laXlpOdKuJ+5aajnGw0U0SSm0ntc39rGApZT7P8YuGljamJYSJQOJ9vHtoV6NkOuNXEgASNQ4Sd DFwIqKQUxua X-Google-Smtp-Source: AGHT+IH/2TfXIfV94NzzPznDfrDV7NECNHzlNBvjLzLyf0YfsaiYO0rKwpxtHUrygvC0xhZEiY9blw== X-Received: by 2002:a5d:59af:0:b0:427:6a3:eff6 with SMTP id ffacd0b85a97d-42706a3f01fmr3196811f8f.26.1760742916448; Fri, 17 Oct 2025 16:15:16 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-427ea5b3d4csm1638330f8f.19.2025.10.17.16.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 16:15:16 -0700 (PDT) From: Yoann Congal To: bitbake-devel@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 4/5] bitbake-setup: Add an option to validate the schema Date: Sat, 18 Oct 2025 01:14:43 +0200 Message-Id: <20251017231444.374436-5-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251017231444.374436-1-yoann.congal@smile.fr> References: <20251017231444.374436-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Oct 2025 23:15:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18190 From: Yoann Congal This adds a dependency on "jsonschema"[0] (plus recursive dependencies), but these dependencies are only used is the --validate option is used. [0]: https://pypi.org/project/jsonschema/ Signed-off-by: Yoann Congal --- bin/bitbake-setup | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 38bb8099f..a96262c10 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -389,6 +389,43 @@ def choose_fragments(possibilities, parameters, non_interactive, skip_selection) choices[k] = options_enumerated[option_n][1] return choices +def validate_bitbake_setup_schema(bitbake_setup_conf): + """ + Validates a bitbake-setup configuration file. + + Raises jsonschema.exceptions.ValidationError if the configuration file does + not match the schema + """ + import jsonschema + import jsonschema.validators + import referencing + import referencing.exceptions + + SCHEMAS_PATH = os.path.join(bindir, "..", "schemas") + + def retrieve_resource(uri): + """ + Retrieve schemas from /schemas/* URIs, reading them from + $BITBAKE_DIR/schemas/* files + """ + + if not uri.startswith("/schemas/"): + raise referencing.exceptions.NoSuchResource(uri) + + schema_path = os.path.join(SCHEMAS_PATH, uri.removeprefix("/schemas/")) + + if not os.path.exists(schema_path): + raise referencing.exceptions.NoSuchResource(uri) + + with open(schema_path) as f: + schema = json.load(f) + return referencing.Resource.from_contents(schema) + + registry = referencing.Registry(retrieve=retrieve_resource) + with open(os.path.join(SCHEMAS_PATH, "bitbake-setup.schema.json")) as f: + bb_setup_schema = json.load(f) + jsonschema.validators.validate( bitbake_setup_conf, schema=bb_setup_schema, registry=registry) + def obtain_config(top_dir, settings, args, source_overrides, d): if args.config: config_id = args.config[0] @@ -422,6 +459,9 @@ def obtain_config(top_dir, settings, args, source_overrides, d): config_parameters = [] upstream_config = {'type':'registry','registry':settings["default"]["registry"],'name':config_id,'data':json.load(open(get_registry_config(registry_path,config_id)))} + if args.validate: + validate_bitbake_setup_schema(upstream_config['data']) + upstream_config['bitbake-config'] = choose_bitbake_config(upstream_config['data']['bitbake-setup']['configurations'], config_parameters, args.non_interactive) upstream_config['bitbake-config']['oe-fragment-choices'] = choose_fragments(upstream_config['bitbake-config'].get('oe-fragments-one-of',{}), config_parameters[1:], args.non_interactive, args.skip_selection) upstream_config['non-interactive-cmdline-options'] = [config_id, upstream_config['bitbake-config']['name']] + sorted(upstream_config['bitbake-config']['oe-fragment-choices'].values()) @@ -753,6 +793,7 @@ def main(): parser.add_argument('--setting', default=[], action='append', dest='cmdline_settings', nargs=3, metavar=('SECTION', 'SETTING', 'VALUE'), help='Modify a setting (for this bitbake-setup invocation only), for example "--setting default top-dir-prefix /path/to/top/dir".') + parser.add_argument('--validate', action='store_true', help='Validate configuration files against the schema (need jsonschema)', default=False) subparsers = parser.add_subparsers() From patchwork Fri Oct 17 23:14:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CD4ECCD1AB for ; Fri, 17 Oct 2025 23:15:25 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.web11.5850.1760742918787996491 for ; Fri, 17 Oct 2025 16:15:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=WTii7lyA; spf=pass (domain: smile.fr, ip: 209.85.221.53, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-426ff694c1fso1699599f8f.2 for ; Fri, 17 Oct 2025 16:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1760742917; x=1761347717; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gb7uemrUEuq7Rt9HkT5uxygryWpuO8MVUihJvYvbZAw=; b=WTii7lyALkOLICGYXC5FbaInGtsXn51J+GtLp2pyhPrghsG/7eR/vdFyByorfW3NWh pV3opZ+jyNg2lWDDkt5U3RdUWEGRY7A2XfsVe85y0uGPk7sdLvctLDaRyPt+gWaJSkoY aqzkYzJK09WS6RZWdH9njDNfpmLvMlAHeDKmI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760742917; x=1761347717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gb7uemrUEuq7Rt9HkT5uxygryWpuO8MVUihJvYvbZAw=; b=dsR3AtsUZ1Wfi9iW2+WjXjTr5wlF6qj8Z2hzluN+d/xX4aSlmze5Gsa8rpoND9mM8q culTtexk9w76Vj86d6NJY0JiBmLnVPQ2i4W1IUkUQ4hBFfl/LyjVonB/E05zczlqDFOL iaNMNqwnVIEfleNh+K2Mo8SuIwYfFkoqsDL6DaEco0wSifduvYIOeZllEtupkbet76Ju tkH86x76lR/Q9oiFEKM2QTzzZmg+kBfYCvr6Xs5dnk5JznBgE9qM+el3N1X8HrY2rq1X UYXGpfqx38fuwg7SlQd7tS/TJgZHAkois9yr0ZbCDz4lrD45i04Tc8MuT/78kGfP8yNM 993g== X-Gm-Message-State: AOJu0YwQup0FjFu2Xk9kJP5oueFi2I6KyvVMBJjH+Igvl/9mzfzOzwAk O3dXP1SAYe/xr9E48DsBGckolVJRu1sGLMvqacJ6v83uQZ9s1TxArfXTqrge9GZ+kolTrNidC0K Z0nAsfXs= X-Gm-Gg: ASbGncsTxS8SYmyMTOIQBjup/N+Wjab9SH/+3BGWwUvOa622ilzG3gTx81oRbSE5u+I U0ep4zC74xkW+zOXyRuYApp0sMcSPFiCF5YLdtjmvVtqFTYiImVNMBNeWoeuijbjtEFQTMaNK0y YUAqtklnrTG6uzp43vbe2K9KnKpyS2EetcmnWcBM8uSIyk9Ry13sLwRNF4SKpAar72A8Dr9Bqji bHfRZEAQeae9OZN1OtrR7CfsmQlGqCtEupM31cWyB2dbEghBbXqop+NI3NM7vE4kyWiI5XaH3RC M9MzBqgwAMBFT21xEn5UsCKjgDAtzb4zQ5qv+Rx1yt90sdCDGIFFVrX2JoTdbY/KnNLHC4qIRGv s7L6XG7rWXaHu/BpVle9i8w1+Bet/mJbpUEub941rqvjNaLDtosiRzGosw65bqJGbQre5AtJDjG 6KgeujaqL/910bOVuR+SWv+gADJnw6rdAkxNITJBbpBiQriPEPvurEG/NRLxOwMsQ+MhmV5vLFq 5sAvv9kQKk72sQoB5n5QpE= X-Google-Smtp-Source: AGHT+IGQd0eQ5Lk2JzmYg4V8vLZH3e9AxlUWogd5ere5GStLFuRKJKRSbqLYYxhyPJMeBNjDJUjdqw== X-Received: by 2002:a05:6000:3101:b0:426:d4f0:fc13 with SMTP id ffacd0b85a97d-42704db9ed9mr3930839f8f.50.1760742916970; Fri, 17 Oct 2025 16:15:16 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local (2a01cb001331aa0017b58d8bf04048c3.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:17b5:8d8b:f040:48c3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-427ea5b3d4csm1638330f8f.19.2025.10.17.16.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Oct 2025 16:15:16 -0700 (PDT) From: Yoann Congal To: bitbake-devel@lists.openembedded.org Cc: Yoann Congal Subject: [RFC PATCH 5/5] lib/bb/tests/setup.py: validate JSON schema during tests Date: Sat, 18 Oct 2025 01:14:44 +0200 Message-Id: <20251017231444.374436-6-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251017231444.374436-1-yoann.congal@smile.fr> References: <20251017231444.374436-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 17 Oct 2025 23:15:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/18191 From: Yoann Congal This enable testing the validation code as well as the schema itself. But, it adds the validation dependency ("jsonschema") to bitbake-selftest. RFC: I know adding non-stdlib dependencies is not-trivial so this patch can be skipped. Signed-off-by: Yoann Congal --- lib/bb/tests/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py index e320cdf56..3469bcc94 100644 --- a/lib/bb/tests/setup.py +++ b/lib/bb/tests/setup.py @@ -294,7 +294,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) } for cf, v in test_configurations.items(): for c in v['buildconfigs']: - out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c)) + out = self.runbbsetup("--validate init --non-interactive {} {}".format(v['cmdline'], c)) buildpath = os.path.join(self.tempdir, 'bitbake-builds', '{}-{}'.format(cf, c)) with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f: config_upstream = json.load(f)