All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail
@ 2017-12-06 10:32 Masahiro Yamada
  2017-12-06 19:35 ` Jim Davis
  2017-12-12 15:08 ` Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2017-12-06 10:32 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

We do not support out-of-tree building of rpm-pkg / deb-pkg.  If O=
is given, the build should be terminated, but the "false" command is
not effective because it is not the last command in the cmd_src_tar.
Then, rpm-pkg / deb-pkg tries to continue building, and fails for a
different reason.

Set -e option so that the "false" terminates the building immediately.

I also put the error messages to stderr, and made it stand out more.

For example, "make O=foo rpm-pkg" will fail as follows:

  /bin/bash ../scripts/package/mkspec >./kernel.spec
    TAR     kernel-4.15.0_rc2+.tar.gz

    ERROR:
    Building source tarball is not possible outside the
    kernel source tree. Don't set KBUILD_OUTPUT, or use the
    binrpm-pkg or bindeb-pkg target instead.

  ../scripts/package/Makefile:53: recipe for target 'rpm-pkg' failed

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/package/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 61e29da..9fbcf5e 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -32,10 +32,14 @@ MKSPEC     := $(srctree)/scripts/package/mkspec
 
 quiet_cmd_src_tar = TAR     $(2).tar.gz
       cmd_src_tar = \
+set -e; \
 if test "$(objtree)" != "$(srctree)"; then \
-	echo "Building source tarball is not possible outside the"; \
-	echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
-	echo "binrpm-pkg or bindeb-pkg target instead."; \
+	echo >&2; \
+	echo >&2 "  ERROR:"; \
+	echo >&2 "  Building source tarball is not possible outside the"; \
+	echo >&2 "  kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
+	echo >&2 "  binrpm-pkg or bindeb-pkg target instead."; \
+	echo >&2; \
 	false; \
 fi ; \
 $(srctree)/scripts/setlocalversion --save-scmversion; \
-- 
2.7.4

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

* Re: [PATCH] kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail
  2017-12-06 10:32 [PATCH] kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail Masahiro Yamada
@ 2017-12-06 19:35 ` Jim Davis
  2017-12-12 15:08 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Davis @ 2017-12-06 19:35 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild, Michal Marek, linux-kernel

On Wed, Dec 6, 2017 at 3:32 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> We do not support out-of-tree building of rpm-pkg / deb-pkg.  If O=
> is given, the build should be terminated, but the "false" command is
> not effective because it is not the last command in the cmd_src_tar.
> Then, rpm-pkg / deb-pkg tries to continue building, and fails for a
> different reason.
>
> Set -e option so that the "false" terminates the building immediately.
>
> I also put the error messages to stderr, and made it stand out more.
>
> For example, "make O=foo rpm-pkg" will fail as follows:
>
>   /bin/bash ../scripts/package/mkspec >./kernel.spec
>     TAR     kernel-4.15.0_rc2+.tar.gz
>
>     ERROR:
>     Building source tarball is not possible outside the
>     kernel source tree. Don't set KBUILD_OUTPUT, or use the
>     binrpm-pkg or bindeb-pkg target instead.
>
>   ../scripts/package/Makefile:53: recipe for target 'rpm-pkg' failed
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  scripts/package/Makefile | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/package/Makefile b/scripts/package/Makefile
> index 61e29da..9fbcf5e 100644
> --- a/scripts/package/Makefile
> +++ b/scripts/package/Makefile
> @@ -32,10 +32,14 @@ MKSPEC     := $(srctree)/scripts/package/mkspec
>
>  quiet_cmd_src_tar = TAR     $(2).tar.gz
>        cmd_src_tar = \
> +set -e; \
>  if test "$(objtree)" != "$(srctree)"; then \
> -       echo "Building source tarball is not possible outside the"; \
> -       echo "kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
> -       echo "binrpm-pkg or bindeb-pkg target instead."; \
> +       echo >&2; \
> +       echo >&2 "  ERROR:"; \
> +       echo >&2 "  Building source tarball is not possible outside the"; \
> +       echo >&2 "  kernel source tree. Don't set KBUILD_OUTPUT, or use the"; \
> +       echo >&2 "  binrpm-pkg or bindeb-pkg target instead."; \
> +       echo >&2; \
>         false; \
>  fi ; \
>  $(srctree)/scripts/setlocalversion --save-scmversion; \
> --
> 2.7.4
>

Tested-by: Jim Davis <jim.epost@gmail.com>

-- 
Jim

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

* Re: [PATCH] kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail
  2017-12-06 10:32 [PATCH] kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail Masahiro Yamada
  2017-12-06 19:35 ` Jim Davis
@ 2017-12-12 15:08 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2017-12-12 15:08 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Masahiro Yamada, Michal Marek, Linux Kernel Mailing List

2017-12-06 19:32 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> We do not support out-of-tree building of rpm-pkg / deb-pkg.  If O=
> is given, the build should be terminated, but the "false" command is
> not effective because it is not the last command in the cmd_src_tar.
> Then, rpm-pkg / deb-pkg tries to continue building, and fails for a
> different reason.
>
> Set -e option so that the "false" terminates the building immediately.
>
> I also put the error messages to stderr, and made it stand out more.
>
> For example, "make O=foo rpm-pkg" will fail as follows:
>
>   /bin/bash ../scripts/package/mkspec >./kernel.spec
>     TAR     kernel-4.15.0_rc2+.tar.gz
>
>     ERROR:
>     Building source tarball is not possible outside the
>     kernel source tree. Don't set KBUILD_OUTPUT, or use the
>     binrpm-pkg or bindeb-pkg target instead.
>
>   ../scripts/package/Makefile:53: recipe for target 'rpm-pkg' failed
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to linux-kbuild/misc.

-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2017-12-12 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 10:32 [PATCH] kbuild: pkg: make out-of-tree rpm/deb-pkg build immediately fail Masahiro Yamada
2017-12-06 19:35 ` Jim Davis
2017-12-12 15:08 ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.