diff mbox series

[1/1] dt-bindings: Fix error in 'make dtbs_check' when using DT_SCHEMA_FILES

Message ID 2519b8bde507ca6ccea9765ea197adaaa69a66d5.1605712328.git.cristian.ciocaltea@gmail.com
State Accepted
Commit 96993a59f94db89a3ff0110dc9e3a2af03a1da8b
Headers show
Series [1/1] dt-bindings: Fix error in 'make dtbs_check' when using DT_SCHEMA_FILES | expand

Commit Message

Cristian Ciocaltea Nov. 18, 2020, 3:20 p.m. UTC
If DT_SCHEMA_FILES is specified and contains more than one file paths,
'make dtbs_check' fails with the following message:

  $ make dtbs_check DT_SCHEMA_FILES="path/to/schema1.yaml path/to/schema2.yaml"
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  Documentation/devicetree/bindings/Makefile:77: recipe for target 'Documentation/devicetree/bindings/processed-schema.json' failed
  make[1]: *** [Documentation/devicetree/bindings/processed-schema.json] Error 255
  make[1]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'
  Makefile:1364: recipe for target 'dt_binding_check' failed
  make: *** [dt_binding_check] Error 2

The error code 255 is returned by 'dt-mk-schema' when invoked as
'dt-mk-schema -j -u @<tmp-file>', where '<tmp-file>' is a temporary
file that is generated to contain a list of SPACE delimited schema
file paths, as indicated via DT_SCHEMA_FILES.

However, it seems the file format has been recently changed in
'dt-mk-schema', which now expects each schema path to be provided on
a separate line:

 $ dt-mk-schema --version
 2020.12.dev4+g6de1c45

Therefore, let's change '<tmp-file>' content format from

 path/to/schema1.yaml path/to/schema2.yaml ... path/to/schemaN.yaml

to

 path/to/schema1.yaml
 path/to/schema2.yaml
 ...
 path/to/schemaN.yaml

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
---
 Documentation/devicetree/bindings/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring (Arm) Dec. 7, 2020, 9:48 p.m. UTC | #1
On Wed, Nov 18, 2020 at 05:20:50PM +0200, Cristian Ciocaltea wrote:
> If DT_SCHEMA_FILES is specified and contains more than one file paths,


If that worked before, it was by chance. :) Yes, it's called '_FILES', 
but more than one was on my todo list.

Anyways, I'll apply it.

> 'make dtbs_check' fails with the following message:

> 

>   $ make dtbs_check DT_SCHEMA_FILES="path/to/schema1.yaml path/to/schema2.yaml"

>   SCHEMA  Documentation/devicetree/bindings/processed-schema.json

>   Documentation/devicetree/bindings/Makefile:77: recipe for target 'Documentation/devicetree/bindings/processed-schema.json' failed

>   make[1]: *** [Documentation/devicetree/bindings/processed-schema.json] Error 255

>   make[1]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'

>   Makefile:1364: recipe for target 'dt_binding_check' failed

>   make: *** [dt_binding_check] Error 2

> 

> The error code 255 is returned by 'dt-mk-schema' when invoked as

> 'dt-mk-schema -j -u @<tmp-file>', where '<tmp-file>' is a temporary

> file that is generated to contain a list of SPACE delimited schema

> file paths, as indicated via DT_SCHEMA_FILES.

> 

> However, it seems the file format has been recently changed in

> 'dt-mk-schema', which now expects each schema path to be provided on

> a separate line:

> 

>  $ dt-mk-schema --version

>  2020.12.dev4+g6de1c45

> 

> Therefore, let's change '<tmp-file>' content format from

> 

>  path/to/schema1.yaml path/to/schema2.yaml ... path/to/schemaN.yaml

> 

> to

> 

>  path/to/schema1.yaml

>  path/to/schema2.yaml

>  ...

>  path/to/schemaN.yaml

> 

> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>

> ---

>  Documentation/devicetree/bindings/Makefile | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile

> index f50420099a55..643eb873fd51 100644

> --- a/Documentation/devicetree/bindings/Makefile

> +++ b/Documentation/devicetree/bindings/Makefile

> @@ -37,7 +37,7 @@ quiet_cmd_chk_bindings = CHKDT   $@

>  quiet_cmd_mk_schema = SCHEMA  $@

>        cmd_mk_schema = f=$$(mktemp) ; \

>                        $(if $(DT_MK_SCHEMA_FLAGS), \

> -                           echo $(real-prereqs), \

> +                           printf '%s\n' $(real-prereqs), \

>                             $(find_cmd)) > $$f ; \

>                        $(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \

>  		      rm -f $$f

> -- 

> 2.29.2

>
Cristian Ciocaltea Dec. 7, 2020, 10:41 p.m. UTC | #2
On Mon, Dec 07, 2020 at 03:48:31PM -0600, Rob Herring wrote:
> On Wed, Nov 18, 2020 at 05:20:50PM +0200, Cristian Ciocaltea wrote:

> > If DT_SCHEMA_FILES is specified and contains more than one file paths,

> 

> If that worked before, it was by chance. :) Yes, it's called '_FILES', 

> but more than one was on my todo list.


I've been using it for a while, but I didn't know this was not
officially supported..

> Anyways, I'll apply it.


Great, thanks!

> > 'make dtbs_check' fails with the following message:

> > 

> >   $ make dtbs_check DT_SCHEMA_FILES="path/to/schema1.yaml path/to/schema2.yaml"

> >   SCHEMA  Documentation/devicetree/bindings/processed-schema.json

> >   Documentation/devicetree/bindings/Makefile:77: recipe for target 'Documentation/devicetree/bindings/processed-schema.json' failed

> >   make[1]: *** [Documentation/devicetree/bindings/processed-schema.json] Error 255

> >   make[1]: *** Deleting file 'Documentation/devicetree/bindings/processed-schema.json'

> >   Makefile:1364: recipe for target 'dt_binding_check' failed

> >   make: *** [dt_binding_check] Error 2

> > 

> > The error code 255 is returned by 'dt-mk-schema' when invoked as

> > 'dt-mk-schema -j -u @<tmp-file>', where '<tmp-file>' is a temporary

> > file that is generated to contain a list of SPACE delimited schema

> > file paths, as indicated via DT_SCHEMA_FILES.

> > 

> > However, it seems the file format has been recently changed in

> > 'dt-mk-schema', which now expects each schema path to be provided on

> > a separate line:

> > 

> >  $ dt-mk-schema --version

> >  2020.12.dev4+g6de1c45

> > 

> > Therefore, let's change '<tmp-file>' content format from

> > 

> >  path/to/schema1.yaml path/to/schema2.yaml ... path/to/schemaN.yaml

> > 

> > to

> > 

> >  path/to/schema1.yaml

> >  path/to/schema2.yaml

> >  ...

> >  path/to/schemaN.yaml

> > 

> > Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>

> > ---

> >  Documentation/devicetree/bindings/Makefile | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> > 

> > diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile

> > index f50420099a55..643eb873fd51 100644

> > --- a/Documentation/devicetree/bindings/Makefile

> > +++ b/Documentation/devicetree/bindings/Makefile

> > @@ -37,7 +37,7 @@ quiet_cmd_chk_bindings = CHKDT   $@

> >  quiet_cmd_mk_schema = SCHEMA  $@

> >        cmd_mk_schema = f=$$(mktemp) ; \

> >                        $(if $(DT_MK_SCHEMA_FLAGS), \

> > -                           echo $(real-prereqs), \

> > +                           printf '%s\n' $(real-prereqs), \

> >                             $(find_cmd)) > $$f ; \

> >                        $(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \

> >  		      rm -f $$f

> > -- 

> > 2.29.2

> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
index f50420099a55..643eb873fd51 100644
--- a/Documentation/devicetree/bindings/Makefile
+++ b/Documentation/devicetree/bindings/Makefile
@@ -37,7 +37,7 @@  quiet_cmd_chk_bindings = CHKDT   $@
 quiet_cmd_mk_schema = SCHEMA  $@
       cmd_mk_schema = f=$$(mktemp) ; \
                       $(if $(DT_MK_SCHEMA_FLAGS), \
-                           echo $(real-prereqs), \
+                           printf '%s\n' $(real-prereqs), \
                            $(find_cmd)) > $$f ; \
                       $(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \
 		      rm -f $$f