Several ports can not be build using ports-mgmt/portmaster resulting in an error ending in : invalid option -- D; see for instance PR #281730, #280076, #277954, #278684, #278887 (and more already solved) In most cases, a workaround is to replace in build target sections according to /usr/ports/CHANGES: 20240229: AUTHOR: tijl@FreeBSD.org [...] replacing used ${SETENV} by ${SETENVI} ${WRK_ENV}. While portmaster fails on the reported ports, poudriere and native build via make works as expected. portmaster does well, as poudriere and make, after patching according to the scheme mentioned above.
URL above is the portmaster patch for this issue. It's still likely the case that individual ports should migrate to ${SETENVI} for robustness.