From nobody Fri Dec 16 21:49:16 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 4NYjRq3N2SzZkBm for ; Fri, 16 Dec 2022 21:49:27 +0000 (UTC) (envelope-from list_freebsd@bluerosetech.com) Received: from echo.brtsvcs.net (echo.brtsvcs.net [IPv6:2607:f740:c::4ae]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NYjRp53WGz45C7 for ; Fri, 16 Dec 2022 21:49:26 +0000 (UTC) (envelope-from list_freebsd@bluerosetech.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of list_freebsd@bluerosetech.com designates 2607:f740:c::4ae as permitted sender) smtp.mailfrom=list_freebsd@bluerosetech.com; dmarc=none Received: from chombo.houseloki.net (65-100-43-2.dia.static.qwest.net [65.100.43.2]) by echo.brtsvcs.net (Postfix) with ESMTPS id 9BB2138D0C; Fri, 16 Dec 2022 21:49:18 +0000 (UTC) Received: from [10.26.25.100] (ivy.pas.ds.pilgrimaccounting.com [10.26.25.100]) by chombo.houseloki.net (Postfix) with ESMTPSA id 359AE27E97; Fri, 16 Dec 2022 13:49:18 -0800 (PST) Subject: Re: How do I depend on a port regardless of its flavor? To: Tatsuki Makino , freebsd-ports@freebsd.org References: From: Mel Pilgrim Message-ID: <93d4c94a-c8dd-f4e6-b910-619f07e61ae2@bluerosetech.com> Date: Fri, 16 Dec 2022 13:49:16 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 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 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-2.30 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org]; FREEMAIL_TO(0.00)[hotmail.com,freebsd.org]; ASN(0.00)[asn:36236, ipnet:2607:f740:c::/48, country:US]; RCPT_COUNT_TWO(0.00)[2]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[bluerosetech.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4NYjRp53WGz45C7 X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 2022-12-13 19:34, Tatsuki Makino wrote: > Mel Pilgrim wrote on 2022/12/12 02:52: >> But I need to also specify a version spec. However, if I do this: >> >> RUN_DEPENDS= foo>=1.2:devel/foo >> >> That only works if the default flavor is installed. If one of the >> non-default flavors is installed, the Ports System doesn't find it >> and tries to build the port. Similarly, pkg thinks I need to >> install the default flavor. >> >> The flavors aren't part of a framework like Python, so I don't >> have a set of variables I can use to construct a universal pkg >> name. >> >> How do I add a version-limited dependency on a flavored port? > > Is this simply about the following? > > 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. 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?