NetBSD Problem Report #52122
From john@TIM.nextvr.com Tue Mar 28 18:22:13 2017
Return-Path: <john@TIM.nextvr.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 2D6907A1F9
for <gnats-bugs@gnats.NetBSD.org>; Tue, 28 Mar 2017 18:22:13 +0000 (UTC)
Message-Id: <201703281822.v2SIM8WS027161@TIM.nextvr.com>
Date: Tue, 28 Mar 2017 18:22:08 GMT
From: john@ziaspace.com
Reply-To: john@ziaspace.com
To: gnats-bugs@NetBSD.org
Subject: net/py-google-cloud-sdk can't find python
X-Send-Pr-Version: 3.95
>Number: 52122
>Category: pkg
>Synopsis: net/py-google-cloud-sdk can't find python
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: ryoon
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Mar 28 18:25:00 +0000 2017
>Closed-Date: Wed Jul 11 16:25:01 +0000 2018
>Last-Modified: Wed Jul 11 16:25:01 +0000 2018
>Originator: john@ziaspace.com
>Release: NetBSD 7.99.64
>Organization:
>Environment:
System: NetBSD tim.nextvr.com 7.99.64 NetBSD 7.99.64 (TIM) #0: Sun Mar 5 00:22:00 UTC 2017 john@tim.nextvr.com:/usr/obj-amd64/sys/arch/amd64/compile/TIM amd64
Architecture: x86_64
Machine: amd64
>Description:
net/py-google-cloud-sdk uses python 2.7. When trying to run, for instance,
gcloud, one gets:
usr/local/py27-google-cloud-sdk/bin/gcloud
python: not found
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->ryoon
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Tue, 28 Mar 2017 20:31:39 +0000
Responsible-Changed-Why:
Over to maintainer
(needs more REPLACE_PYTHON...)
From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/52122: net/py-google-cloud-sdk can't find python
Date: Fri, 28 Apr 2017 14:20:12 +0000
Looks like it has a script to let you specify python path with
CLOUDSDK_PYTHON and tries python2 first, we can blindly replace python2
with ${PYTHONBIN} in these files in the pre-configure stage, but that
may not be sufficient.
It should look something like this (perhaps specify less wildcards)
SUBST_CLASSES+= python
SUBST_STAGE.python+= pre-configure
SUBST_MESSAGE.python= replacing hard coded python executable name
SUBST_FILES.python= lib/googlecloudsdk/core/*
SUBST_FILES.python+= bin/*
SUBST_FILES.python+= install.sh
SUBST_SED.python= -e "s,python2,${PYTHONBIN},g"
Does that work well enough?
State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 03 Jun 2018 06:50:29 +0000
State-Changed-Why:
Provided a patch a year ago, is this good enough?
From: John Klos <john@ziaspace.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/52122 (net/py-google-cloud-sdk can't find python)
Date: Wed, 6 Jun 2018 22:05:37 +0000 (UTC)
> State-Changed-Why:
> Provided a patch a year ago, is this good enough?
By default it is not:
/usr/local/py27-google-cloud-sdk/bin/gsutil
python: not found
Making a symlink to python27 allows it to run, though. Tested by
authenticating to Google Cloud. Thanks :)
State-Changed-From-To: feedback->open
State-Changed-By: maya@NetBSD.org
State-Changed-When: Wed, 06 Jun 2018 23:22:56 +0000
State-Changed-Why:
Not fixed.
From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/52122 (net/py-google-cloud-sdk can't find python)
Date: Thu, 07 Jun 2018 09:41:22 +0200
Hello John,
John Klos writes:
> [...]
> By default it is not:
>
> /usr/local/py27-google-cloud-sdk/bin/gsutil
> python: not found
>
> Making a symlink to python27 allows it to run, though. Tested by
> authenticating to Google Cloud. Thanks :)
Can you please try the following patch (the complete rationale is
in the candidate commit message):
<https://www.NetBSD.org/~leot/pkgsrc-patches/py-google-cloud-sdk-52122.patch>
(TLDR; it seems that just `python' was used if no CLOUDSDK_PYTHON
nor `python2' could not be found, so we can just SUBST_SED accordingly)
For completeness the patch is also attached here inline.
----------------------- 8< ----------------- 8< ------------------------
py-google-cloud-sdk: Choose a safe fallback for Python interpreter
The logic to find a Python executable can be summarized as:
- CLOUDSDK_PYTHON environment variable defined:
+ If it matches `*python2*', use it
- Otherwise:
+ Try `python2'
+ Fallback to `python'
Substitute the latter fallback to ${PYTHONBIN} in order to have a
safe choice.
Should fix PR pkg/52122 reported by <jklos>.
This patch is based on the one proposed by <maya> (but restricted
to CLOUDSDK_PYTHON lines and the fallback `python').
Bump PKGREVISION.
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/py-google-cloud-sdk/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile 2 Apr 2016 08:26:49 -0000 1.3
+++ Makefile 7 Jun 2018 07:22:33 -0000
@@ -3,6 +3,7 @@
GCLOUDVER= 96.0.0
DISTNAME= google-cloud-sdk-${GCLOUDVER}-linux-x86
PKGNAME= ${PYPKGPREFIX}-google-cloud-sdk-${GCLOUDVER}
+PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/
@@ -23,6 +24,13 @@ REPLACE_PYTHON+= bin/bootstrapping/*
PLIST_SUBST+= PYPKGPREFIX=${PYPKGPREFIX}
MESSAGE_SUBST+= PYPKGPREFIX=${PYPKGPREFIX}
+SUBST_CLASSES+= python
+SUBST_STAGE.python= pre-configure
+SUBST_MESSAGE.python= Replacing hard coded python executable name
+SUBST_FILES.python= lib/googlecloudsdk/core/*
+SUBST_FILES.python+= bin/*
+SUBST_SED.python= -e "/CLOUDSDK_PYTHON=/ s,python$$,${PYTHONBIN},"
+
INSTALLATION_DIRS= ${PKGBASE}
do-install:
State-Changed-From-To: open->feedback
State-Changed-By: leot@NetBSD.org
State-Changed-When: Thu, 07 Jun 2018 07:46:19 +0000
State-Changed-Why:
Possible patch proposed, please let us known if it fixes the issue!
From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52122 CVS commit: pkgsrc/net/py-google-cloud-sdk
Date: Sun, 8 Jul 2018 12:22:57 +0000
Module Name: pkgsrc
Committed By: leot
Date: Sun Jul 8 12:22:56 UTC 2018
Modified Files:
pkgsrc/net/py-google-cloud-sdk: Makefile
Log Message:
py-google-cloud-sdk: Choose a safe fallback for Python interpreter
The logic to find a Python executable can be summarized as:
- CLOUDSDK_PYTHON environment variable defined:
+ If it matches `*python2*', use it
- Otherwise:
+ Try `python2'
+ Fallback to `python'
Substitute the latter fallback to ${PYTHONBIN} in order to have a
safe choice.
Should fix PR pkg/52122 reported by <jklos>.
This patch is based on the one proposed by <maya> (but restricted
to CLOUDSDK_PYTHON lines and the fallback `python').
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/py-google-cloud-sdk/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: feedback->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Wed, 11 Jul 2018 16:25:01 +0000
State-Changed-Why:
Patch committed after feedback timeout.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.