Vim build fails if PYTHON is OFF. Here is the error (there are others, but they do not cause the build to fail): Error: '/usr/local/bin/python' is an invalid shebang you need USES=shebangfix for 'share/vim/vim82/tools/demoserver.py.bak'
It happens when you have DEVELOPER=yes. r522484 adds a new REINPLACE_CMD check which is enabled when DEVELOPER=yes. It does not respect REINPLACE_ARGS (-i ''), thus runtime/tools/demoserver.py.bak is generated. Vim installs everything in runtime/tools [1] which fails in stage-qa for invalid shebang. There are at least 2 workaround: 1. Remove the demoserver.py.bak after REINPLACE_CMD. 2. Use USES=python:env [2]. It will replace the shebang with default python (/usr/local/bin/python3.7). [1] from src/Makefile: # install the runtime tools $(INSTALL_DATA_R) $(TOOLSSOURCE)/* $(DEST_TOOLS) [2] Index: Makefile =================================================================== --- Makefile (revision 525490) +++ Makefile (working copy) @@ -31,7 +31,6 @@ PLIST_SUB= VIM_VER=${VIM_VER} PORTDATA?= ${VIM_VER} PORTSCOUT= ignore:1 -REINPLACE_ARGS= -i '' SHEBANG_FILES= runtime/tools/demoserver.py runtime/tools/efm_perl.pl VIM_VER= ${PORTNAME}${PORTVERSION:R:S|.||g} @@ -134,6 +133,7 @@ PERL_USES= perl5 PYTHON_USES= python +PYTHON_USES_OFF= python:env RUBY_CONFIGURE_ENABLE= rubyinterp RUBY_USE= RUBY=yes @@ -167,8 +167,6 @@ ${ECHO_CMD} '#define SYS_GVIMRC_FILE "'${ETCDIR}'/gvimrc"' >> ${WRKSRC}/src/feature.h ${REINPLACE_CMD} -e 's|-liconv|${ICONV_LIB}|g; s|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/src/auto/configure -# Work around qa-check shebang error - ${REINPLACE_CMD} -e 1d ${WRKSRC}/runtime/tools/demoserver.py post-configure: # Needed when devel/libsysinfo is installed:
(In reply to Sunpoet Po-Chuan Hsieh from comment #1) Thank you very much. I think it would have been a good idea to warn people of this change in REINPLACE_CMD. If a warning has indeed been sent, I missed it, sorry. In any case, I see no note about it in UPDATING: it might be a good idea to add one.
Hi Sunpoet, I’m on shift and won’t be back until late tonight. Can you (or anyone else interested) please commit this?
A commit references this bug: Author: sunpoet Date: Mon Feb 10 18:47:24 UTC 2020 New revision: 525748 URL: https://svnweb.freebsd.org/changeset/ports/525748 Log: Fix stage-qa of shebang with PYTHON option disabled after r522484 The error message (in poudriere) is as follows: ====> Running Q/A tests (stage-qa) Error: '/usr/local/bin/python' is an invalid shebang you need USES=shebangfix for 'share/vim/vim82/tools/demoserver.py.bak' r522484 adds a new REINPLACE_CMD check which is enabled when DEVELOPER=yes. It does not respect REINPLACE_ARGS (-i ''), thus runtime/tools/demoserver.py.bak is generated. Vim installs everything in runtime/tools [1] which fails in stage-qa for invalid shebang. This workaround uses USES=python:env. It will replace the shebang with default python (/usr/local/bin/python3.7). [1] from src/Makefile: # install the runtime tools $(INSTALL_DATA_R) $(TOOLSSOURCE)/* $(DEST_TOOLS) PR: 243961 Reported by: salvadore Submitted by: sunpoet (myself) Approved by: adamw (maintainer) Changes: head/editors/vim/Makefile
(In reply to Lorenzo Salvadore from comment #2) It also affects other ports with REINPLACE_ARGS. swills@ is cc'd. He might have a better idea. (In reply to Adam Weinberger from comment #3) Hi Adam, I've committed the workaround.
(In reply to Sunpoet Po-Chuan Hsieh from comment #5) Thanks for the warning and for the commit. I can confirm that the build now works fine with PYTHON off.
I’m closing this PR now as I believe the problem is fixed. Please reopen if not. Sunpoet, thank you so much for doing all the legwork here!