Mk/Uses/nodejs.mk currently has the following: . if !empty(${nodejs_ARGS:Nbuild:Nrun:Nlts:Ncurrent:N14:N16:N18:N19}) IGNORE= USES=nodejs has invalid arguments ${nodejs_ARGS}. . endif 'empty' should take an expression that is a variable or variable with modifiers - such as empty(FOO) or empty(FOO:Nsomething). It should not normally take the expansion of the expression - such as empty(${FOO}) or empty(${FOO:Nsomething}) - unless the expansion is a desired variable expression to be tested for emptiness itself. For nodejs.mk it wants to check if the nodejs_ARGS variable (with modifiers) is empty, so it should be: . if !empty(nodejs_ARGS:Nbuild:Nrun:Nlts:Ncurrent:N14:N16:N18:N19) IGNORE= USES=nodejs has invalid arguments ${nodejs_ARGS}. . endif But there's another error, namely the :N modifiers should include a test for 'env'. It appears omission of that was just an oversight. So: . if !empty(nodejs_ARGS:Nbuild:Nenv:Nrun:Nlts:Ncurrent:N14:N16:N18:N19) IGNORE= USES=nodejs has invalid arguments ${nodejs_ARGS}. . endif Locally this mistake was noticed after www/yarn added USES=nodejs:env, and it just so happened that the environment had 'env' defined in the environment. So that triggered the following incorrect error: % env env=x make -C www/yarn extract ===> yarn-1.22.18_1 USES=nodejs has invalid arguments env.. *** Error code 1 After fixing the 'empty()' expression as described above, that same command does not failure. If you only fix the missing :Nenv without removing the incorrect expansion of nodejs_ARGS and modifiers, then the invalid arguments test does not catch the invalid argument as it should: % make -C www/yarn extract USES=metaport\ nodejs:inval ===> Fetching all distfiles required by yarn-1.22.18_1 for building ===> Extracting for yarn-1.22.18_1
Created attachment 241355 [details] [patch] fix nodejs_ARGS test in Mk/Uses/nodejs.mk The attached patch fixes the incorrect expansion of nodejs_ARGS in the empty() test. It also adds the missing :Nenv modifier in that test.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c98bdc21c65e97a62c9290d38e002ec99d8905bc commit c98bdc21c65e97a62c9290d38e002ec99d8905bc Author: John Hein <jcfyecrayz@liamekaens.com> AuthorDate: 2023-04-09 13:35:48 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2023-04-09 13:37:36 +0000 Mk/Uses/nodejs.mk: Fix nodejs_ARGS check - Fix empty() usage - Add missing valid USES=nodejs:env PR: 270706 Mk/Uses/nodejs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Committed. Thanks!
(In reply to Po-Chuan Hsieh from comment #3) Thanks. I just noticed the extra period in the IGNORE ===> yarn-1.22.18_1 USES=nodejs has invalid arguments env.. Next time someone commits to this file, the trailing period should be removed.