Bug 278764 - lang/ruby3[1-3]: Convert post-patch to EXTRACT_AFTER_ARGS and use helpers
Summary: lang/ruby3[1-3]: Convert post-patch to EXTRACT_AFTER_ARGS and use helpers
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yasuhiro Kimura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-04 19:30 UTC by Daniel Engberg
Modified: 2024-05-19 09:20 UTC (History)
2 users (show)

See Also:
yasu: maintainer-feedback+


Attachments
Patch for ruby32 (1.64 KB, patch)
2024-05-04 19:30 UTC, Daniel Engberg
no flags Details | Diff
Patch for ruby32 v2 (1.76 KB, patch)
2024-05-05 13:30 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2024-05-04 19:30:35 UTC
Created attachment 250399 [details]
Patch for ruby32

Skip extracting files instead of discarding them after extraction to reduice I/O
While at it also use USES= localbase instead of setting it by hand

Poudriere bulk OK
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2024-05-05 13:30:06 UTC
Created attachment 250451 [details]
Patch for ruby32 v2

Be more specific about what files to remove and preserve original flags
Comment 2 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-05-06 01:13:23 UTC
(In reply to Daniel Engberg from comment #1)

Thanks for patch.

+# We get these from other ports
+EXTRACT_AFTER_ARGS=	--exclude ${DISTNAME}/bin/gem \
+			--exclude ${DISTNAME}/ext/win32* \
+			--exclude ${DISTNAME}/lib/bundler* \
+			--exclude ${DISTNAME}/libexec/bundler \
+			--exclude ${DISTNAME}/man/erb.1 \
+			--exclude ${DISTNAME}/man/irb.1 \
+			--exclude ${DISTNAME}/man/ri.1 \
+			--no-same-owner --no-same-permissions
+

Would you please explain why last two options are necessary?
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2024-05-06 05:20:40 UTC
Hi,

They're default ones in the framework. See https://cgit.freebsd.org/ports/tree/Mk/bsd.port.mk#n2154

Best regards,
Daniel
Comment 4 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-05-06 09:15:42 UTC
(In reply to Daniel Engberg from comment #3)

Thanks for explanation.
BTW the change seems to be applicable to other ruby versions. So would you please apply it to them too?

Regards.
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-05-14 04:30:58 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=84f001c6c642cf3c87f6fc4a0a1327dc5182cf1c

commit 84f001c6c642cf3c87f6fc4a0a1327dc5182cf1c
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-05-14 04:26:43 +0000
Commit:     Yasuhiro Kimura <yasu@FreeBSD.org>
CommitDate: 2024-05-14 04:26:43 +0000

    lang/ruby3[1-3]: Refine ports

    * Skip extracting unnecessary files by setting EXTRACT_AFTER_ARGS
      instead of removing them with post-patch target after they are
      extracted.
    * Use 'USES=localbase' to set path of header and library files.

    PR:             278764

 lang/ruby31/Makefile | 22 ++++++++++++----------
 lang/ruby32/Makefile | 22 ++++++++++++----------
 lang/ruby33/Makefile | 22 ++++++++++++----------
 3 files changed, 36 insertions(+), 30 deletions(-)
Comment 6 Yasuhiro Kimura freebsd_committer freebsd_triage 2024-05-14 04:33:27 UTC
Committed. Thanks!
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2024-05-19 09:20:04 UTC
Thanks for adapting this to the other ruby ports!