changing 'configure' options for testing

Daniel J. Luke dluke at geeklair.net
Tue Sep 28 14:44:41 UTC 2021


On Sep 20, 2021, at 10:20 AM, Daniel J. Luke <dluke at geeklair.net> wrote:
> On Sep 20, 2021, at 8:15 AM, Frank Dean <frank at fdsd.co.uk> wrote:
>> Daniel J. Luke <dluke at geeklair.net> writes:
>>> The newest version of clamav uses cmake for builds. In the 'configure' stage, I have it disabling tests because otherwise it won't build without the test dependencies installed (check and pytest). 
>>> 
>>> Do we have a template or example of a canonical way to handle this? I don't see an obvious hook for when someone is running `port test` to change configure.args (I could, of course, add a post-extract/pre-configure and do some non-declaritive test to see if `port test` is being run and use that to branch - but that feels like a bad design choice).
>> 
>> The rapidjson port implements a 'tests' variant to handle a similar
>> situation.  I used the same pattern for the libosmium port.  The tests
>> can then be run with `sudo port -d test current +tests`.
> 
> That works, I guess.
> 
> Is there interest in having base auto-add +tests if `port test` is called? (I haven't looked at base/ code in a while, but it seems possible). I like to imagine a future where we have enough infrastructure that we would run `port test` for any ports that have test.run set.

On this same train of thought - clamav tests run against the installed libraries (like some other ports tend to do) - in long-ago times I'd solve this by setting DYLD_LIBRARY_PATH - but since SIP started removing these that no longer works normally. I think trace mode has a(n elaborate) workaround where it copies binaries and executes the copies, but that doesn't seem like something I should implement in a portfile ;-) [This is another instance where if trace mode were the default, things would 'just work']

Has anyone else already solved this?

-- 
Daniel J. Luke



More information about the macports-dev mailing list