Page MenuHomeFreeBSD

Fix [DE]SELECTED_OPTIONS to lazily evaluate.
ClosedPublic

Authored by bdrewery on Nov 14 2017, 7:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 2:52 PM
Unknown Object (File)
Mar 8 2024, 12:27 PM
Unknown Object (File)
Feb 5 2024, 7:51 AM
Unknown Object (File)
Feb 5 2024, 7:35 AM
Unknown Object (File)
Jan 13 2024, 7:29 PM
Unknown Object (File)
Jan 13 2024, 3:58 PM
Unknown Object (File)
Dec 28 2023, 5:14 AM
Unknown Object (File)
Dec 28 2023, 5:14 AM
Subscribers

Details

Summary

If a port modifies OPTIONS_UNSET after including bsd.port.options.mk
then these values were wrong even though all of 'showconfig',
'pretty-print-config', and the package generated all had the expected
options.

Only Poudriere and synth use these variables for incremental build checks.
My initial thoughts were that the print/ghostscript9-agpl-base/files/Makefile.drivers_post
file is wrong for modifying OPTIONS this late but the fact that all
other options printers and the package work as the port expects makes
me accept it.

The alternative to using bmake :@ here would be to move the existing
code to bsd.port.mk at the end of the pre-check-config block.

Test Plan

Some local poudriere bulk runs.

Before:

% cd print/ghostscript9-agpl-base
% echo "print_ghostscript9-agpl-base_UNSET= CUPS" >> /etc/make.conf
% make -V 'SELECTED_OPTIONS:tl:M*cups*'
gs_cups
% make -V 'DESELECTED_OPTIONS'
GS_png48 CUPS

After:

% cd print/ghostscript9-agpl-base
% echo "print_ghostscript9-agpl-base_UNSET= CUPS" >> /etc/make.conf
% make -V 'SELECTED_OPTIONS:tl:M*cups*'

% make -V 'DESELECTED_OPTIONS'
CUPS GS_cups GS_png48

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

In D13092#272310, @sjg wrote:

:@ rocks

Yup, I had this originally but I couldn't get DESLECTED_OPTIONS to work nicely and I felt it was too obscure.

SELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${PORT_OPTIONS:M${opt}}@} ${MULTI GROUP SINGLE RADIO:L:@otype@${OPTIONS_${otype}:@m@${OPTIONS_${otype}_${m}:@opt@${PORT_OPTIONS:M${opt}}@}@}@}
This revision is now accepted and ready to land.Nov 15 2017, 9:47 AM

Note that other places may benefit :@

This revision was automatically updated to reflect the committed changes.

If a port modifies OPTIONS_UNSET after including bsd.port.options.mk

But, OPTIONS_SET/UNSET are variables that can only be used in /etc/make.conf, so this case should not happen. Which port does something stupid like this ?