diff mbox

$(SED) not defined if 'make menuconfig savedefconfig'

Message ID 20150615153742.02ebdb85@free-electrons.com
State Not Applicable
Headers show

Commit Message

Thomas Petazzoni June 15, 2015, 1:37 p.m. UTC
Dear Alvaro Gamez,

On Mon, 15 Jun 2015 12:26:02 +0200, Alvaro Gamez wrote:

> While using buildroot-submodule (
> https://github.com/Openwide-Ingenierie/buildroot-submodule) I've noticed
> this happens since commit f71a621d91ec27f175fc84012962f88b1107305f was
> introduced into buildroot.
> 
> $ make menuconfig savedefconfig
> [Do whatever, or nothing at all and exit, there's no need to save anything]
> *** End of the configuration.
> *** Execute 'make' to start the build or try 'make help'.
> 
> make: /BR2_DEFCONFIG=/d: Command not found
> Makefile:777: recipe for target 'savedefconfig' failed
> make: *** [savedefconfig] Error 127
> 
> However,
> $ make menuconfig
> $ make savedefconfig
> 
> does not end with that error. I've just tracked it down to the fact that
> $(SED) is not defined when menuconfig savedefconfig are used in a single
> make call, whereas it equals to '/bin/sed -i -e'
> 
> Simply replacing that @$(SED) by /bin/sed -i -e on line 777 of Makefile
> makes it work again, but I don't think that solution is desirable. I'm
> sorry I can't provide a full patch, the motive of this bug is beyond my
> knowledge.

Hum, right. Can you try the below patch:

Comments

Doug Kehn June 15, 2015, 2:20 p.m. UTC | #1
Hi Thomas, Alvaro,

On Mon, Jun 15, 2015 at 03:37:42PM +0200, Thomas Petazzoni wrote:
> Dear Alvaro Gamez,
> 
> On Mon, 15 Jun 2015 12:26:02 +0200, Alvaro Gamez wrote:
> 
> > While using buildroot-submodule (
> > https://github.com/Openwide-Ingenierie/buildroot-submodule) I've noticed
> > this happens since commit f71a621d91ec27f175fc84012962f88b1107305f was
> > introduced into buildroot.
> > 
> > $ make menuconfig savedefconfig
> > [Do whatever, or nothing at all and exit, there's no need to save anything]
> > *** End of the configuration.
> > *** Execute 'make' to start the build or try 'make help'.
> > 
> > make: /BR2_DEFCONFIG=/d: Command not found
> > Makefile:777: recipe for target 'savedefconfig' failed
> > make: *** [savedefconfig] Error 127
> > 
> > However,
> > $ make menuconfig
> > $ make savedefconfig
> > 
> > does not end with that error. I've just tracked it down to the fact that
> > $(SED) is not defined when menuconfig savedefconfig are used in a single
> > make call, whereas it equals to '/bin/sed -i -e'
> > 
> > Simply replacing that @$(SED) by /bin/sed -i -e on line 777 of Makefile
> > makes it work again, but I don't think that solution is desirable. I'm
> > sorry I can't provide a full patch, the motive of this bug is beyond my
> > knowledge.
> 
> Hum, right. Can you try the below patch:
> 
> diff --git a/Makefile b/Makefile
> index d3f80c4..67eb50c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -272,6 +272,7 @@ HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
>  HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
>  HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
>  HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
> +SED := $(shell which sed || type -p sed) -i -e
>  
>  export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
>  export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
> diff --git a/package/Makefile.in b/package/Makefile.in
> index c02d31f..f256b05 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -217,7 +217,6 @@ endif
>  INSTALL := $(shell which install || type -p install)
>  FLEX := $(shell which flex || type -p flex)
>  BISON := $(shell which bison || type -p bison)
> -SED := $(shell which sed || type -p sed) -i -e
>  UNZIP := $(shell which unzip || type -p unzip) -q
>  
>  APPLY_PATCHES = support/scripts/apply-patches.sh $(if $(QUIET),-s)
> 
> 

I reproduced Alvaro's observation and your patch does resolve the
issue.

Tested-by: Doug Kehn <rdkehn@yahoo.com>

Regards,
...doug
Alvaro Gamez Machado June 16, 2015, 7:58 a.m. UTC | #2
Hi, Thomas, Doug,

2015-06-15 16:20 GMT+02:00 <rdkehn@yahoo.com>:

> > diff --git a/Makefile b/Makefile
> > index d3f80c4..67eb50c 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -272,6 +272,7 @@ HOSTLN := $(shell which $(HOSTLN) || type -p
> $(HOSTLN) || echo ln)
> >  HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
> >  HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY)
> || echo objcopy)
> >  HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) ||
> echo ranlib)
> > +SED := $(shell which sed || type -p sed) -i -e
> >
> >  export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
> >  export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
> > diff --git a/package/Makefile.in b/package/Makefile.in
> > index c02d31f..f256b05 100644
> > --- a/package/Makefile.in
> > +++ b/package/Makefile.in
> > @@ -217,7 +217,6 @@ endif
> >  INSTALL := $(shell which install || type -p install)
> >  FLEX := $(shell which flex || type -p flex)
> >  BISON := $(shell which bison || type -p bison)
> > -SED := $(shell which sed || type -p sed) -i -e
> >  UNZIP := $(shell which unzip || type -p unzip) -q
> >
> >  APPLY_PATCHES = support/scripts/apply-patches.sh $(if $(QUIET),-s)
> >
> >
>
> I reproduced Alvaro's observation and your patch does resolve the
> issue.
>
> Tested-by: Doug Kehn <rdkehn@yahoo.com>
>
> Regards,
> ...doug
>
>
I've just tested it too and can confirm that this fixes the problem and my
particular use case with buildroot-submodule.

Tested-by: Alvaro G. M. <alvaro.gamez@hazent.com>

Thanks a lot
Alvaro Gamez Machado Feb. 16, 2016, 11:46 a.m. UTC | #3
Hi, all

2015-06-16 9:58 GMT+02:00 Alvaro Gamez <alvaro.gamez@hazent.com>:

> 2015-06-15 16:20 GMT+02:00 <rdkehn@yahoo.com>:
>
>> > diff --git a/Makefile b/Makefile
>> > index d3f80c4..67eb50c 100644
>> > --- a/Makefile
>> > +++ b/Makefile
>> > @@ -272,6 +272,7 @@ HOSTLN := $(shell which $(HOSTLN) || type -p
>> $(HOSTLN) || echo ln)
>> >  HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
>> >  HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY)
>> || echo objcopy)
>> >  HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) ||
>> echo ranlib)
>> > +SED := $(shell which sed || type -p sed) -i -e
>> >
>> >  export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
>> >  export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
>> > diff --git a/package/Makefile.in b/package/Makefile.in
>> > index c02d31f..f256b05 100644
>> > --- a/package/Makefile.in
>> > +++ b/package/Makefile.in
>> > @@ -217,7 +217,6 @@ endif
>> >  INSTALL := $(shell which install || type -p install)
>> >  FLEX := $(shell which flex || type -p flex)
>> >  BISON := $(shell which bison || type -p bison)
>> > -SED := $(shell which sed || type -p sed) -i -e
>> >  UNZIP := $(shell which unzip || type -p unzip) -q
>> >
>> >  APPLY_PATCHES = support/scripts/apply-patches.sh $(if $(QUIET),-s)
>> >
>> >
>>
>> I reproduced Alvaro's observation and your patch does resolve the
>> issue.
>>
>> Tested-by: Doug Kehn <rdkehn@yahoo.com>
>>
>> Regards,
>> ...doug
>>
>>
> I've just tested it too and can confirm that this fixes the problem and my
> particular use case with buildroot-submodule.
>
> Tested-by: Alvaro G. M. <alvaro.gamez@hazent.com>
>
>
I just wanted to query about the status of this patch. I haven't found it
on patchwork, probably because it wasn't sent as a PATCH email on itself,
but it was tested by Doug and me.

I can confirm it still applies and works as intended. If you need me to, I
can git-email it.

Best regards
Thomas Petazzoni Feb. 16, 2016, 3:10 p.m. UTC | #4
Hello Alvaro,

On Tue, 16 Feb 2016 12:46:55 +0100, Alvaro Gamez wrote:

> > I've just tested it too and can confirm that this fixes the problem and my
> > particular use case with buildroot-submodule.
> >
> > Tested-by: Alvaro G. M. <alvaro.gamez@hazent.com>
> >
> >
> I just wanted to query about the status of this patch. I haven't found it
> on patchwork, probably because it wasn't sent as a PATCH email on itself,
> but it was tested by Doug and me.
> 
> I can confirm it still applies and works as intended. If you need me to, I
> can git-email it.

Indeed this patch is not in patchwork. And if a patch is not in
patchwork, we will definitely forget about it. We have several hundreds
of patches already in patchwork, so we can hardly keep track of patches
that were not submitted in a form that allows them to be tracked by
patchwork.

So, it would be really good if you could submit this patch with 'git
send-email'.

Thanks a lot!

Thomas
diff mbox

Patch

diff --git a/Makefile b/Makefile
index d3f80c4..67eb50c 100644
--- a/Makefile
+++ b/Makefile
@@ -272,6 +272,7 @@  HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
 HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
 HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
 HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
+SED := $(shell which sed || type -p sed) -i -e
 
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
diff --git a/package/Makefile.in b/package/Makefile.in
index c02d31f..f256b05 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -217,7 +217,6 @@  endif
 INSTALL := $(shell which install || type -p install)
 FLEX := $(shell which flex || type -p flex)
 BISON := $(shell which bison || type -p bison)
-SED := $(shell which sed || type -p sed) -i -e
 UNZIP := $(shell which unzip || type -p unzip) -q
 
 APPLY_PATCHES = support/scripts/apply-patches.sh $(if $(QUIET),-s)