From nobody Mon Sep 6 15:14:42 2021 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 E159117B4149 for ; Mon, 6 Sep 2021 15:14:47 +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 4H3BlW5hvvz4VDw; Mon, 6 Sep 2021 15:14:47 +0000 (UTC) (envelope-from list_freebsd@bluerosetech.com) 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 6C4E338D89; Mon, 6 Sep 2021 15:14:45 +0000 (UTC) Received: from [IPv6:2602:41:642b:630:41d5:e8d1:d896:2e26] (unknown [IPv6:2602:41:642b:630:41d5:e8d1:d896:2e26]) by chombo.houseloki.net (Postfix) with ESMTPSA id F15D09BFB; Mon, 6 Sep 2021 08:14:43 -0700 (PDT) Subject: Re: Why no flavor_USES helper? To: Baptiste Daroussin Cc: freebsd-ports@freebsd.org References: <8982e300-8b04-f31a-9c49-43d0dd428b38@bluerosetech.com> <20210906081612.rxo2os7dvx5mkvz6@aniel.nours.eu> <1f0f9a6c-09a6-86f9-625f-e9e482dc0e83@bluerosetech.com> <20210906134047.vs2jfg5dsz7c3jm2@aniel.nours.eu> From: Mel Pilgrim Message-ID: Date: Mon, 6 Sep 2021 08:14:42 -0700 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: <20210906134047.vs2jfg5dsz7c3jm2@aniel.nours.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4H3BlW5hvvz4VDw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On 2021-09-06 6:40, Baptiste Daroussin wrote: > On Mon, Sep 06, 2021 at 06:33:29AM -0700, Mel Pilgrim wrote: >> On 2021-09-06 1:16, Baptiste Daroussin wrote: >>> On Sun, Sep 05, 2021 at 10:39:29AM -0700, Mel Pilgrim wrote: >>>> The flavors helpers like flavor_RUN_DEPENDS are super useful, but I need to >>>> modify USES based on flavor, and find that there is no helper for it. >>> >>> Besause USES are loader 100 lines earlier, meaning only USES are already >>> processed when we expand the helper. >>> >>> Without getting to far in the technical details, USES and FLAVORS are basically >>> expanded at the moment, in pre and post section, meaning one had to decide >>> either we should allow USES to define flavors, or we should allow USES helpers. >> >> Is this why there odd race conditions between USES and FLAVORS where, for >> example, if I have a FLAVOR that does USES+=pgsql and WANT_PGSQL, the >> corresponding postgresqlN-* ports aren't added to *_DEPENDS? > > I don't know, neither heard of that specific case, but it could be, if so, that > sound like a bug in pgsql.mk, I am interesting in an example that show this > behaviour. I use an overlay with poudriere as part of a deployment system. Part of it is ports-mgmt/superpkg, which uses FLAVORS to represent different server profiles. It's mostly a series of lines like this: .if ${FLAVOR} == mognet USES+= ds hwtools hyve mailbox mx ns webbase zfstools Which in turn references Mk/Uses files in the overlay. The one where I hit this apparent race condition is Mk/Uses/mailbox.mk which adds PostgreSQL server and contrib RUN_DEPENDS with these lines: USES+= pgsql phpenv WANT_PGSQL= contrib server .include "${PORTSDIR}/Mk/Uses/pgsql.mk" Without that .include line, the postgres RUN_DEPENDS don't get added. It's something specific to pgsql.mk. The phpenv.mk file, a php analog to python:env, gets included from this file. In another overlaid USES file, I have USES+=python:env and that also works fine.