Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jan 2025 14:13:22 +0100 (CET)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        freebsd-ports@freebsd.org, freebsd-go@freebsd.org
Subject:   Mk/Uses/go.mk: TEST_ENV is not passed to test build
Message-ID:  <2089837519.5773.1737724402470@localhost>

next in thread | raw e-mail | index | archive | help
------=_Part_5772_1200877634.1737724402466
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

According to bsd.port.mk TEST_ENV is passed as environment to the default make test target.
I tried that in my databases/mongodb-tools port and it didn't work.

A small diff fixes this.
diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk
index d7e932daee73..2a4ff76db199 100644
--- a/Mk/Uses/go.mk
+++ b/Mk/Uses/go.mk
@@ -276,7 +276,7 @@ do-test:
        (cd ${GO_WRKSRC}; \
        for t in ${GO_TESTTARGET}; do \
                ${ECHO_MSG} "===>  Testing $${t}"; \
-               ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} test ${GO_TESTFLAGS} $${t}; \
+               ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} test ${GO_TESTFLAGS} $${t}; \
        done)
 .  endif

Just a question.
In bsd.port.mk the line TEST_ENV?=${MAKE_ENV} copies MAKE_ENV into TEST_ENV, unless you set TEST_ENV yourself in the ports Makefile.

1. Should I replace MAKE_ENV with TEST_ENV in go.mk (see diff above)? This looks like how cmake.mk, perl5.mk and python.mk pass TEST_ENV. This might break the test target in existing ports which do no add MAKE_ENV to TEST_ENV themselves.
2. Or should I add TEST_ENV to the line above together with MAKE_ENV which might duplicate the env variables because TEST_ENV=MAKE_ENV in bsd.port.mk?

I would prefer 1 and document the change in /usr/ports/CHANGES as it is more in line with the other languages.

What do you think?

Regards,
Ronald.
 
------=_Part_5772_1200877634.1737724402466
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html><head></head><body>Hi,<br>
<br>
According to bsd.port.mk TEST_ENV is passed as environment to the default make test target.<br>
I tried that in my databases/mongodb-tools port and it didn't work.<br>
<br>
A small diff fixes this.
<pre>diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk
index d7e932daee73..2a4ff76db199 100644
--- a/Mk/Uses/go.mk
+++ b/Mk/Uses/go.mk
@@ -276,7 +276,7 @@ do-test:
        (cd ${GO_WRKSRC}; \
        for t in ${GO_TESTTARGET}; do \
                ${ECHO_MSG} "===&gt;  Testing $${t}"; \
-               ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} test ${GO_TESTFLAGS} $${t}; \
+               ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} test ${GO_TESTFLAGS} $${t}; \
        done)
 .  endif</pre>
<br>
<br>
Just a question.<br>
In bsd.port.mk the line TEST_ENV?=${MAKE_ENV} copies MAKE_ENV into TEST_ENV, unless you set TEST_ENV yourself in the ports Makefile.<br>
<br>
1. Should I replace MAKE_ENV with TEST_ENV in go.mk (see diff above)? This looks like how cmake.mk, perl5.mk and python.mk pass TEST_ENV. This might break the test target in existing ports which do no add MAKE_ENV to TEST_ENV themselves.<br>
2. Or should I add TEST_ENV to the line above together with MAKE_ENV which might duplicate the env variables because TEST_ENV=MAKE_ENV in bsd.port.mk?<br>
<br>
I would prefer 1 and document the change in /usr/ports/CHANGES as it is more in line with the other languages.<br>
<br>
What do you think?<br>
<br>
Regards,<br>
Ronald.<br>
&nbsp;</body></html>
------=_Part_5772_1200877634.1737724402466--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2089837519.5773.1737724402470>