From nobody Wed Apr 10 21:29:37 2024 X-Original-To: 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 4VFGF512LMz5G9JS for ; Wed, 10 Apr 2024 21:29:45 +0000 (UTC) (envelope-from mirror176@hotmail.com) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2054.outbound.protection.outlook.com [40.92.23.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VFGF42hwZz4c1B for ; Wed, 10 Apr 2024 21:29:44 +0000 (UTC) (envelope-from mirror176@hotmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hotmail.com header.s=selector1 header.b=gVQbRecO; dmarc=pass (policy=none) header.from=hotmail.com; spf=pass (mx1.freebsd.org: domain of mirror176@hotmail.com designates 40.92.23.54 as permitted sender) smtp.mailfrom=mirror176@hotmail.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ehPME8iE9HhGH7ZUgP002l/u+uI6xAgEoYTL0XzK2vj7AkyL4I+h+Lnh0btoOvlC34KgqL6G28ppSCAvRTnSZJqpBaM1PGTUj1RJmhbefq0mG7II0Jnk8DG6hi7U1Z12P1tpTWBjx0ANEQimAj9k/F2LqLb6bstXcHGJAuXCpYhY8TwItgmsgcqf9rCKrbf+7DGDfxKm9e7bFh4BggMyMMiA0Nqq4sqlHIX3cArB3/UcXHMMUPp75URt1g45JN2TmCS4abmV5Tl2f2LTuPKsCcUNlx1RGJTkU6iUkavvKBc8F92gJLVcR7PXrDPj4UFL1MbEMJY0u2XI2o3X58i7qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+twxRzbWeDZ4tRzk7TvoNE80ISbg3t8mxdCROow09n8=; b=npZqrcQ1T+vvwIL3zSZEH5PV9HbT9oz6ERjHGOSXMVDMjKq3j1N8mG3ptNxyVv/Jo4F3IEdFGEPrHHNL6CEV5TVPP5TzYYHxnRmNb5ZNYjqkdt1QWQkqX/5KJKg19Bjzp5hi974r/UM2hSULly1OoWFib3sEiPMeuPZaljmzUZ7J5h7nEqtTVxhv/NGaA+Ax21F+UtAsxisw/xHjYO8bmFeX2i+wgSbZQ97FZKdbGzfRInSLR08N+UclIbeI9XVOsKU1bpwbrgHP2XnZkj5srvEJ3qg0qNdhFPY3tx12l31HfZGTJSNI7U7fv7guEr07ZkwxZrHyGGMJckP+NHC74w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+twxRzbWeDZ4tRzk7TvoNE80ISbg3t8mxdCROow09n8=; b=gVQbRecOFlqFF7/QqIqU0SUgUV+sOLlBwJ7G4yZyABY6OmS7ldcc84pilh4ayNlc200m32NDF6fGyj2O3eLl3WqBvbzMuaCygeSETw4oL8rezg8+sSgY92c7280UqyKQ2m4VITXvwrZOX1CGFrTdRiNAWTpCIS8zEH7DkEc/OYj4TmO1yaMn09DtrWO54aYKjB864wKyCSse4MrH4vd9gDES92tlcSVWt646ise888OUe+r3FV4xLs+eJG2qvuf1qzssowDOPEVmETfEboYLHASpqYp5zDjaXIqdTq8skFA4te8Ks7Pdaaf2pBPGxNXotJR9E7gAlU7/nVVuJOl8rQ== Received: from CO1PR11MB4770.namprd11.prod.outlook.com (2603:10b6:303:94::19) by PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7430.46; Wed, 10 Apr 2024 21:29:41 +0000 Received: from CO1PR11MB4770.namprd11.prod.outlook.com ([fe80::e526:b74c:4798:1295]) by CO1PR11MB4770.namprd11.prod.outlook.com ([fe80::e526:b74c:4798:1295%4]) with mapi id 15.20.7452.019; Wed, 10 Apr 2024 21:29:41 +0000 Message-ID: Date: Wed, 10 Apr 2024 14:29:37 -0700 User-Agent: Mozilla Thunderbird Subject: Re: Porting question related to modifying original source code Content-Language: en-US To: ports@freebsd.org References: From: "Edward Sanford Sutton, III" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TMN: [tHF+iLErjf5gWkSp4cBwSiz4nfoaBOzQ] X-ClientProxiedBy: BL1PR13CA0385.namprd13.prod.outlook.com (2603:10b6:208:2c0::30) To CO1PR11MB4770.namprd11.prod.outlook.com (2603:10b6:303:94::19) X-Microsoft-Original-Message-ID: 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 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4770:EE_|PH0PR11MB5000:EE_ X-MS-Office365-Filtering-Correlation-Id: e072367c-62c8-4547-dec9-08dc59a554b7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ueXno7Jp/Qkz80CmS8o/yx3Q4qo8lCFVqlYNr3LWP3capUh24tfu/9wdHJgO4lH+VBekuKNZW+qt5v5eAJympELikmDhhYhUukAxXnl2gPxHGoAb2XyWWlW2vAO+F8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1YjgxbW1hOFFRRDUraUdo?= =?utf-8?B?Z1A4bUV0Y3VrY3hZVFFDK0JVK2x3SmdXajFFa2ZLNjZndDVpcFV0ZFNZbWpu?= =?utf-8?B?ajZhdVd0dXJldk4wbWwyKytsZ0VoSWdkTm14L2YwTDRaZVUzcFNGL0pQcE9P?= =?utf-8?B?Wlk1Vm53bFdxWGxNZWdaQUl5c09vOFZCRHFmZlhOWHBIRXBwTXpWVElScTNL?= =?utf-8?B?OUVYeWlNbFVhOE1PSFQ0MjNKL1lLSzZQTEJQOTJUdXhHSWNYcVN5cFBnSFFM?= =?utf-8?Q?eJTTVcximWE1mDRg1IqJLtAJVyy05qMd3Im53B+F6qp8=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-e8f36.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: e072367c-62c8-4547-dec9-08dc59a554b7 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4770.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2024 21:29:41.5026 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5000 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.38 / 15.00]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.89)[-0.886]; DMARC_POLICY_ALLOW(-0.50)[hotmail.com,none]; R_SPF_ALLOW(-0.20)[+ip4:40.92.0.0/16]; R_DKIM_ALLOW(-0.20)[hotmail.com:s=selector1]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[hotmail.com:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[hotmail.com]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[hotmail.com:+]; TO_DN_NONE(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.92.23.54:from]; MLMMJ_DEST(0.00)[ports@freebsd.org]; ASN(0.00)[asn:8075, ipnet:40.80.0.0/12, country:US]; RCVD_IN_DNSWL_NONE(0.00)[40.92.23.54:from] X-Rspamd-Queue-Id: 4VFGF42hwZz4c1B On 4/10/24 07:12, Gleb Popov wrote: > On Wed, Apr 10, 2024 at 5:09 PM Brad D wrote: >> >> Is it uncalled for replacing problematic embedded libraries with equivalent ones in a port as a dependency if the library is in the repo and well maintained? > > It is the other way around, we're usually striving to use > system-provided dependencies as much as possible. Correct. If the library has not been customized within that port then using a copy of the library from the ports tree has the benefits of building it once when multiple things depend on it and updates + vulnerabilities impact just that library can be tracked and applied to just that library accordingly. If FreeBSD requires modifications to the library for compatibility then that work is being done in one common place with all dependent ports benefiting from the work. If this port is the only user of that library then it may seem like it doesn't make sense to extract it into a port that then has to be maintained, but once again if there is a second consumer of the library then there are benefits and it is harder to tell that is the case when things are bundled. If this port is using a modified copy of the library bundled in then it may not be straightforward or be possible to use a copy from the ports tree. If it does not build properly on FreeBSD then it may need to be altered; if there is an unmodified port of the library then that port may be useful to learn what changes to consider but they may no longer apply. Watching for security issues of that library requires watching if that modified copy is influenced by them for both how it is changed and how it is (or could be) used; Many projects I have looked at bundle libraries to make it easier to build their port: smaller dependency list to give out, they depend on an older/newer library than is found on their commonly supported Linux distributions, or the library is not available as a package in a commonly used repo. Some projects stay on top of security issues while others may be oblivious to them for various reasons. If your port is pretty straightforward, bonus points for using EXTRACT_AFTER_ARGS+="--exclude path_to_a_folder_or_file_to_ignore" lines being added to exclude extracting the shared/unneeded files. Any file not needed to build the port and not included in a package of the port is a file that took disk I/O and "maybe" CPU time to extract and on cleanup to delete; builds to filesystems in RAM need less RAM to do so, SSD users save on unnecessary write cycles of their drive, and less things being written/deleted can mean less data to consider for its related fragmentation. I do not yet have a good workflow for determining what is not needed short of trial and error. I presume a filesystem, where atime is present/enabled, could identify all files read after extraction/patching completed to determine it. I've been meaning to do some basic testing of how many things could be avoided/skipped at least from extraction by extracting all ports and looking through duplicates and the folder I more commonly see now on github projects of 3rdparty. This feels like the thing that Mark Millard probably did somewhere and in a better way. A port I had done some work on using a .tar.gz takes 10.3s to extract and about 35-38s to clean all files. If reducing the extracted content it takes 11.4s to extract and about 39s to clean (both timed on magnetic hard drive with multiple runs ignoring the first on non-idle system). Not all archives, archivers and archive formats benefit from knowing what can be skipped. Decreasing 756M across 69609 files to 671M across 69555 files still sounded useful to me. I should try to see if I can put it in a loop or use longer lines but it was a little bit of clutter as the following: EXTRACT_AFTER_ARGS+= --exclude ${WRKSRC}/*.ods \ --exclude '*.pdf' \ --exclude '*.doc' \ --exclude '*.xls*' \ --exclude '*.xcf' \ --exclude '*.blend' \ --exclude '*.blend1' \ --exclude '*.yml' \ --exclude '*.vcproj' In my case, I did not have anything dynamic to the port but conditionally adding more EXTRACT_AFTER_ARGS arguments would likely help some ports further when port options change. I am sure porters can make a better interface we can do so we don't need to put "--exclude=..." (archiver specific parameter format) in front of each file/folder in every Makefile. Though it might be interesting to have a files to ignore list as an external file, I don't know if we like more files making up the ports tree vs a cleaner Makefile so someone better than myself will be making such calls of "best practices" but each has both advantages and disadvantages.