Bug 238204 - www/npm: Fix incorrect use of python2
Summary: www/npm: Fix incorrect use of python2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Yuri Victorovich
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2019-05-29 07:30 UTC by Yuri Victorovich
Modified: 2020-06-25 13:39 UTC (History)
1 user (show)

See Also:
koobs: merge-quarterly+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2019-05-29 07:30:34 UTC
This line:
> lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:  var python = gyp.opts.python || process.env.PYTHON || 'python2'

defaults to the wrong python executable name: python2 It should be python2.7

This causes failures like this:
> gyp ERR! configure error 
> gyp ERR! stack Error: Can't find Python executable "/usr/local/bin/python2", you can set the PYTHON env variable.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-29 07:43:05 UTC
@Yuri This is a blanket candidate:

Approved by: portmgr (blanket: ports/framework (python) compliance)
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2019-05-29 08:16:39 UTC
(In reply to Kubilay Kocak from comment #1)

Thanks, Kubilay!

Fix committed.
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-05-29 08:18:25 UTC
A commit references this bug:

Author: yuri
Date: Wed May 29 08:18:07 UTC 2019
New revision: 502940
URL: https://svnweb.freebsd.org/changeset/ports/502940

Log:
  www/npm: Fix the python executable name

  PR:		238204
  Reported by:	run failure
  Approved by:	portmgr (blanket: ports/framework (python) compliance)

Changes:
  head/www/npm/Makefile
  head/www/npm/files/patch-lib_node__modules_npm_node__modules_node-gyp_lib_configure.js
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-29 10:06:29 UTC
No MFH?
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-07-01 07:03:20 UTC
A commit references this bug:

Author: koobs
Date: Mon Jul  1 07:02:27 UTC 2019
New revision: 505545
URL: https://svnweb.freebsd.org/changeset/ports/505545

Log:
  MFH: r502940 r503843

  www/npm: Fix the python executable name

  PR:		238204
  Reported by:	run failure
  Approved by:	portmgr (blanket: ports/framework (python) compliance)

  Compile and install .pyc files for node-gyp

  - Bump PORTREVISION for package change

  PR:		238243
  Submitted by:	Hiroki Tagato <tagattie@yandex.com>

  Approved by:	ports-secteam (blanket(s): run/packaging fix, ports (python) compliance)

Changes:
_U  branches/2019Q2/
  branches/2019Q2/www/npm/Makefile
  branches/2019Q2/www/npm/files/patch-lib_node__modules_npm_node__modules_node-gyp_lib_configure.js
  branches/2019Q2/www/npm/pkg-plist
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2019-07-01 07:03:41 UTC
Merged to 2019Q2 (quarterly)
Comment 7 mvharding 2020-06-25 05:05:44 UTC
This patch was apparently deleted by ports r505851. I was trying to get rails 6.0 working and it was very confusing!

'export PYTHON=python2.7'
before
'rails new app'
is a workaround.

This bug should probably be reopened.
Comment 8 mvharding 2020-06-25 13:39:47 UTC
Actually, since rails seems to install multiple ruby and node packages on its own, I'll let the www/rails60 maintainer know about what happened, it's not clear that this bug needs to be reopened at this time.