Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Andrey Nechypurenko <andreynech@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] support/scripts/: remove -E flag from patch call
Date: Thu, 30 Dec 2021 22:47:22 +0100	[thread overview]
Message-ID: <20211230214722.GJ3390456@scaer> (raw)
In-Reply-To: <20211214125510.13654-1-andreynech@gmail.com>

Andrey, All,

On 2021-12-14 13:55 +0100, Andrey Nechypurenko spake thusly:
> -E flag instructs patch to remove empty files. However, in some cases
> empty files are essential. If they are missing, build could be broken
> or other bad things can happen.

Do you have an example of a publicly accessible package that has this
issue?

> Signed-off-by: Andrey Nechypurenko <andreynech@gmail.com>

I was going to apply this, but then I was wondering; what about patches
that actually *want* to remove files?

It turns out that we do have a few patches that remove files:

    $ git grep -E '\+\+\+ /dev/null'
    board/roseapplepi/patches/uboot/0001-compiler-.h-sync-include-linux-compiler-.h-with-Linu.patch:+++ /dev/null
    board/roseapplepi/patches/uboot/0001-compiler-.h-sync-include-linux-compiler-.h-with-Linu.patch:+++ /dev/null
    board/roseapplepi/patches/uboot/0001-compiler-.h-sync-include-linux-compiler-.h-with-Linu.patch:+++ /dev/null
    boot/grub2/0033-verifiers-Move-verifiers-API-to-kernel-image.patch:+++ /dev/null
    boot/grub2/0034-efi-Move-the-shim_lock-verifier-to-the-GRUB-core.patch:+++ /dev/null
    boot/lpc32xxcdl/0002-delete_redundant_files.patch:+++ /dev/null2012-01-01 16:39:47.918907000 +0100
    boot/lpc32xxcdl/0002-delete_redundant_files.patch:+++ /dev/null2012-01-01 16:39:47.918907000 +0100
    package/babeltrace2/0001-configure-simplify-warning-flags-detection.patch:+++ /dev/null
    package/babeltrace2/0001-configure-simplify-warning-flags-detection.patch:+++ /dev/null
    package/babeltrace2/0001-configure-simplify-warning-flags-detection.patch:+++ /dev/null
    package/babeltrace2/0001-configure-simplify-warning-flags-detection.patch:+++ /dev/null
    package/gcc/10.3.0/0001-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch:+++ /dev/null
    package/gcc/8.4.0/0002-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch:+++ /dev/null
    package/gcc/9.4.0/0003-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch:+++ /dev/null
    package/openpgm/0001-Rename-openpgm-5.2.pc.in.patch:+++ /dev/null
    package/openvmtools/0003-Rename-poll-h-into-vm_poll-h-to-fix-build-failure-on-musl.patch:+++ /dev/null
    package/screen/0005-rename-sched_h.patch:+++ /dev/null

While a few of them could be rewriten so that the are actual renames
(now that we require a patch version that supports renames), some really
do want to remove files; that's notably the case with the uboot patch
for the roseapplepi board, or the babeltrace2 patch, as well as the gcc
patches...

Furthermore, some users may have alaready relied on this behaviour, that
empty files get removed, for their packages in theor br2-external
trees...

So we have an antagonist situation: some patches will want to rem ove
files, and some patches will want to not remove files. We can't satisfy
both, obviously.

So, unfortunately, it is not possible to apply your patch.

If your package really requires that the files be present and empty, you
should then use a post-patch hook to touch those files.

Unless someone comes up with a better idea...

Regards,
Yann E. MORIN.

> ---
>  support/scripts/apply-patches.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
> index e5a2fdd09e..6da83f6826 100755
> --- a/support/scripts/apply-patches.sh
> +++ b/support/scripts/apply-patches.sh
> @@ -114,7 +114,7 @@ function apply_patch {
>          exit 1
>      fi
>      echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
> -    ${uncomp} "${path}/$patch" | patch -g0 -p1 -E --no-backup-if-mismatch -d "${builddir}" -t -N $silent
> +    ${uncomp} "${path}/$patch" | patch -g0 -p1 --no-backup-if-mismatch -d "${builddir}" -t -N $silent
>      if [ $? != 0 ] ; then
>          echo "Patch failed!  Please fix ${patch}!"
>          exit 1
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-12-30 21:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 12:55 [Buildroot] [PATCH 1/1] support/scripts/: remove -E flag from patch call Andrey Nechypurenko
2021-12-30 21:47 ` Yann E. MORIN [this message]
2022-01-03 11:29   ` Andrey Nechypurenko
2022-01-03 17:11   ` Arnout Vandecappelle
2022-01-03 20:18     ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211230214722.GJ3390456@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=andreynech@gmail.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox