Bug 219811 - CONFIGURE_ENV do not take effect
Summary: CONFIGURE_ENV do not take effect
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-06 03:24 UTC by Jov
Modified: 2017-06-09 09:19 UTC (History)
1 user (show)

See Also:


Attachments
Makefile.simple (711 bytes, text/plain)
2017-06-06 03:24 UTC, Jov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jov 2017-06-06 03:24:27 UTC
Created attachment 183252 [details]
Makefile.simple

I am trying to port tensorflow to freebsd,see this PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219609

I set HAS_CONFIGURE and CONFIGURE+= TF_xx=yy...,It seams do not take effect,I print env in the do-configure target and do not see the TF_xx.

the configure script will prompt user to input the configurations if they are not set in the env.

the attachement is a simplified version of Makefile to reproduce the bug.


root@11:/usr/ports/science/tensorflow # make
===>   py27-tensorflow-1.1.0 depends on file: /usr/local/bin/python2.7 - found
===>  Configuring for py27-tensorflow-1.1.0
env
MAKEFLAGS= .MAKE.LEVEL.ENV=MAKELEVEL ARCH=amd64 HAVE_COMPAT_IA32_KERN=YES\  OPSYS=FreeBSD OSREL=11.0 OSVERSION=1100122 PYTHONBASE=/usr/local _OSRELEASE=11.0-RELEASE-p8 _PERL5_FROM_BIN=5.24.1 _PKG_CHECKED=1 _PYTHON_DEFAULT_VERSION=2.7 _SMP_CPUS=8
_SMP_CPUS=8
HAVE_COMPAT_IA32_KERN=YES 
PYTHONBASE=/usr/local
_PYTHON_DEFAULT_VERSION=2.7
_PERL5_FROM_BIN=5.24.1
_PKG_CHECKED=1
OSVERSION=1100122
OSREL=11.0
_OSRELEASE=11.0-RELEASE-p8
OPSYS=FreeBSD
ARCH=amd64
MAKELEVEL=1
LC_ALL=C
LANG=C
META_MODE=normal
PWD=/usr/local/poudriere/ports/default/science/tensorflow
.MAKE.LEVEL.ENV=MAKELEVEL
STY=79432.poud
TERM=screen
TERMCAP=SC|screen|VT 100/ANSI X3.64 virtual terminal:\
        :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
        :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\
        :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\
        :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\
        :li#30:co#134:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:\
        :cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:dc=\E[P:DC=\E[%dP:\
        :im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:\
        :ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
        :ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:\
        :se=\E[23m:md=\E[1m:mr=\E[7m:me=\E[m:ms:\
        :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:G0:\
        :as=\E(0:ae=\E(B:\
        :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\
        :Km=\E[M:k0=\E[10~:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
        :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
        :k;=\E[21~:F1=\E[23~:F2=\E[24~:kb=^H:K2=\EOE:kB=\E[Z:\
        :kh=\E[1~:@1=\E[1~:kH=\E[4~:@7=\E[4~:kN=\E[6~:kP=\E[5~:\
        :kI=\E[2~:kD=\E[3~:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:km:
WINDOW=0
SHELL=/bin/csh
BLOCKSIZE=K
MAIL=/var/mail/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
HOME=/root
USER=root
HOSTTYPE=FreeBSD
VENDOR=amd
OSTYPE=FreeBSD
MACHTYPE=x86_64
SHLVL=1
LOGNAME=root
GROUP=wheel
HOST=fboffice
REMOTEHOST=localhost
EDITOR=vi
PAGER=more
cd /usr/local/poudriere/ports/default/science/tensorflow/work/tensorflow-1.1.0 && ./configure
Please specify the location of python. [Default is /usr/local/bin/python]: ^C
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2017-06-07 13:13:24 UTC
There is no HAS_CONFIGURE, CONFIGURE, or CONFIGURE_ENV variable in the Makefile in the shar in that PR.  Could you provide an example to reproduce the problem ?
Comment 2 Jov 2017-06-07 14:07:49 UTC
(In reply to Mathieu Arnold from comment #1)
Hi ,please see this makefile to demonstrate the bug:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=183252

yes,the original tensorflow shar file do not have HAS_CONFIGURE and CONFIGURE_ENV,because I use this:

(cd ${WRKSRC} && PYTHON_BIN_PATH=${LOCALBASE}/bin/python TF_NEED_MKL=N \
	CC_OPT_FLAGS="-march=native" TF_NEED_GCP=N TF_NEED_HDFS=N \
	TF_ENABLE_XLA=N TF_NEED_OPENCL=N TF_NEED_CUDA=N \
	PYTHON_LIB_PATH="${PYTHON_SITELIBDIR}" ./configure)

and Kubilay Kocak review the pr and then give me advice to improve the configure target.I am trying to move the environment variables to CONFIGURE_ENV and find this bug.
Comment 3 Mathieu Arnold freebsd_committer freebsd_triage 2017-06-07 21:47:53 UTC
I do not see any bug here. CONFIGURE_ENV is not some kind of "magic" that happens to be added to the environment of the do-configure target.

If you want it to work, you must not define do-configure yourself.

See the definition of do-configure starting line 3111 of the current Mk/bsd.port.mk, and especially how CONFIGURE_CMD (./configure) is run between lines 3132 to 3140.