From owner-freebsd-ports@freebsd.org Thu Dec 13 20:18:59 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C56A133320F for ; Thu, 13 Dec 2018 20:18:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FADE7078D; Thu, 13 Dec 2018 20:18:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id F2B1110B4CE; Thu, 13 Dec 2018 15:18:56 -0500 (EST) Subject: Re: Best way to deal with .pyc files? To: Mathieu Arnold Cc: Michael Gmelin , FreeBSD Ports References: <8D6D9096-468D-4E69-A6F2-79142C52395C@freebsd.org> <20181213093504.vwene4mp5cy5ehgd@atuin.in.mat.cc> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7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YEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 13 Dec 2018 12:18:56 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181213093504.vwene4mp5cy5ehgd@atuin.in.mat.cc> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 13 Dec 2018 15:18:57 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: 8FADE7078D X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-0.50 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.67)[-0.668,0]; NEURAL_SPAM_SHORT(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2018 20:18:59 -0000 On 12/13/18 1:35 AM, Mathieu Arnold wrote: > On Mon, Dec 10, 2018 at 11:22:49AM -0800, John Baldwin wrote: >> On 12/7/18 10:17 AM, John Baldwin wrote: >>> On 12/6/18 11:17 AM, Michael Gmelin wrote: >>>> >>>> >>>>> On 6. Dec 2018, at 19:21, John Baldwin wrote: >>>>> >>>>> The devel/gdb port installs python scripts into /usr/local/share/gdb/python. >>>>> If you then run kgdb as root (not that unusual), it will generate .pyc files in >>>>> those directories that are not deleted by 'pkg delete'. What is the best way to >>>>> handle this case? Should the pkg-plist include @rmtry entries for each pyc >>>>> file or is there a better way? >>>>> >>>> >>>> Pre-generate the pyc files on package build and install them with the port, so they become part of plist (there are examples of that in the ports tree, whenever possible for both py27 and py3x). >>> >>> Ok. One follow-up question. GDB's python bindings work with both py2 and >>> py3, but the bindings are optional. Right now PYTHON is a port option >>> (but on by default). If I wanted to add flavors I would probably want them >>> to be conditional on the option, so the results would be 'gdb' and >>> 'gdb-py3' packages by default, but if someone was using poudriere locally >>> and disabled python, I would only want to build a single 'gdb' without >>> python. So, can I make the flavors conditional on an option or is it too >>> late to define flavors after including bsd.ports.options.mk? >>> >>> That is, can I do something this: >>> >>> OPTIONS_DEFINE= PYTHON >>> OPTIONS_DEFAULT= PYTHON >>> >>> .include >>> >>> .if ${PORT_OPTIONS:MPYTHON} >>> USES_PYTHON= flavors >>> .endif >> >> FYI, this worked: > > All things considered, it does not matter when you set > USE_PYTHON=flavors because it does nothing if USES does not contain python. Yes, I eventually figured this out and the current patch just sets USE_PYTHON unconditionally. -- John Baldwin