Bug 64154 - Build uses the "python" binary which is now ambiguous
Summary: Build uses the "python" binary which is now ambiguous
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-18 14:31 UTC by Robie Basak
Modified: 2020-02-19 07:48 UTC (History)
0 users



Attachments
Patch to fix the problem (632 bytes, patch)
2020-02-18 14:31 UTC, Robie Basak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robie Basak 2020-02-18 14:31:37 UTC
Created attachment 37021 [details]
Patch to fix the problem

In Ubuntu, I'm about to patch apr to use "#!/usr/bin/env python2" since "python" may now refer to Python 3. Please see https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers for details. Patch attached.
Comment 1 Joe Orton 2020-02-18 17:16:16 UTC
This is already fixed in trunk and APR 1.7.0, what problem do you see with Python 3?
Comment 2 Robie Basak 2020-02-18 17:27:46 UTC
The shebang at https://svn.apache.org/repos/asf/apr/apr/trunk/build/gen-build.py still says "#!/usr/bin/env python" when it should be "#!/usr/bin/env python2" (or 3). Since this hadn't changed, I had assumed that you had not addressed this.

If you're using "python" to mean that it should work on both, I don't think that's a method endorsed by https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers - and in our case, we don't have that in the build environment to aid with the transition. You can't rely on a /usr/bin/python existing at all.
Comment 3 Joe Orton 2020-02-18 21:21:26 UTC
We don't rely on the hash bang, the script is never run directly.  Please show output of running ./buildconf.
Comment 4 Robie Basak 2020-02-18 22:12:52 UTC
> We don't rely on the hash bang, the script is never run directly.

Not from apr, but apr-util calls the script directly from "buildconf" at the top level of that source tree: https://sources.debian.org/src/apr-util/1.6.1-4/buildconf/#L90

I see that there have been some upstream rearrangements though based on https://svn.apache.org/repos/asf/apr/apr-util/trunk/APR-util_has_been_merged_to_APR_trunk so perhaps this no longer applies?

> Please show output of running ./buildconf.

I don't have that any more. Hopefully the above is enough. Please let me know if it is not.
Comment 5 Joe Orton 2020-02-19 07:48:45 UTC
Ah, right. The apr-util invocation is also fixed in r1868442 for future 1.6.x releases.