DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH] buildtools: fix build for some mktemp
  2018-10-26 18:42 [dpdk-dev] [PATCH] buildtools: fix build for some mktemp Ferruh Yigit
@ 2018-10-26 17:59 ` Thomas Monjalon
  2018-10-26 18:31   ` Ferruh Yigit
  2018-10-27  0:38 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2018-10-26 17:59 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

26/10/2018 20:42, Ferruh Yigit:
> build error:
> == Build drivers/net/tap
> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
> Invalid argument
> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
> .../drivers/net/tap/Makefile:55: recipe for target
>    'tap_autoconf.h.new' failed
> 
> Above error observed on Wind River Linux 8.0
> 
> `mktemp` command in that system has a restrictions to have X in
> the template at the end and at least six of them.

So let's comply with this requirement.

> Switched back to static assignment for `temp` in buildtools,
> but kept `dpdk.` prefix to preserve the common prefix intention.

It is a regression.
mktemp allows to choose the temporary directory thanks to TMPDIR
environment variable.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] buildtools: fix build for some mktemp
  2018-10-26 17:59 ` Thomas Monjalon
@ 2018-10-26 18:31   ` Ferruh Yigit
  2018-10-26 19:59     ` Thomas Monjalon
  0 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2018-10-26 18:31 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 10/26/2018 6:59 PM, Thomas Monjalon wrote:
> 26/10/2018 20:42, Ferruh Yigit:
>> build error:
>> == Build drivers/net/tap
>> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
>> Invalid argument
>> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
>> .../drivers/net/tap/Makefile:55: recipe for target
>>    'tap_autoconf.h.new' failed
>>
>> Above error observed on Wind River Linux 8.0
>>
>> `mktemp` command in that system has a restrictions to have X in
>> the template at the end and at least six of them.
> 
> So let's comply with this requirement.

We can't directly, because that temp file needs to be a .c file.

What can be done is create a temp file via mktemp and append .c later:
_temp=$(mktemp -t dpdk.${0##*/}.XXXXXX)
temp=${_temp}.c

Do we need this?

> 
>> Switched back to static assignment for `temp` in buildtools,
>> but kept `dpdk.` prefix to preserve the common prefix intention.
> 
> It is a regression.
> mktemp allows to choose the temporary directory thanks to TMPDIR
> environment variable.
> 
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH] buildtools: fix build for some mktemp
@ 2018-10-26 18:42 Ferruh Yigit
  2018-10-26 17:59 ` Thomas Monjalon
  2018-10-27  0:38 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
  0 siblings, 2 replies; 10+ messages in thread
From: Ferruh Yigit @ 2018-10-26 18:42 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Ferruh Yigit

build error:
== Build drivers/net/tap
mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
Invalid argument
.../buildtools/auto-config-h.sh: line 86: : No such file or directory
.../drivers/net/tap/Makefile:55: recipe for target
   'tap_autoconf.h.new' failed

Above error observed on Wind River Linux 8.0

`mktemp` command in that system has a restrictions to have X in
the template at the end and at least six of them.

Switched back to static assignment for `temp` in buildtools,
but kept `dpdk.` prefix to preserve the common prefix intention.

Fixes: ff37ca5d3773 ("devtools: use a common prefix for temporary files")

Reported-by: Shuai Zhu <shuaix.zhu@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 buildtools/auto-config-h.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildtools/auto-config-h.sh b/buildtools/auto-config-h.sh
index 6130429eb..29a0d9e9d 100755
--- a/buildtools/auto-config-h.sh
+++ b/buildtools/auto-config-h.sh
@@ -23,7 +23,7 @@ name=${5:?define/type/function name required}
 
 : ${CC:=cc}
 
-temp=$(mktemp -t dpdk.${0##*/}.XXX.c)
+temp=/tmp/dpdk.${0##*/}.$$.c
 
 case $type in
 define)
-- 
2.17.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] buildtools: fix build for some mktemp
  2018-10-26 18:31   ` Ferruh Yigit
@ 2018-10-26 19:59     ` Thomas Monjalon
  2018-10-26 23:28       ` Ferruh Yigit
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2018-10-26 19:59 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

26/10/2018 20:31, Ferruh Yigit:
> On 10/26/2018 6:59 PM, Thomas Monjalon wrote:
> > 26/10/2018 20:42, Ferruh Yigit:
> >> build error:
> >> == Build drivers/net/tap
> >> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
> >> Invalid argument
> >> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
> >> .../drivers/net/tap/Makefile:55: recipe for target
> >>    'tap_autoconf.h.new' failed
> >>
> >> Above error observed on Wind River Linux 8.0
> >>
> >> `mktemp` command in that system has a restrictions to have X in
> >> the template at the end and at least six of them.
> > 
> > So let's comply with this requirement.
> 
> We can't directly, because that temp file needs to be a .c file.

The .c extension is mandatory?

> What can be done is create a temp file via mktemp and append .c later:
> _temp=$(mktemp -t dpdk.${0##*/}.XXXXXX)
> temp=${_temp}.c
> 
> Do we need this?

Yes I think it's better.

> >> Switched back to static assignment for `temp` in buildtools,
> >> but kept `dpdk.` prefix to preserve the common prefix intention.
> > 
> > It is a regression.
> > mktemp allows to choose the temporary directory thanks to TMPDIR
> > environment variable.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] buildtools: fix build for some mktemp
  2018-10-26 19:59     ` Thomas Monjalon
@ 2018-10-26 23:28       ` Ferruh Yigit
  0 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2018-10-26 23:28 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 10/26/2018 8:59 PM, Thomas Monjalon wrote:
> 26/10/2018 20:31, Ferruh Yigit:
>> On 10/26/2018 6:59 PM, Thomas Monjalon wrote:
>>> 26/10/2018 20:42, Ferruh Yigit:
>>>> build error:
>>>> == Build drivers/net/tap
>>>> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
>>>> Invalid argument
>>>> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
>>>> .../drivers/net/tap/Makefile:55: recipe for target
>>>>    'tap_autoconf.h.new' failed
>>>>
>>>> Above error observed on Wind River Linux 8.0
>>>>
>>>> `mktemp` command in that system has a restrictions to have X in
>>>> the template at the end and at least six of them.
>>>
>>> So let's comply with this requirement.
>>
>> We can't directly, because that temp file needs to be a .c file.
> 
> The .c extension is mandatory?

This file is compiled, it is doesn't need to have .c with proper compiler flag.

> 
>> What can be done is create a temp file via mktemp and append .c later:
>> _temp=$(mktemp -t dpdk.${0##*/}.XXXXXX)
>> temp=${_temp}.c
>>
>> Do we need this?
> 
> Yes I think it's better.

This will create two temp files, one is empty, I will try above option.

> 
>>>> Switched back to static assignment for `temp` in buildtools,
>>>> but kept `dpdk.` prefix to preserve the common prefix intention.
>>>
>>> It is a regression.
>>> mktemp allows to choose the temporary directory thanks to TMPDIR
>>> environment variable.
> 
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v2] buildtools: fix build for some mktemp
  2018-10-27  0:38 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
@ 2018-10-26 23:47   ` Thomas Monjalon
  2018-10-26 23:53     ` Ferruh Yigit
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2018-10-26 23:47 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

27/10/2018 02:38, Ferruh Yigit:
> build error:
> == Build drivers/net/tap
> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
> Invalid argument
> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
> .../drivers/net/tap/Makefile:55: recipe for target
>    'tap_autoconf.h.new' failed
> 
> Above error observed on Wind River Linux 8.0
> 
> `mktemp` command in that system has a restrictions to have X in
> the template at the end and at least six of them.
> 
> Complied to mktemp requirements and add -xc flag to compiler to say
> `temp` file is a C file
> 
> Fixes: ff37ca5d3773 ("devtools: use a common prefix for temporary files")
> 
> Reported-by: Shuai Zhu <shuaix.zhu@intel.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> v2:
> * keep using mktemp, add -xc to compiler
> ---
>  buildtools/auto-config-h.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/buildtools/auto-config-h.sh
> +++ b/buildtools/auto-config-h.sh
> -temp=$(mktemp -t dpdk.${0##*/}.XXX.c)
> +temp=$(mktemp -t dpdk.${0##*/}.c.XXXXXX)

It looks OK for this script.

Should we do the same kind of change for devtools/check-includes.sh?
and devtools/cocci.sh?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v2] buildtools: fix build for some mktemp
  2018-10-26 23:47   ` Thomas Monjalon
@ 2018-10-26 23:53     ` Ferruh Yigit
  2018-10-27  0:05       ` Thomas Monjalon
  2018-10-27 13:30       ` Thomas Monjalon
  0 siblings, 2 replies; 10+ messages in thread
From: Ferruh Yigit @ 2018-10-26 23:53 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 10/27/2018 12:47 AM, Thomas Monjalon wrote:
> 27/10/2018 02:38, Ferruh Yigit:
>> build error:
>> == Build drivers/net/tap
>> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
>> Invalid argument
>> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
>> .../drivers/net/tap/Makefile:55: recipe for target
>>    'tap_autoconf.h.new' failed
>>
>> Above error observed on Wind River Linux 8.0
>>
>> `mktemp` command in that system has a restrictions to have X in
>> the template at the end and at least six of them.
>>
>> Complied to mktemp requirements and add -xc flag to compiler to say
>> `temp` file is a C file
>>
>> Fixes: ff37ca5d3773 ("devtools: use a common prefix for temporary files")
>>
>> Reported-by: Shuai Zhu <shuaix.zhu@intel.com>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> v2:
>> * keep using mktemp, add -xc to compiler
>> ---
>>  buildtools/auto-config-h.sh | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> --- a/buildtools/auto-config-h.sh
>> +++ b/buildtools/auto-config-h.sh
>> -temp=$(mktemp -t dpdk.${0##*/}.XXX.c)
>> +temp=$(mktemp -t dpdk.${0##*/}.c.XXXXXX)
> 
> It looks OK for this script.
> 
> Should we do the same kind of change for devtools/check-includes.sh?
> and devtools/cocci.sh?

Not sure, this script is part of buildtool and required for build, so needs to
be compatible for various systems. Above are devtools and can use new mktemp.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v2] buildtools: fix build for some mktemp
  2018-10-26 23:53     ` Ferruh Yigit
@ 2018-10-27  0:05       ` Thomas Monjalon
  2018-10-27 13:30       ` Thomas Monjalon
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2018-10-27  0:05 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

27/10/2018 01:53, Ferruh Yigit:
> On 10/27/2018 12:47 AM, Thomas Monjalon wrote:
> > 27/10/2018 02:38, Ferruh Yigit:
> >> build error:
> >> == Build drivers/net/tap
> >> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
> >> Invalid argument
> >> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
> >> .../drivers/net/tap/Makefile:55: recipe for target
> >>    'tap_autoconf.h.new' failed
> >>
> >> Above error observed on Wind River Linux 8.0
> >>
> >> `mktemp` command in that system has a restrictions to have X in
> >> the template at the end and at least six of them.
> >>
> >> Complied to mktemp requirements and add -xc flag to compiler to say
> >> `temp` file is a C file
> >>
> >> Fixes: ff37ca5d3773 ("devtools: use a common prefix for temporary files")
> >>
> >> Reported-by: Shuai Zhu <shuaix.zhu@intel.com>
> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >> ---
> >> v2:
> >> * keep using mktemp, add -xc to compiler
> >> ---
> >>  buildtools/auto-config-h.sh | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> --- a/buildtools/auto-config-h.sh
> >> +++ b/buildtools/auto-config-h.sh
> >> -temp=$(mktemp -t dpdk.${0##*/}.XXX.c)
> >> +temp=$(mktemp -t dpdk.${0##*/}.c.XXXXXX)
> > 
> > It looks OK for this script.
> > 
> > Should we do the same kind of change for devtools/check-includes.sh?
> > and devtools/cocci.sh?
> 
> Not sure, this script is part of buildtool and required for build, so needs to
> be compatible for various systems. Above are devtools and can use new mktemp.

You mean nobody will use Wind River Linux 8.0 for developing?
You are probably right :)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH v2] buildtools: fix build for some mktemp
  2018-10-26 18:42 [dpdk-dev] [PATCH] buildtools: fix build for some mktemp Ferruh Yigit
  2018-10-26 17:59 ` Thomas Monjalon
@ 2018-10-27  0:38 ` Ferruh Yigit
  2018-10-26 23:47   ` Thomas Monjalon
  1 sibling, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2018-10-27  0:38 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Ferruh Yigit

build error:
== Build drivers/net/tap
mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
Invalid argument
.../buildtools/auto-config-h.sh: line 86: : No such file or directory
.../drivers/net/tap/Makefile:55: recipe for target
   'tap_autoconf.h.new' failed

Above error observed on Wind River Linux 8.0

`mktemp` command in that system has a restrictions to have X in
the template at the end and at least six of them.

Complied to mktemp requirements and add -xc flag to compiler to say
`temp` file is a C file

Fixes: ff37ca5d3773 ("devtools: use a common prefix for temporary files")

Reported-by: Shuai Zhu <shuaix.zhu@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v2:
* keep using mktemp, add -xc to compiler
---
 buildtools/auto-config-h.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/buildtools/auto-config-h.sh b/buildtools/auto-config-h.sh
index 6130429eb..5b613c35f 100755
--- a/buildtools/auto-config-h.sh
+++ b/buildtools/auto-config-h.sh
@@ -23,7 +23,7 @@ name=${5:?define/type/function name required}
 
 : ${CC:=cc}
 
-temp=$(mktemp -t dpdk.${0##*/}.XXX.c)
+temp=$(mktemp -t dpdk.${0##*/}.c.XXXXXX)
 
 case $type in
 define)
@@ -86,7 +86,7 @@ printf "\
 " "$include" "$code" > "${temp}" &&
 if ${CC} ${CPPFLAGS} ${EXTRA_CPPFLAGS} ${CFLAGS} ${EXTRA_CFLAGS} \
 	${AUTO_CONFIG_CFLAGS} \
-	-c -o ${temp}.o "${temp}" 1>&${out} 2>&${err}
+	-xc -c -o ${temp}.o "${temp}" 1>&${out} 2>&${err}
 then
 	rm -f "${temp}" "${temp}.o"
 	printf "\
-- 
2.17.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH v2] buildtools: fix build for some mktemp
  2018-10-26 23:53     ` Ferruh Yigit
  2018-10-27  0:05       ` Thomas Monjalon
@ 2018-10-27 13:30       ` Thomas Monjalon
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2018-10-27 13:30 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

27/10/2018 01:53, Ferruh Yigit:
> On 10/27/2018 12:47 AM, Thomas Monjalon wrote:
> > 27/10/2018 02:38, Ferruh Yigit:
> >> build error:
> >> == Build drivers/net/tap
> >> mktemp: cannot create temp file /tmp/dpdk.auto-config-h.sh.XXX.c:
> >> Invalid argument
> >> .../buildtools/auto-config-h.sh: line 86: : No such file or directory
> >> .../drivers/net/tap/Makefile:55: recipe for target
> >>    'tap_autoconf.h.new' failed
> >>
> >> Above error observed on Wind River Linux 8.0
> >>
> >> `mktemp` command in that system has a restrictions to have X in
> >> the template at the end and at least six of them.
> >>
> >> Complied to mktemp requirements and add -xc flag to compiler to say
> >> `temp` file is a C file
> >>
> >> Fixes: ff37ca5d3773 ("devtools: use a common prefix for temporary files")
> >>
> >> Reported-by: Shuai Zhu <shuaix.zhu@intel.com>
> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >> ---
> >> v2:
> >> * keep using mktemp, add -xc to compiler
> >> ---
> >>  buildtools/auto-config-h.sh | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> --- a/buildtools/auto-config-h.sh
> >> +++ b/buildtools/auto-config-h.sh
> >> -temp=$(mktemp -t dpdk.${0##*/}.XXX.c)
> >> +temp=$(mktemp -t dpdk.${0##*/}.c.XXXXXX)
> > 
> > It looks OK for this script.
> > 
> > Should we do the same kind of change for devtools/check-includes.sh?
> > and devtools/cocci.sh?
> 
> Not sure, this script is part of buildtool and required for build, so needs to
> be compatible for various systems. Above are devtools and can use new mktemp.

Applied, thanks

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-10-27 13:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 18:42 [dpdk-dev] [PATCH] buildtools: fix build for some mktemp Ferruh Yigit
2018-10-26 17:59 ` Thomas Monjalon
2018-10-26 18:31   ` Ferruh Yigit
2018-10-26 19:59     ` Thomas Monjalon
2018-10-26 23:28       ` Ferruh Yigit
2018-10-27  0:38 ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
2018-10-26 23:47   ` Thomas Monjalon
2018-10-26 23:53     ` Ferruh Yigit
2018-10-27  0:05       ` Thomas Monjalon
2018-10-27 13:30       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).