From nobody Sat Dec 17 00:03:22 2022 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 4NYmQW2k8xzt5dF for ; Sat, 17 Dec 2022 00:03:31 +0000 (UTC) (envelope-from tatsuki_makino@hotmail.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2095.outbound.protection.outlook.com [40.92.53.95]) (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 4NYmQV5JLLz4KSl for ; Sat, 17 Dec 2022 00:03:30 +0000 (UTC) (envelope-from tatsuki_makino@hotmail.com) Authentication-Results: mx1.freebsd.org; none ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DpypybPqtCPyg/5UgIDy8uEqs0IJOO+3CKyem8g47OSqodfkesEOK+ECDvdhyUv91crFkTMioxJ2j8OMzRHFqaJKjuLYuSyDtfG24bAFDhOxXmo/8QYSJ0VSjFmnYDzpsdi61S88/71NR31QrL2kKO+vFvKDVTLKTfBjfwSX3/SMh1+praARrjlLd9BLUsGfdjh5KBmkcfpmkMvkwIp2Jk/Q2efhguaitCPXrwVhxQ5Nq5ySksx174Ozg3lUakgXcs54RamvqxD4yDFwgK5V+HQUQyDnnUVeTI+hr8oLjnD4H2L1DiJgFF2Ae+PCIPCqYA1CRlN652tBt7ALbANfSg== 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=itwWGfH8Ay1+61vG84Bs5t8ig7tgoFgVvoR4KMf14Eg=; b=WmFgHINjJMrisNIKoupm6N4O/LwejMJXx+7FObvVXLqcCO7s7OacKB2710jIBdof245rXo8hTM/9mFjk/fA/hd8hTelZVZb6Wq6REMQE9R7vgr69MObPe87YrTGIKPb6cARq3JC1S2fCmquVf7oHDn2WAD/P6q0VtSPAKJ0A6lAYqn+oZY9Uyr1MrSuOiAM4kr9FeB3NF9tJeqkrw8JBvMBZuHMU5pJpiGna5ttr+IlFJtymYARej5GuYa8CQWQ1+/CHm3i1qvubtzXwHqFxT2zKTCmt5n4m9Mxea5A8LINr4tC9ltuz5WCSraH4/Hb0bXriCd/IyeAMvbklHyAujw== 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=itwWGfH8Ay1+61vG84Bs5t8ig7tgoFgVvoR4KMf14Eg=; b=YbloIHQ9nei37G+xYoKlUs5SStZxHoR7ZXcIfUEmIcZrQhNp5GZA1izGXTxVAu9F6zs896RNtTKKvdC/o+1wXuFjjvVkoYL+/CqvNocOg1Us6ZvJUg/x/LX6N0Qax/BUk56a4BjW5CoHqKGaeEst5NU4XSG1Gg8VrPuL4ULFBKfSXAAUcKONobpQ1CMX9n2UBFsnYiuCqRnoOPqY2EZNbKIuNBQaxht1mBhZSkkyHRNgnNhnE8ruIsH434TpRtuy0/JQheOOQU3KaIAxHW006HVrWQCDQf4xG1uoQ1X1M6Pqfw3AUG+oyO4mxePBfMIcR3lh/dgORPD9eq7Zr51taw== Received: from PSAPR03MB5639.apcprd03.prod.outlook.com (2603:1096:301:66::13) by KL1PR03MB5917.apcprd03.prod.outlook.com (2603:1096:820:82::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11; Sat, 17 Dec 2022 00:03:25 +0000 Received: from PSAPR03MB5639.apcprd03.prod.outlook.com ([fe80::cfcf:c96:dd73:132]) by PSAPR03MB5639.apcprd03.prod.outlook.com ([fe80::cfcf:c96:dd73:132%3]) with mapi id 15.20.5924.011; Sat, 17 Dec 2022 00:03:25 +0000 Subject: Re: How do I depend on a port regardless of its flavor? To: Mel Pilgrim , freebsd-ports@freebsd.org References: <93d4c94a-c8dd-f4e6-b910-619f07e61ae2@bluerosetech.com> From: Tatsuki Makino Message-ID: Date: Sat, 17 Dec 2022 09:03:22 +0900 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 In-Reply-To: <93d4c94a-c8dd-f4e6-b910-619f07e61ae2@bluerosetech.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TMN: [AL0WQzsf+AJNPhSYJTqQagdcX4+vErTZ] X-ClientProxiedBy: TYCP286CA0134.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b6::16) To PSAPR03MB5639.apcprd03.prod.outlook.com (2603:1096:301:66::13) 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: PSAPR03MB5639:EE_|KL1PR03MB5917:EE_ X-MS-Office365-Filtering-Correlation-Id: 1eb75267-43ca-43e4-eba0-08dadfc21e52 X-MS-Exchange-SLBlob-MailProps: Op6Ru+d2ciGKgT5D8qDtQf32eTAvzmF6F1Kl2foHZEBhGp/yPl8LHIWNC3FAfsypALnlyNVXWZP9EQhtAZfhI5v/P8aYwbFf2xKUCeKcHepPwHhhnPv2WvTsnlmsMJT42tMYNmsxk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VTcG9ES2F6KytWa3k3NHN3T1RmeHhxMDhWeGpJMVozU093dUFW?= =?utf-8?B?N0N1eTZZUkxFWTFYRS8vb29jUVhKdW83dnVBQ0JLU2NWb0paa0wyWGxXVDZ2?= =?utf-8?B?N3hocmhQbWRLakFQY3FyeTdCdTJqeTVLQi9BYURKY20rcys4K1lvZTFIMjBm?= =?utf-8?B?QlJvc2gxenRLNEQ1cEN2N3hzOXh4MEJXdG83TFZvb000cFlZRjRzOE03OHRU?= =?utf-8?Q?0B1Dya0ZYvNCP/YrUg=3D?= X-OriginatorOrg: sct-15-20-4734-24-msonline-outlook-c0b75.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 1eb75267-43ca-43e4-eba0-08dadfc21e52 X-MS-Exchange-CrossTenant-AuthSource: PSAPR03MB5639.apcprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2022 00:03:25.5652 (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: KL1PR03MB5917 X-Rspamd-Queue-Id: 4NYmQV5JLLz4KSl X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8075, ipnet:40.80.0.0/12, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Mel Pilgrim wrote on 2022/12/17 06:49: > On 2022-12-13 19:34, Tatsuki Makino wrote: >> RUN_DEPENDS= foo>=1.2:devel/foo@nondefaultflavor > No, that makes the port depend on that specific flavor.  I need to allow any flavor to be installed. >> The majority of the Python module is like this. > Yes and, per my original post, this is about depending on a port that doesn't have such a framework around it. > > For example, let's say I have a run dependency on postfix.  It has six flavors: > > # pkg search -qL pkg-name mail/postfix$ > postfix-sqlite-3.7.3_1,1 > postfix-sasl-3.7.3_1,1 > postfix-pgsql-3.7.3_1,1 > postfix-3.7.3_1,1 > postfix-ldap-3.7.3_1,1 > postfix-mysql-3.7.3_1,1 > > As all six flavors will provide what is needed in this example situation, there is no reason to limit which one the user can install. Okay. This is, after all, just like llvm-devel flavor of my earlier email. It's time to pass the baton to people-familiar-with-flavor@FreeBSD :) > If I have this: > > RUN_DEPENDS= postfix>=3.7.3:mail/postfix > > and the user has, say, postfix-sqlite-3.7.3_1,1 installed, then the Ports System will think the dependency isn't met and try to build mail/postfix.  Pkg will similarly not see postfix-sqlite-3.7.3_1,1 as a viable dependency due to the pkgname mismatch, try to install postfix, and fail on the conflict. > > However, if I have this: > > RUN_DEPENDS= postfix:mail/postfix > > and user has postfix-sqlite-3.7.3_1,1 installed, the Ports System will see that as meeting the depedency because the lack of version spec reduces the check to seeing if "postfix" is a file.  Since all flavors of postfix install that program, all of them meet it.  But now I can't specify a version restriction. > > So, in this specific example, the question becomes: > > What format does the RUN_DEPENDS line need to take to declare that any flavor of postfix will meet the requirement so that the user can install any flavor they want either via Ports or pkg? > > I'm asking because, given this problem was created by the FLAVORS implementation modifying pkgname, it must be just a matter of outdated documentation that the Porter's Handbook doesn't say how to handle this case. > > I mean, no one would be mad enough to choose that approach and not update the dependency solver(s) to handle it, right? For python, Mk/bsd.default-versions.mk is the way to fix the FLAVOR, but is there any way to know the FLAVOR of postfix or other pre-installed stuff? I can only think of the following methods. POSTFIX_PKGNAME!= pkg query %n mail/postfix || echo postfix-sqlite # use flavor @sqlite .if empty(POSTFIX_PKGNAME:Mpostfix-*) RUN_DEPENDS+= postfix>0:mail/postfix .else RUN_DEPENDS+= ${POSTFIX_PKGNAME}>0:mail/postfix@${POSTFIX_PKGNAME:S/postfix-//} .endif If that fails, it need to use other methods. Using the same flavors as postfix, OPTIONS to choose postfix flavor or split into m@ster and sl@ve... Regards.