RFE: $(builddir)/bin/upcxx-run should honor UPCXX_PYTHON

Issue #341 resolved
Dan Bonachea created an issue

$(builddir)/bin/upcxx-run is very handy as a developer tool, but currently there is no way to use this script with a particular Python, aside from changing the default "python" in one's PATH.

Unlike the user-facing upcxx-run, this is a shell script so cannot be passed to python directly (the recommended technique for end-user upcxx-run)

The make run target honors the value of UPCXX_PYTHON passed as an argument to make (with the default being the one detected at configure time), but the shell script does not do this. UPCXX_PYTHON is only consulted by the python script itself if it starts up with a too-old interpreter.

It would be nice for the shell script to honor $UPCXX_PYTHON when set, possibly defaulted to the configure-time value (if it was set).

Comments (5)

  1. Paul Hargrove

    This in-build-tree upcxx-run already honors the configure-time value.
    The following untested patch makes that secondary to the $UPCXX_PYTHON in the environment when run.

    --- a/configure
    +++ b/configure
    @@ -809,7 +809,7 @@ EOF
     cat >| bin/upcxx-run <<EOF
     #!$BASH
     function die { echo "upcxx-run: ERROR: \$*" >&2; exit 1; }
    -conduit=\$($UPCXX_PYTHON $UPCXX_SRC/utils/upcxx-run -info "\$@" | grep ^GASNetConduitName: | cut -d' ' -f2 | tr '[
    +conduit=\$(\${UPCXX_PYTHON-$UPCXX_PYTHON} $UPCXX_SRC/utils/upcxx-run -info "\$@" | grep ^GASNetConduitName: | cut
     [[ \$? -ne 0 ]] && die 'pre-parse of command line failed'
     codemode="${UPCXX_DBGOPT% *}" # debug unless only opt configured in
     [[ -z "\$UPCXX_QUIET" ]] && echo 'INFO: may need to build the required runtime.  Please be patient.' >&2
    
  2. Paul Hargrove

    Still untested, but pretty sure the following is also required.

    --- a/bld/Makefile
    +++ b/bld/Makefile
    @@ -235,7 +235,7 @@ do-upcxx-run: force
     define upcxx_run_body
     #!$(UPCXX_BASH)
     export GASNET_PREFIX='$(builddir)/$(GASNETDIR)'
    -exec $(UPCXX_PYTHON) '$(top_srcdir)/utils/upcxx-run' "$$@"
    +exec $${UPCXX_PYTHON-$(UPCXX_PYTHON)} '$(top_srcdir)/utils/upcxx-run' "$$@"
     endef
    
     # Body of a upcxx wrapper in a build dir
    
  3. Paul Hargrove

    Honor $UPCXX_PYTHON in in-build-tree upcxx-run

    This commit honors $UPCXX_PYTHON if it is set in the environment when running bin/upcxx-run in a build tree. When not set, the configure-time value of the same (or --with-python=...) is still used.

    Resolves issue 341

    → <<cset 693d3895a3cc>>

  4. Log in to comment