classification
Title: Generalize configure check for working Python executable
Type: Stage: needs patch
Components: Build Versions: Python 3.5
process
Status: open Resolution:
Dependencies: Superseder: configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc
View: 26662
Assigned To: Nosy List: brett.cannon, kushal.das, martin.panter, meador.inge
Priority: low Keywords:

Created on 2014-04-15 17:50 by brett.cannon, last changed 2017-01-08 00:04 by martin.panter.

Messages (5)
msg216346 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-04-15 17:50
configure.ac has a check that sets ASDLGEN based on what Python interpreter to use for running various scripts which generate files related to the AST. It probably should be generalized so that there's only one check for any script usage in Makefile.pre.in since there is really no need to check multiple times for the same thing.
msg216353 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2014-04-15 18:08
I am not sure I follow.  In configure.ac I see one check for Python:

  AC_SUBST(ASDLGEN)
  AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
  if test "$PYTHON" = not-found; then
      ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
  else
      ASDLGEN="$PYTHON"
  fi

and a couple of uses for it in Makefile.pre.in:

  $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
  	  $(MKDIR_P) $(AST_H_DIR)
	  $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)

  $(AST_C): $(AST_H) $(AST_ASDL) $(ASDLGEN_FILES)
	  $(MKDIR_P) $(AST_C_DIR)
	  $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)

Are you suggesting that the variable name 'ASDLGEN" be renamed to something more general so that any scripts that need to be run *before* building the interpreter can use it?

I don't see any other AC_CHECK_PROGS checks for Python in configure.ac.

Apologies if I am being dense today :-)
msg216355 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2014-04-15 18:15
Ah, okay, this looks in reference to the opcode generation stuff in issue17861.
msg216356 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-04-15 18:16
You figured out the reason for the interest; I filed the bug faster than Kushal could commit his code. =)
msg284945 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-01-08 00:04
It is still not clear what change you were proposing. Perhaps factor out the common code for ADSLGEN and OPCODEHGEN? If so, that has been done as part of Issue 26662 in 3.5+.
History
Date User Action Args
2017-01-08 00:04:20martin.pantersetsuperseder: configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

messages: + msg284945
nosy: + martin.panter
2014-04-15 18:16:35brett.cannonsetmessages: + msg216356
2014-04-15 18:15:32meador.ingesetmessages: + msg216355
2014-04-15 18:08:49meador.ingesetnosy: + meador.inge
messages: + msg216353
2014-04-15 17:50:05brett.cannoncreate