linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] kbuild: add make force=1 for testing
@ 2016-07-24 13:28 Fabian Frederick
  2016-07-26  0:05 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Fabian Frederick @ 2016-07-24 13:28 UTC (permalink / raw)
  To: Robert Jarzmik, Michal Marek; +Cc: Andrew Morton, linux-kernel, fabf

Commit 51193b76bfff
("kbuild: forbid kernel directory to contain spaces and colons")

makes it impossible to build kernel on default SD labels like
"SD Card" for instance.

Makefile:133: *** main directory cannot contain spaces nor colons.  Stop.

User could rename directories but volume name is not always writable.

This patch adds ability to do make force=1 for people
not interested in modules_install in this case but only testing.

(Note that other options could go under ifndef force)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index caa33e0..89d00a5 100644
--- a/Makefile
+++ b/Makefile
@@ -128,8 +128,10 @@ _all:
 # Cancel implicit rules on top Makefile
 $(CURDIR)/Makefile Makefile: ;
 
-ifneq ($(words $(subst :, ,$(CURDIR))), 1)
+ifndef force
+ ifneq ($(words $(subst :, ,$(CURDIR))), 1)
   $(error main directory cannot contain spaces nor colons)
+ endif
 endif
 
 ifneq ($(KBUILD_OUTPUT),)
@@ -1408,6 +1410,7 @@ help:
 	@echo  '		2: warnings which occur quite often but may still be relevant'
 	@echo  '		3: more obscure warnings, can most likely be ignored'
 	@echo  '		Multiple levels can be combined with W=12 or W=123'
+	@echo  '  make force=1 [options] Avoid feasibility checks. Use at your own risk'
 	@echo  ''
 	@echo  'Execute "make" or "make all" to build all targets marked with [*] '
 	@echo  'For further info see the ./README file'
-- 
2.8.1

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

* Re: [PATCH 1/1 linux-next] kbuild: add make force=1 for testing
  2016-07-24 13:28 [PATCH 1/1 linux-next] kbuild: add make force=1 for testing Fabian Frederick
@ 2016-07-26  0:05 ` Andrew Morton
  2016-07-26  6:45   ` Robert Jarzmik
  2016-07-26 21:47   ` Michal Marek
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2016-07-26  0:05 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: Robert Jarzmik, Michal Marek, linux-kernel

On Sun, 24 Jul 2016 15:28:18 +0200 Fabian Frederick <fabf@skynet.be> wrote:

> Commit 51193b76bfff
> ("kbuild: forbid kernel directory to contain spaces and colons")
> 
> makes it impossible to build kernel on default SD labels like
> "SD Card" for instance.
> 
> Makefile:133: *** main directory cannot contain spaces nor colons.  Stop.
> 
> User could rename directories but volume name is not always writable.
> 
> This patch adds ability to do make force=1 for people
> not interested in modules_install in this case but only testing.
> 
> (Note that other options could go under ifndef force)

That's a bit of a hack on a hack.

51193b76bfff said:

:    When the kernel path contains a space or a colon somewhere in the path
:    name, the modules_install target doesn't work anymore, as the path names
:    are not enclosed in double quotes. It is also supposed that and O= build
:    will suffer from the same weakness as modules_install.
:    
:    Instead of checking and improving kbuild to resist to directories
:    including these characters, error out early to prevent any build if the
:    kernel's main directory contains a space.

What's involved in fixing this properly?  Make the whole kbuild
system operate correctly when there are spaces/colons in the
pathname?

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

* Re: [PATCH 1/1 linux-next] kbuild: add make force=1 for testing
  2016-07-26  0:05 ` Andrew Morton
@ 2016-07-26  6:45   ` Robert Jarzmik
  2016-07-26 21:47   ` Michal Marek
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Jarzmik @ 2016-07-26  6:45 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Fabian Frederick, Michal Marek, linux-kernel

Andrew Morton <akpm@linux-foundation.org> writes:

> On Sun, 24 Jul 2016 15:28:18 +0200 Fabian Frederick <fabf@skynet.be> wrote:
>
>> Commit 51193b76bfff
>> ("kbuild: forbid kernel directory to contain spaces and colons")
>> 
>> makes it impossible to build kernel on default SD labels like
>> "SD Card" for instance.
>> 
>> Makefile:133: *** main directory cannot contain spaces nor colons.  Stop.
>> 
>> User could rename directories but volume name is not always writable.
>> 
>> This patch adds ability to do make force=1 for people
>> not interested in modules_install in this case but only testing.
>> 
>> (Note that other options could go under ifndef force)
>
> That's a bit of a hack on a hack.
>
> 51193b76bfff said:
>
> :    When the kernel path contains a space or a colon somewhere in the path
> :    name, the modules_install target doesn't work anymore, as the path names
> :    are not enclosed in double quotes. It is also supposed that and O= build
> :    will suffer from the same weakness as modules_install.
> :    
> :    Instead of checking and improving kbuild to resist to directories
> :    including these characters, error out early to prevent any build if the
> :    kernel's main directory contains a space.
>
> What's involved in fixing this properly?  Make the whole kbuild
> system operate correctly when there are spaces/colons in the
> pathname?

I was thinking originally fixing it by :
	http://www.spinics.net/lists/linux-kbuild/msg12036.html

This fixed "properly" the make modules_install I think.
And Marek pointed out that there were other cases, such as O=/my dir/ but not
limited to, where it would also break, hence this patch.

I'm not a kbuild expert so I'd like someone else (Marek) to enumerate the
remaining cases not covered by the original patch.

Cheers.

-- 
Robert

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

* Re: [PATCH 1/1 linux-next] kbuild: add make force=1 for testing
  2016-07-26  0:05 ` Andrew Morton
  2016-07-26  6:45   ` Robert Jarzmik
@ 2016-07-26 21:47   ` Michal Marek
  2016-07-27 14:37     ` Fabian Frederick
  1 sibling, 1 reply; 5+ messages in thread
From: Michal Marek @ 2016-07-26 21:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Fabian Frederick, Robert Jarzmik, linux-kernel

Dne 26.7.2016 v 02:05 Andrew Morton napsal(a):
> On Sun, 24 Jul 2016 15:28:18 +0200 Fabian Frederick <fabf@skynet.be> wrote:
>> This patch adds ability to do make force=1 for people
>> not interested in modules_install in this case but only testing.
>>
>> (Note that other options could go under ifndef force)
> 
> That's a bit of a hack on a hack.

Agreed.


> 51193b76bfff said:
> 
> :    When the kernel path contains a space or a colon somewhere in the path
> :    name, the modules_install target doesn't work anymore, as the path names
> :    are not enclosed in double quotes. It is also supposed that and O= build
> :    will suffer from the same weakness as modules_install.
> :    
> :    Instead of checking and improving kbuild to resist to directories
> :    including these characters, error out early to prevent any build if the
> :    kernel's main directory contains a space.
> 
> What's involved in fixing this properly?  Make the whole kbuild
> system operate correctly when there are spaces/colons in the
> pathname?

modules_install probably could be fixed. However, O= builds are
definitely unfixable: We use -I$(srctree)/... in various *FLAGS
variables, which are space-separated lists. We assign $(srctree) to
VPATH, which is a colon-separated list. Also, we pass $(srctree)/... to
the wildcard, addprefix or patsubst functions, which take a
space-separated list of words. The Makefile language simply does does
not give us tools to handle special characters properly.

To work around such paths, I suggest to create a symlink and use that.
As far as I can tell, we do not call readlink/realpath in the buildsystem.

Michal

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

* Re: [PATCH 1/1 linux-next] kbuild: add make force=1 for testing
  2016-07-26 21:47   ` Michal Marek
@ 2016-07-27 14:37     ` Fabian Frederick
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Frederick @ 2016-07-27 14:37 UTC (permalink / raw)
  To: Andrew Morton, Michal Marek; +Cc: linux-kernel, Robert Jarzmik



> On 26 July 2016 at 23:47 Michal Marek <mmarek@suse.com> wrote:
>
>
> Dne 26.7.2016 v 02:05 Andrew Morton napsal(a):
> > On Sun, 24 Jul 2016 15:28:18 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> >> This patch adds ability to do make force=1 for people
> >> not interested in modules_install in this case but only testing.
> >>
> >> (Note that other options could go under ifndef force)
> >
> > That's a bit of a hack on a hack.
>
> Agreed.
>
>
> > 51193b76bfff said:
> >
> > :    When the kernel path contains a space or a colon somewhere in the path
> > :    name, the modules_install target doesn't work anymore, as the path
> > names
> > :    are not enclosed in double quotes. It is also supposed that and O=
> > build
> > :    will suffer from the same weakness as modules_install.
> > :   
> > :    Instead of checking and improving kbuild to resist to directories
> > :    including these characters, error out early to prevent any build if the
> > :    kernel's main directory contains a space.
> >
> > What's involved in fixing this properly?  Make the whole kbuild
> > system operate correctly when there are spaces/colons in the
> > pathname?
>
> modules_install probably could be fixed. However, O= builds are
> definitely unfixable: We use -I$(srctree)/... in various *FLAGS
> variables, which are space-separated lists. We assign $(srctree) to
> VPATH, which is a colon-separated list. Also, we pass $(srctree)/... to
> the wildcard, addprefix or patsubst functions, which take a
> space-separated list of words. The Makefile language simply does does
> not give us tools to handle special characters properly.
>
> To work around such paths, I suggest to create a symlink and use that.
> As far as I can tell, we do not call readlink/realpath in the buildsystem.

This was the first thing I tried but make still doesn't work.

Fabian

>
> Michal

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

end of thread, other threads:[~2016-07-27 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-24 13:28 [PATCH 1/1 linux-next] kbuild: add make force=1 for testing Fabian Frederick
2016-07-26  0:05 ` Andrew Morton
2016-07-26  6:45   ` Robert Jarzmik
2016-07-26 21:47   ` Michal Marek
2016-07-27 14:37     ` Fabian Frederick

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).