Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1016027ybz; Wed, 22 Apr 2020 12:00:05 -0700 (PDT) X-Google-Smtp-Source: APiQypKb90OVK0QIZdtDMmErVSYF8TW3GymRUc2gUxdYhA3oc/ezJHDX/WnrXJHTJozCiJe8Z/5M X-Received: by 2002:a17:907:40ec:: with SMTP id nn20mr25831799ejb.294.1587582005286; Wed, 22 Apr 2020 12:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587582005; cv=none; d=google.com; s=arc-20160816; b=0LTSKPydxo3jAHrBnKrJ5mgJvmiNtRNRalRZKnAxCyhuouUk7Erzz4t8nu9RIChTEs Ezj7V30qi/wS629zIDvTGXDQ1WqgLIo575OjwcaubaVA2pMixAR9X8NzU5/Hu4cAGpPB cUAXACfjhHw/zXUy7xTLnGaUF0hr4a18NcibieiEI0rxIfSB0VIqgS6xJZFF9z6Am8Gb GwbAvN+kCbrlTkrNV7wkTUywqocN6J/j0Jvon0WOWkWMx8qu6GCytkFP+O8qSRnMxfWt ssivDq9lHYfK5UGdHhrpRh1hGfE8fTz7jZNMjkq9CBnJggp9LZwRACHXOCAShJhHHKht V0RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CLMHva9gANZ5xFjWyud5ALAu25G/9v0j+nEtdPO/xcU=; b=AvmTO+kW9c7vnE4ShZ7roK+GKl66c/uZA0fCCnEbx3Dq+OmoOCRKD3zuL5zppXwE1h rmleRhnT5BC3O1xpSSVMLLE6sA0VMFIeAZxPLos9lCaq+LyR7veJv7Q0paK7Gba15RaI 34liIW0A0ot7BnYq/hGfwsIdZ7KMyMNccgHD7wj7FB324BKuDvqWM58EMbX3VMDY+zu3 WeOWif6Xbe96IY6+hdY4oa63H8tTRQehdyMlzzXxY4Nx/Y0BslkYdFivOkeoD5ER5vfV c64f7zTRrF3W0gPphqBoV4fXzEtzMYwil1Jv8xeDrK/ahYJYgyyagzTfblFXQFdlfNi0 TBhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R7PsJtfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si23129edj.169.2020.04.22.11.59.41; Wed, 22 Apr 2020 12:00:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R7PsJtfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgDVS4K (ORCPT + 99 others); Wed, 22 Apr 2020 14:56:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:36924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbgDVS4K (ORCPT ); Wed, 22 Apr 2020 14:56:10 -0400 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A0D32098B; Wed, 22 Apr 2020 18:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587581769; bh=v69b7vmZ0eLZh99wm9q28w3sHZaF7q7WgriZl7iMEOw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=R7PsJtfr815M6Brz+ry8bWH9Y1hGlVLp9bQvXw9Vchv8T2gb1ss7CDapjfIOR7vhk jsZFTaDaDC+SbdXaEkfZRRwJ7odrdQGUr7bskWeBTFE56+6M8V8JCopvDHTkpFC3vQ ZYn18s+4O9H3LhJonXfGV/ITThQv+iMBc1bEPsC4= Received: by mail-qv1-f41.google.com with SMTP id bu9so1445890qvb.13; Wed, 22 Apr 2020 11:56:09 -0700 (PDT) X-Gm-Message-State: AGi0Pua7kuLioJSadLef7eyK0A+OSQ8ZlKyHvw9R9v5bErp0CP71XJDX 35+k8q/luN/PM5OUYLRCiHMebMqLOCSwdJn0DQ== X-Received: by 2002:a05:6214:1848:: with SMTP id d8mr379136qvy.136.1587581768236; Wed, 22 Apr 2020 11:56:08 -0700 (PDT) MIME-Version: 1.0 References: <20200421212004.6146-1-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Wed, 22 Apr 2020 13:55:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: Fix command line length limit calling dt-mk-schema To: Masahiro Yamada Cc: DTML , Linux Kernel Mailing List , Laurent Pinchart Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 12:59 AM Masahiro Yamada wrote: > > Hi Rob, > > > On Wed, Apr 22, 2020 at 6:20 AM Rob Herring wrote: > > > > As the number of schemas has increased, we're starting to hit the error > > "execvp: /bin/sh: Argument list too long". This is due to passing all the > > schema files on the command line to dt-mk-schema. It currently is only > > with out of tree builds and is intermittent depending on the file path > > lengths. > > > > Commit 2ba06cd8565b ("kbuild: Always validate DT binding examples") made > > hitting this proplem more likely since the example validation now always > > gets the full list of schemas. > > > > Fix this by putting the schema file list into a temp file and using xargs. > > > > Reported-by: Laurent Pinchart > > Cc: Masahiro Yamada > > Signed-off-by: Rob Herring > > --- > > Documentation/devicetree/bindings/.gitignore | 2 +- > > Documentation/devicetree/bindings/Makefile | 3 ++- > > 2 files changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/.gitignore b/Documentation/devicetree/bindings/.gitignore > > index 5c6d8ea1a09c..0a6aef915fa4 100644 > > --- a/Documentation/devicetree/bindings/.gitignore > > +++ b/Documentation/devicetree/bindings/.gitignore > > @@ -1,3 +1,3 @@ > > # SPDX-License-Identifier: GPL-2.0-only > > *.example.dts > > -processed-schema*.yaml > > +processed-schema*.yaml* > > diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile > > index 1df680d07461..1c1cad860b7c 100644 > > --- a/Documentation/devicetree/bindings/Makefile > > +++ b/Documentation/devicetree/bindings/Makefile > > @@ -14,7 +14,8 @@ $(obj)/%.example.dts: $(src)/%.yaml FORCE > > DT_TMP_SCHEMA := $(obj)/processed-schema-examples.yaml > > > > quiet_cmd_mk_schema = SCHEMA $@ > > - cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs) > > + cmd_mk_schema = $(file >$@.tmp, $(real-prereqs)) \ > > + cat $@.tmp | xargs $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ > > > > > The built-in function $(file ...) is supported on GNU Make 4.0 or later. > The current minimal version is GNU Make 3.81. > > If you want to use this function, you must update > Documentation/process/changes.rst first. > > I am pretty sure some conservative distros > still stick to GNU Make 3.8* > but I am open to raising the minimal version > if it is useful. I'd like to avoid that. I've come up with another solution. > But, does this code work in the first place? > > When a very long command is given, xargs > splits it into smaller chunks, and invokes > the command multiple times, right? > > > So, it boils down to this question: > > Are the following two commands work equivalently? > > > "dt-mk-schema -o processed-schema-examples.yaml foo.yaml && > dt-mk-schema -o processed-schema-examples.yaml bar.yaml && > dt-mk-schema -o processed-schema-examples.yaml baz.yaml" > > "dt-mk-schema -o processed-schema-examples.yaml foo.yaml bar.yaml baz.yaml" > > > I think the answer is no. > > I confirmed the produced processed-schema-examples.yaml is broken. Indeed. We need to output to stdout and append the file instead. Sending a v2 out now. [...] > Can dt-mk-schema read the list of schema files > by other means? Not currently. Happy to add it, but I'd rather not require everyone update right away. Rob