Bug 284154 - net/rsync: FAILED Applying FreeBSD patch-t_stub.c
Summary: net/rsync: FAILED Applying FreeBSD patch-t_stub.c
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Rodrigo Osorio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-19 11:52 UTC by iron.udjin
Modified: 2025-01-19 22:03 UTC (History)
0 users

See Also:


Attachments
rework the test fix (971 bytes, patch)
2025-01-19 14:43 UTC, Rodrigo Osorio
no flags Details | Diff
fix when no option is active (774 bytes, patch)
2025-01-19 21:54 UTC, Rodrigo Osorio
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description iron.udjin 2025-01-19 11:52:22 UTC
===>  Cleaning for rsync-3.4.1_1
===>  License GPLv3+ accepted by the user
===>   rsync-3.4.1_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by rsync-3.4.1_1 for building
===>  Extracting for rsync-3.4.1_1
=> SHA256 Checksum OK for rsync-3.4.1.tar.gz.
===>  Patching for rsync-3.4.1_1
===>  Applying FreeBSD patches for rsync-3.4.1_1 from /usr/ports/net/rsync/files
1 out of 1 hunks failed--saving rejects to t_stub.c.rej
===>  FAILED Applying FreeBSD patch-t_stub.c
===> FAILED to apply cleanly FreeBSD patch(es)  patch-t_stub.c
*** Error code 1
Comment 1 iron.udjin 2025-01-19 12:01:11 UTC
It builds fine using poudriere. The problem only with build using portmaster or "make build".
Comment 2 Rodrigo Osorio freebsd_committer freebsd_triage 2025-01-19 14:09:37 UTC
(In reply to iron.udjin from comment #1)

Looks like the patches are not applied in the same order using poudriere and
portmaster.

The issue with tests was introduces by fileflags patch who first patch t_stub.c
so I add a patch to revert the faulty change.

I will try to fix the fileflags patch first and see if it works with poudriere

Thanks for the heads-up

cheers
-- rodrigo
Comment 3 Rodrigo Osorio freebsd_committer freebsd_triage 2025-01-19 14:43:31 UTC
Created attachment 256805 [details]
rework the test fix

Hi,

I wasn't able to reproduce the issue by just running `make patch`
so apparently this can be a portmaster issue.

I add a reworked version of my fix by removing files/patch-t_stub.c
and updating fileflags.diff during pre-patch stage.

Let me know how it works with portmastre
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-01-19 21:06:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5e8e9ffbff18ffa1cc46d7833227e4143030d314

commit 5e8e9ffbff18ffa1cc46d7833227e4143030d314
Author:     Rodrigo Osorio <rodrigo@FreeBSD.org>
AuthorDate: 2025-01-19 14:25:16 +0000
Commit:     Rodrigo Osorio <rodrigo@FreeBSD.org>
CommitDate: 2025-01-19 21:02:53 +0000

    net/rsync: fix build with portmaster

    Change the fix for tests to unbreak the build with postmaster

    PR:             284154
    Reported by:    <iron.udjin@gmail.com>

 net/rsync/Makefile                    |  3 +++
 net/rsync/files/patch-t_stub.c (gone) | 10 ----------
 2 files changed, 3 insertions(+), 10 deletions(-)
Comment 5 Rodrigo Osorio freebsd_committer freebsd_triage 2025-01-19 21:07:44 UTC
Committed, thanks
Comment 6 iron.udjin 2025-01-19 21:20:05 UTC
It seems there is missing patch:

===>  Cleaning for rsync-3.4.1_1
===>  License GPLv3+ accepted by the user
===>   rsync-3.4.1_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by rsync-3.4.1_1 for building
===>  Extracting for rsync-3.4.1_1
=> SHA256 Checksum OK for rsync-3.4.1.tar.gz.
===>  Patching for rsync-3.4.1_1
sed: /usr/ports/net/rsync/work/rsync-3.4.1/patches/fileflags.diff: No such file or directory
*** Error code 1
Comment 7 Rodrigo Osorio freebsd_committer freebsd_triage 2025-01-19 21:35:49 UTC
(In reply to iron.udjin from comment #6)

Can you check your environment ?
Additional patches are provided as a single tarball and has to
be in the WRKSRC one way or another.
Comment 8 iron.udjin 2025-01-19 21:39:11 UTC
Where should it be?

IRON ports/net/rsync # make clean
===>  Cleaning for rsync-3.4.1_1
IRON ports/net/rsync # make patch
===>  License GPLv3+ accepted by the user
===>   rsync-3.4.1_1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by rsync-3.4.1_1 for building
===>  Extracting for rsync-3.4.1_1
=> SHA256 Checksum OK for rsync-3.4.1.tar.gz.
===>  Patching for rsync-3.4.1_1
sed: /usr/ports/net/rsync/work/rsync-3.4.1/patches/fileflags.diff: No such file or directory
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net/rsync
*** Error code 1

Stop.
make: stopped in /usr/ports/net/rsync
IRON ports/net/rsync # ls -la /usr/ports/net/rsync/work/rsync-3.4.1/patches
ls: /usr/ports/net/rsync/work/rsync-3.4.1/patches: No such file or directory
IRON ports/net/rsync # find . -name fileflags.diff
IRON ports/net/rsync #
Comment 9 Rodrigo Osorio freebsd_committer freebsd_triage 2025-01-19 21:54:26 UTC
Created attachment 256821 [details]
fix when no option is active

I got it, it's because you disable all option
Can you try this patch and let me know it it fix your problems ?
Comment 10 iron.udjin 2025-01-19 21:57:11 UTC
Works! Thank you.

My Options are:
	DOCS           : off
	FLAGS          : off
	ICONV          : off
	POPT_PORT      : off
	RENAMED        : off
	SSH            : on
	ZLIB_BASE      : on
Comment 11 commit-hook freebsd_committer freebsd_triage 2025-01-19 22:03:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7f56364aa54e286c2bc328343fb0f94d27329150

commit 7f56364aa54e286c2bc328343fb0f94d27329150
Author:     Rodrigo Osorio <rodrigo@FreeBSD.org>
AuthorDate: 2025-01-19 21:46:34 +0000
Commit:     Rodrigo Osorio <rodrigo@FreeBSD.org>
CommitDate: 2025-01-19 21:59:32 +0000

    net/rsync: fix test patch when all options are disabled

    If all options are disabled, the extra-patch distfile is not
    extracted, breaking the build.
    Make this step optional if at least one option is active.

    PR:             284154

 net/rsync/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)