[{"id":24440,"web_url":"https://patchwork.libcamera.org/comment/24440/","msgid":"<YvF0zqpOg6vfeFVm@pendragon.ideasonboard.com>","date":"2022-08-08T20:40:46","subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml_parser: Report\n\tfilename on failures","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Mon, Aug 08, 2022 at 09:30:26PM +0100, Kieran Bingham via libcamera-devel wrote:\n> It can be helpful to know 'which' file failed to parse if there is a\n\nOr even to know which file failed to parse, without quotes :-)\n\n> failure.\n> \n> Report it to the user in the error message.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n> \n> This was failing for me while adding an IPU3 tuning file - with no\n> indication as to where to look.\n> \n>  src/libcamera/yaml_parser.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\n> index c96e99e1317c..dfbfac304d3d 100644\n> --- a/src/libcamera/yaml_parser.cpp\n> +++ b/src/libcamera/yaml_parser.cpp\n> @@ -807,7 +807,7 @@ std::unique_ptr<YamlObject> YamlParser::parse(File &file)\n>  \tstd::unique_ptr<YamlObject> root(new YamlObject());\n>  \n>  \tif (context.parseContent(*root)) {\n> -\t\tLOG(YamlParser, Error) << \"Failed to parse YAML content\";\n> +\t\tLOG(YamlParser, Error) << \"Failed to parse YAML content from \" << file.fileName();\n\nWith the line wrapped\n\n\t\tLOG(YamlParser, Error)\n\t\t\t<< \"Failed to parse YAML content from \"\n\t\t\t<< file.fileName();\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t\treturn nullptr;\n>  \t}\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E42CAC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  8 Aug 2022 20:40:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 644A36332B;\n\tMon,  8 Aug 2022 22:40:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7291663315\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Aug 2022 22:40:57 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E136B49C;\n\tMon,  8 Aug 2022 22:40:56 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659991258;\n\tbh=OZkk2QhuKgoceWaP08LUIzuiYFoW3Wg7SIp0rOkeL0g=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=i0iLzGwHqsEoGvVz2E3f9obe8BxtJI4xoVZmv1Yxanyxwk0rVO2O4jQ58O4HvnOXt\n\tvqia207LPfD6Ky0QcjHxmA56PzH6LCOFO+0kRd4tr5X7NtYjN9RkP9ulBSPXmDOzsH\n\t8Fqx7cHHSTDcQsekXMuYF89rsF9pzZLLcHFHn0IgKvxeeQoMiP+zjuK7IPHljKmOdQ\n\ti8kqdrydzEBMq4iwfTvWyh84ds6YAPbc1mpA5uLy/TXnqC59Pi4o8NAJDsMXPWLEsi\n\t8QgJ+3Pe5hz2AMWAe+me8MGDI0sOdDOMTsG+CB0vDLhfLvREaEEiQdyXSc7OXM7beK\n\t+AR2GFIpORHFg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659991257;\n\tbh=OZkk2QhuKgoceWaP08LUIzuiYFoW3Wg7SIp0rOkeL0g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=llonspnFyRnz5bx/pz+fm7yjrrXiQDkpuCEXJpKojzjCsZCMJElktwJnXOPWQA846\n\twI5hiGt56uyCFrm4+PLYDNESdZFB6ui1lO4n9R7TZIkKGtPFK+Ec7ZQwM8VQkdW4x1\n\t3CZiRbcjESVeJEM+3xXAzjuKDyqBvoH6HP/xB+fc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"llonspnF\"; dkim-atps=neutral","Date":"Mon, 8 Aug 2022 23:40:46 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YvF0zqpOg6vfeFVm@pendragon.ideasonboard.com>","References":"<20220808203026.2515013-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220808203026.2515013-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml_parser: Report\n\tfilename on failures","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24507,"web_url":"https://patchwork.libcamera.org/comment/24507/","msgid":"<dc00e8a3-220c-3239-2904-2f907df02ab1@ideasonboard.com>","date":"2022-08-10T07:01:32","subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml_parser: Report\n\tfilename on failures","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch\n\nOn 8/9/22 02:10, Laurent Pinchart via libcamera-devel wrote:\n> Hi Kieran,\n>\n> Thank you for the patch.\n>\n> On Mon, Aug 08, 2022 at 09:30:26PM +0100, Kieran Bingham via libcamera-devel wrote:\n>> It can be helpful to know 'which' file failed to parse if there is a\n> Or even to know which file failed to parse, without quotes :-)\n>\n>> failure.\n>>\n>> Report it to the user in the error message.\n>>\n>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n>> ---\n>>\n>> This was failing for me while adding an IPU3 tuning file - with no\n>> indication as to where to look.\n>>\n>>   src/libcamera/yaml_parser.cpp | 2 +-\n>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\n>> index c96e99e1317c..dfbfac304d3d 100644\n>> --- a/src/libcamera/yaml_parser.cpp\n>> +++ b/src/libcamera/yaml_parser.cpp\n>> @@ -807,7 +807,7 @@ std::unique_ptr<YamlObject> YamlParser::parse(File &file)\n>>   \tstd::unique_ptr<YamlObject> root(new YamlObject());\n>>   \n>>   \tif (context.parseContent(*root)) {\n>> -\t\tLOG(YamlParser, Error) << \"Failed to parse YAML content\";\n>> +\t\tLOG(YamlParser, Error) << \"Failed to parse YAML content from \" << file.fileName();\n> With the line wrapped\n>\n> \t\tLOG(YamlParser, Error)\n> \t\t\t<< \"Failed to parse YAML content from \"\n> \t\t\t<< file.fileName();\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n>>   \t\treturn nullptr;\n>>   \t}\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 032CDBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 07:01:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4C9486332B;\n\tWed, 10 Aug 2022 09:01:39 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 49BC861FAB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 09:01:38 +0200 (CEST)","from [IPV6:2401:4900:1f3f:c7a1:27b3:9637:38a7:6084] (unknown\n\t[IPv6:2401:4900:1f3f:c7a1:27b3:9637:38a7:6084])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1947D481;\n\tWed, 10 Aug 2022 09:01:36 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660114899;\n\tbh=W8JCmQji7jjlt1VS5NdBycaZlznL4db/DD0LAY/MwDk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=dy1WsnY66BrZlmslV7pOlx0KJl4rfjkHMWX7oaaRr/NmWzc4H0mdXR8iLdZY625Bs\n\tYpYRnCI1iwjw+XDYQl0hqBWTXRq7YtdePpBJ+YegGqRXEJOejUfBS9BsJG7TShdXC9\n\twyexWG30/XzNK0SVc0k2/a1TYDRC8BkzuhjQyBaB62vTUP5zWFM6rfRXWgd+bQUxKh\n\tgNgzYtZMPdTi2SGDf1UNjHJ/g7+NQJUrWsBMXRu7aGMgEzvGKtRwexWZdT7YYsjPjh\n\tSSwtqpC3jKIBbnEyaspwekKnOcC0NgBOPmaEwT0ZcGZw4p7MfcXImDQir16zTYKn1Z\n\t+m6mNFehBWN8g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660114897;\n\tbh=W8JCmQji7jjlt1VS5NdBycaZlznL4db/DD0LAY/MwDk=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=vOxS8a0Z9U9QzsrpnjIW9Q56ydgCza+msd4YvhNU1XE1JVTlLM6H8j4bAUVnH/b2v\n\tDsN382Is5jomZhxqWqHLNgWaBYRCpLjP21tATCLOjoq/k2P6z+AbooIhS4Rj+rzeBr\n\ta/3oeiqqgXwElwd5mkGpvJh4Xt53lrGyaM+WHacM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"vOxS8a0Z\"; dkim-atps=neutral","Message-ID":"<dc00e8a3-220c-3239-2904-2f907df02ab1@ideasonboard.com>","Date":"Wed, 10 Aug 2022 12:31:32 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","References":"<20220808203026.2515013-1-kieran.bingham@ideasonboard.com>\n\t<YvF0zqpOg6vfeFVm@pendragon.ideasonboard.com>","In-Reply-To":"<YvF0zqpOg6vfeFVm@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH] libcamera: yaml_parser: Report\n\tfilename on failures","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]