Bug 230096 - sysutils/py-google-compute-engine: Installed script(s) reference python not pythonX.Y
Summary: sysutils/py-google-compute-engine: Installed script(s) reference python not p...
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Kubilay Kocak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-28 00:26 UTC by gustavo.scalet
Modified: 2018-08-01 09:31 UTC (History)
4 users (show)

See Also:


Attachments
patch (1.16 KB, patch)
2018-07-28 00:26 UTC, gustavo.scalet
koobs: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gustavo.scalet 2018-07-28 00:26:46 UTC
Created attachment 195516 [details]
patch

Currently the FreeBSD-12-0-SNAP on GCE is not providing a lang/python nor
lang/python packages so only a specific python2.7 binary exist. That's
not enough for handling shebangs.
Comment 1 Martin Wilke freebsd_committer freebsd_triage 2018-07-28 01:59:26 UTC
reopen
Comment 2 gustavo.scalet 2018-07-30 16:25:37 UTC
could somebody add the merge-quaterly flag? I'd love to see this running
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2018-07-31 01:07:10 UTC
Adding lang/python to install the symlink is not the correct solution, this issue is a bug...

All python ports must modify scripts / script shebangs such that they only reference the specific version of the selected/chosen (PYTHON_CMD) python (interpreter) at the time of the build

For packages that use setuptools (setup.py: console_scripts, scripts) these shebangs are rewritten during installation and shouldn't need to be modified in the sources.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2018-07-31 01:08:31 UTC
Comment on attachment 195516 [details]
patch

The files this port installs that reference `python` need to be identified, and modified to reference ${PYTHON_CMD} (the selected/chosen python version in the framework)
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2018-07-31 01:31:42 UTC
Note: This issue is only a bug *if* this port installs command line scripts without rewriting the shebangs to match and use ${PYTHON_CMD}. That needs to be investigated and verified (else closed "Not a bug").

What GCE images contain or don't contain by default does not (by itself) have a bearing on whether or not the port is or isn't not in compliance with port/packaging shebang requirements.

Speaking with Gustavo on IRC, it appears only (correct me if I understood incorrectly) that an externally sourced script [1] they use, uses " #!/usr/bin/env python2 ", which gave rise to this bug report.

If this is indeed the case, the appropriate solution is for the user themselves to install the lang/python and/or lang/python2 ports to provide those symlinks for their convenience, or potentially, for the GCE images to install the lang/python2 and lang/python packages so those symlinks are available to users by default, if that's possible, and if it can be argued that that is what user expectations are. 

[1] https://github.com/GoogleCloudPlatform/compute-image-tools/blob/master/daisy_workflows/linux_common/bootstrap.py#L1
Comment 6 gustavo.scalet 2018-07-31 20:02:58 UTC
(In reply to Kubilay Kocak from comment #5)
> or potentially, for the GCE images to install the lang/python2
> and lang/python packages so those symlinks are available to users
> by default, if that's possible, and if it can be argued that that
> is what user expectations are. 

That's the case. I guess then that I'm on the wrong project. I'll send a PR to FreeBSD itself to change the releasing of GCE images to contain lang/python2 (release/tools/gce.conf, variable VM_EXTRA_PACKAGES)
Comment 7 gustavo.scalet 2018-07-31 20:14:44 UTC
follow up on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230248