From nobody Wed Nov 1 10:48:31 2023 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SL3ml3Mf5z50FLX for ; Wed, 1 Nov 2023 10:54:47 +0000 (UTC) (envelope-from yasu@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SL3ml2llrz3ZcG; Wed, 1 Nov 2023 10:54:47 +0000 (UTC) (envelope-from yasu@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698836087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o4f58z7x39ZAq8Pi6/mUB5paCbK/bR5x2OuvYOSsImY=; b=lnExtTc5MpzP8CrFvCyNtEiwqTSIvD+nOMHsrnKbyKMepaUScWJNZfqC+0i7x/N5VSJHoF /I1vPywSa5tFGvJwwPcnU22aWY5bxzDG7YrKlkdsREUufS4eI3VZtokYDcijLokraXRoU9 ZEqJ2zCSpOkvOVxfLn6HfWksZq8i58R48+Qc9KS5MD+2D1Xxb1rrdxjHTDTaBMJXwDlwIQ 1AmB/eroqKdbMs46kM0nlZdGO70KoBhrAdrFqOLDG6clWnhYLVT3jxo/+wEdofXWrf2dAl 7TqoxGc62Gx2/VlvXfem9Qrbj6FjM9PLtHFu/s08M1h/dxAw1mNdWqaVLbovvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698836087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o4f58z7x39ZAq8Pi6/mUB5paCbK/bR5x2OuvYOSsImY=; b=i6UY0RsJg4pb1pga72oEgygZ+mmap2ei018niSmKAS3n8ed3HRwSPJauWE23W1CVlzFiXu tnjjbCmQnejsvWaScAtFdQiNv4JvdlXwys8ccIjeYP4GLkCce4Xpp6sPpy9mDB7rjpS0T+ HwlnAR9QRcKss+7CJWpuk0Sr9xRLpVb5MnEA9jx5y+Cc68NbsV0lZKiZfT5tiBpRderOTF GA6O2xwqvLwlxmwvxQixC7rd3joQpKcaa26nrusz2SB5b5AVDLFSqyj9/L5+zUOZetwX5k RBTdq55rtXpdQSQpWBQrLDX+iTutbwq0ZVPMpMocZX6Ry7ee9Vqf4afWLCRKdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698836087; a=rsa-sha256; cv=none; b=EZftZ69o1xlclAcs8d3mcqyK/x+avjg1IMeXvGju20Ep8wLknx0SjV7JNsieELeEB7wPtD NN5k6gKZnJwjPC54y/EE50WYYd8IlQ9tPmvxcShMuToB/Eav5Tr7Lddr2B63QeNNR8erPx zD8RHozcaKpkC52tN8hNTwxTz1Ctf1pkVUyPYiJrG0hmBYnby0KB/P7Cuf2ueOfDNFmLrl FEpLJ1v5Ndj3ZxwNHY+58dD+AC9o3Qa/ytw2cCIokq/wX9mp9A+DOelwK7gs+dN/N6iqf6 jYpGtKJJ6GftW5y/70uD07tqpgknk/8e4LAF0QYpgyvg/cFltvOULawS7z01zw== Received: from localhost (unknown [IPv6:240b:11:220:fe00::174:11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: yasu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SL3mk4X8Pz15Jf; Wed, 1 Nov 2023 10:54:46 +0000 (UTC) (envelope-from yasu@FreeBSD.org) Date: Wed, 01 Nov 2023 19:48:31 +0900 (JST) Message-Id: <20231101.194831.884534926634764408.yasu@FreeBSD.org> To: freebsd-ports@freebsd.org Subject: 'USES=shebangfix' doesn't work with samba ports From: Yasuhiro Kimura X-Mailer: Mew version 6.9 on Emacs 30.0.50 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, In following bug report some patches are submitted that update samba and its dependent ports to newer version. Bug 270383 net/samba417: Add new port https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270383 While testing them I noticed 'USES=shebangfix' doesn't work as is expected with current samba ports. For example there is following definition at line 100 and 101 of net/samba416/Makefile. ---------------------------------------------------------------------- USES= compiler:c++11-lang iconv localbase:ldflags \ perl5 pkgconfig shebangfix waf gettext-runtime ---------------------------------------------------------------------- And SHEBANG_FILES is defined as following at line 559. ---------------------------------------------------------------------- SHEBANG_FILES= ${PATCH_WRKSRC}/source4/scripting/bin/* ${PATCH_WRKSRC}/selftest/* ---------------------------------------------------------------------- Since the value of PATCH_WRKSRC is same as that of WRKSRC by default, shebang line of files under ${WRKSRC}/source4/scripting/bin/ and ${WRKSRC}/selftest/ should be fixed properly. And source4/scripting/bin/gen_error_common.py is one of such files. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd2[1251]% pwd /usr/ports/net/samba416 yasu@rolling-vm-freebsd2[1252]% make extract ===> Cleaning for samba416-4.16.11 ===> License GPLv3+ accepted by the user ===> samba416-4.16.11 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by samba416-4.16.11 for building ===> Extracting for samba416-4.16.11 => SHA256 Checksum OK for samba-4.16.11.tar.gz. yasu@rolling-vm-freebsd2[1253]% head -1 work/samba-4.16.11/source4/scripting/bin/gen_error_common.py #!/usr/bin/env python3 ---------------------------------------------------------------------- But it stays unchanged with `make patch`. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd2[1263]% pwd /usr/ports/net/samba416 yasu@rolling-vm-freebsd2[1264]% make extract ===> License GPLv3+ accepted by the user ===> samba416-4.16.11 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by samba416-4.16.11 for building ===> Extracting for samba416-4.16.11 => SHA256 Checksum OK for samba-4.16.11.tar.gz. yasu@rolling-vm-freebsd2[1265]% head -1 work/samba-4.16.11/source4/scripting/bin/gen_error_common.py #!/usr/bin/env python3 yasu@rolling-vm-freebsd2[1266]% make patch ===> Patching for samba416-4.16.11 ===> Applying extra patch /usr/ports/net/samba416/files/0001-Compact-and-simplify-modules-build-and-config-genera.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0002-Adjust-abi_gen.sh-script-to-run-under-FreeBSD-with-i.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0003-Mask-CLang-prototype-warnings-in-kadm5-admin.h.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0004-On-FreeBSD-date-1-has-different-semantics-than-on-Li.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0005-Include-jemalloc-jemalloc.h-if-ENABLE_JEMALLOC-is-se.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0006-Install-nss_-modules-into-PAMMODULESDIR-path.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0007-Use-macro-value-as-a-default-backlog-size-for-the-li.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0008-Brute-force-work-around-usage-of-Linux-specific-m-fl.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0009-Make-sure-that-config-checks-fail-if-the-warning-is-.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0010-Add-option-with-pkgconfigdir-to-specify-alternative-.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0011-Use-provided-by-port-location-of-the-XML-catalog.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0012-Create-shared-libraries-according-to-the-FreeBSD-spe.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0013-Pass-additional-msg-parameter-to-CHECK_LIB-so-it-can.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0014-Add-option-to-disable-CTDB-tests-failing-on-FreeBSD-.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0015-Add-extra-debug-class-to-trck-down-DB-locking-code.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0016-Make-ldb_schema_attribute_compare-a-stable-comparisi.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0017-Use-arc4random-when-available-to-generate-random-tal.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0018-Add-configuration-option-that-allows-to-choose-alter.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0019-From-923bc7a1afeb0b920e60e14846987ae1d2d7dca4-Mon-Se.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0020-FreeBSD-12-between-r336017-and-r342928-wrongfuly-ret.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0021-Fix-casting-warnings-in-the-nfs_quota-debug-message.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0022-Clean-up-UTMP-handling-code-and-add-FreeBSD-support..patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0023-Add-cmd_get_quota-test-function-into-vfstest-to-test.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0025-From-d9b748869a8f4018ebee302aae8246bf29f60309-Mon-Se.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0026-vfs-add-a-compatibility-option-to-the-vfs_streams_xa.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0028-s3-lib-system-add-FreeBSD-proc_fd_pattern.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0099-s3-modules-zfsacl-fix-get-set-ACL-on-FreeBSD-13.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0099-s4-mitkdc-Add-support-for-MIT-Kerberos-1.20.patch with -p1 ===> Applying FreeBSD patches for samba416-4.16.11 from /usr/ports/net/samba416/files yasu@rolling-vm-freebsd2[1067]% head -1 work/samba-4.16.11/source4/scripting/bin/gen_error_common.py #!/usr/bin/env python3 ---------------------------------------------------------------------- And it isn't the only one. To investigate it I add some debug messages to fix-shebang target defined in Mk/Uses/shebangfix.mk. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd2[1269]% git diff diff --git a/Mk/Uses/shebangfix.mk b/Mk/Uses/shebangfix.mk index 20dba5279964..6a427b6a4262 100644 --- a/Mk/Uses/shebangfix.mk +++ b/Mk/Uses/shebangfix.mk @@ -85,6 +85,7 @@ _SHEBANG_REINPLACE_ARGS+= -e "1s|^\#![[:space:]]*${old_cmd:C/\"//g}$$|\#!${${lan _USES_patch+= 210:fix-shebang fix-shebang: + @${ECHO_CMD} target fix-shebang start . if defined(SHEBANG_REGEX) @cd ${WRKSRC}; \ ${FIND} -E . -type f -iregex '${SHEBANG_REGEX}' \ @@ -97,10 +98,13 @@ fix-shebang: -exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} + . endfor . endif + @${ECHO_CMD} "SHEBANG_FILES=\"${SHEBANG_FILES}\"" . if defined(SHEBANG_FILES) + @${ECHO_CMD} fixing SHEBANG_FILES @cd ${WRKSRC}; \ ${FIND} ${SHEBANG_FILES} -type f \ -exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} + . endif + @${ECHO_CMD} target fix-shebang end .endif ---------------------------------------------------------------------- With it `make -C /usr/ports/ftp/curl patch` works as following. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd2[1271]% make -C /usr/ports/ftp/curl patch ===> License MIT accepted by the user ===> curl-8.4.0 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by curl-8.4.0 for building ===> Extracting for curl-8.4.0 => SHA256 Checksum OK for curl-8.4.0.tar.xz. ===> Patching for curl-8.4.0 target fix-shebang start SHEBANG_FILES="*/*.pl" fixing SHEBANG_FILES target fix-shebang end ===> Applying FreeBSD patches for curl-8.4.0 from /usr/ports/ftp/curl/files ---------------------------------------------------------------------- All of 4 messages are displayed as is expected. On the other hand `make -C /usr/ports/net/samba416 patch` works as following. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd2[1275]% make -C /usr/ports/net/samba416 patch ===> License GPLv3+ accepted by the user ===> samba416-4.16.11 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by samba416-4.16.11 for building ===> Extracting for samba416-4.16.11 => SHA256 Checksum OK for samba-4.16.11.tar.gz. ===> Patching for samba416-4.16.11 target fix-shebang start SHEBANG_FILES="/usr/ports/net/samba416/work/samba-4.16.11/source4/scripting/bin/* /usr/ports/net/samba416/work/samba-4.16.11/selftest/*" target fix-shebang end ===> Applying extra patch /usr/ports/net/samba416/files/0001-Compact-and-simplify-modules-build-and-config-genera.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0002-Adjust-abi_gen.sh-script-to-run-under-FreeBSD-with-i.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0003-Mask-CLang-prototype-warnings-in-kadm5-admin.h.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0004-On-FreeBSD-date-1-has-different-semantics-than-on-Li.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0005-Include-jemalloc-jemalloc.h-if-ENABLE_JEMALLOC-is-se.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0006-Install-nss_-modules-into-PAMMODULESDIR-path.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0007-Use-macro-value-as-a-default-backlog-size-for-the-li.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0008-Brute-force-work-around-usage-of-Linux-specific-m-fl.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0009-Make-sure-that-config-checks-fail-if-the-warning-is-.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0010-Add-option-with-pkgconfigdir-to-specify-alternative-.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0011-Use-provided-by-port-location-of-the-XML-catalog.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0012-Create-shared-libraries-according-to-the-FreeBSD-spe.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0013-Pass-additional-msg-parameter-to-CHECK_LIB-so-it-can.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0014-Add-option-to-disable-CTDB-tests-failing-on-FreeBSD-.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0015-Add-extra-debug-class-to-trck-down-DB-locking-code.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0016-Make-ldb_schema_attribute_compare-a-stable-comparisi.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0017-Use-arc4random-when-available-to-generate-random-tal.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0018-Add-configuration-option-that-allows-to-choose-alter.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0019-From-923bc7a1afeb0b920e60e14846987ae1d2d7dca4-Mon-Se.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0020-FreeBSD-12-between-r336017-and-r342928-wrongfuly-ret.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0021-Fix-casting-warnings-in-the-nfs_quota-debug-message.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0022-Clean-up-UTMP-handling-code-and-add-FreeBSD-support..patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0023-Add-cmd_get_quota-test-function-into-vfstest-to-test.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0024-Cherry-pick-ZFS-provisioning-code-by-iXsystems-Inc.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0025-From-d9b748869a8f4018ebee302aae8246bf29f60309-Mon-Se.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0026-vfs-add-a-compatibility-option-to-the-vfs_streams_xa.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0028-s3-lib-system-add-FreeBSD-proc_fd_pattern.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0099-s3-modules-zfsacl-fix-get-set-ACL-on-FreeBSD-13.patch with -p1 ===> Applying extra patch /usr/ports/net/samba416/files/0099-s4-mitkdc-Add-support-for-MIT-Kerberos-1.20.patch with -p1 ===> Applying FreeBSD patches for samba416-4.16.11 from /usr/ports/net/samba416/files ---------------------------------------------------------------------- As you can see, 3rd message isn't displayed. It means SHEBANG_FILES isn't defined. But it obviously conflicts with the output of 2nd message. Same issue also happens with net/samba413. Can someone explain what is happening? Regards. --- Yasuhiro Kimura