On 2021/02/22 13:39, Karl Fogel wrote:
> I felt I should close the loop in this thread:
>
> I decided to leave this be for now. Even though it is mildly annoying that
> the Subversion test suite exhibits a few spurious failures on systems that
> have only 'python3' and not 'python', it turns out that most of the time most
> of my systems have 'python'. So the real-world effects here are pretty minor
> for me, and apparently for others, and there are more important things I
> could work on in Subversion. If anyone wants to fix this minor problem,
> there are enough pointers in this thread I think.
Then, I made patches. It also allows pypy to run the test without
'python'.
(A) Replace the shebang line of svneditor.py from svneditor.py
at running the configure script. (fix-svneditor-in-test-patch-a.txt)
As @PYTHON@ can be basename only, relative path, or absolute path,
"/usr/bin/env" is still needed.
(B) Make a script to launch svneditor.py using @PYTHON@, svneditor.sh
at running the configure scriptt. (fix-svneditor-in-test-patch-b.txt)
If @PYTHON@ is always absolute path, we can use shebang line without
'/usr/bin/env' in patch (A).
Cheers,
--
Yasuhito FUTATSUKI <[email protected]>
tests: Use PYTHON determined by the configure script.
* configure.ac:
Add subversion/tests/cmdline/svneditor.py to SVN_CONFIG_SCRIPT.
* subversion/tests/cmdline (svn:ignore): ignore svneditor.py.
* subversion/tests/cmdline/svneditor.py.in:
- Renamed from svneditor.py.
- Use @PYTHON@ instead of python in the shebang, to be substituted by the
configure script.
(svn move subversion/tests/cmdline/svneditor.py \
subversion/tests/cmdline/svneditor.py.in)
Index: configure.ac
===================================================================
--- configure.ac (revision 1886884)
+++ configure.ac (working copy)
@@ -1769,6 +1769,7 @@ done
SVN_CONFIG_SCRIPT(tools/backup/hot-backup.py)
SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-access-control.pl)
+SVN_CONFIG_SCRIPT(subversion/tests/cmdline/svneditor.py)
SVN_CONFIG_SCRIPT(subversion/bindings/swig/perl/native/Makefile.PL)
if test -e packages/solaris/pkginfo.in; then
SVN_CONFIG_SCRIPT(packages/solaris/pkginfo)
Index: subversion/tests/cmdline/svneditor.py (deleted)
===================================================================
Index: subversion/tests/cmdline/svneditor.py.in
===================================================================
--- subversion/tests/cmdline/svneditor.py.in (revision 1886884)
+++ subversion/tests/cmdline/svneditor.py.in (working copy)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env @PYTHON@
#
# svneditor.py: a mock $SVN_EDITOR for the Subversion test suite
#
Index: subversion/tests/cmdline
===================================================================
--- subversion/tests/cmdline (revision 1886884)
+++ subversion/tests/cmdline (working copy)
Property changes on: subversion/tests/cmdline
___________________________________________________________________
Modified: svn:ignore
## -11,3 +11,4 ##
.libs
.davautocheck.sh.stop
lock-helper
+svneditor.py
tests: Add launcher for svneditor.py with specfied Python at configure.
* configure.ac:
Add subversion/tests/cmdline/svneditor.sh to SVN_CONFIG_SCRIPT.
* subversion/tests/cmdline (svn:ignore): ignore svneditor.sh.
* subversion/tests/cmdline/svneditor.sh.in: New script tempate,
launching svneditor.py via @PYTHON@.
* subversion/tests/cmdline/svneditor.py:
- Drop svn:executable.
- Remove shebang line.
Index: configure.ac
===================================================================
--- configure.ac (revision 1886884)
+++ configure.ac (working copy)
@@ -1769,6 +1769,7 @@ done
SVN_CONFIG_SCRIPT(tools/backup/hot-backup.py)
SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-access-control.pl)
+SVN_CONFIG_SCRIPT(subversion/tests/cmdline/svneditor.sh)
SVN_CONFIG_SCRIPT(subversion/bindings/swig/perl/native/Makefile.PL)
if test -e packages/solaris/pkginfo.in; then
SVN_CONFIG_SCRIPT(packages/solaris/pkginfo)
Index: subversion/tests/cmdline/svneditor.py
===================================================================
--- subversion/tests/cmdline/svneditor.py (revision 1886884)
+++ subversion/tests/cmdline/svneditor.py (working copy)
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
#
# svneditor.py: a mock $SVN_EDITOR for the Subversion test suite
#
Property changes on: subversion/tests/cmdline/svneditor.py
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: subversion/tests/cmdline/svneditor.sh.in
===================================================================
--- subversion/tests/cmdline/svneditor.sh.in (nonexistent)
+++ subversion/tests/cmdline/svneditor.sh.in (working copy)
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# svneditor.sh.in: a launcher of svneditor.py, used as $SVN_EDITOR
+# for the Subversion test suite
+#
+# Subversion is a tool for revision control.
+# See http://subversion.apache.org for more information.
+#
+# ====================================================================
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+######################################################################
+
+exec @PYTHON@ @abs_srcdir@/svneditor.py "$@"
Property changes on: subversion/tests/cmdline/svneditor.sh.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: subversion/tests/cmdline/svntest/main.py
===================================================================
--- subversion/tests/cmdline/svntest/main.py (revision 1886884)
+++ subversion/tests/cmdline/svntest/main.py (working copy)
@@ -129,7 +129,7 @@ else:
if windows:
svneditor_script = os.path.join(sys.path[0], 'svneditor.bat')
else:
- svneditor_script = os.path.join(sys.path[0], 'svneditor.py')
+ svneditor_script = os.path.join(sys.path[0], 'svneditor.sh')
# Username and password used by the working copies
wc_author = 'jrandom'
Index: subversion/tests/cmdline
===================================================================
--- subversion/tests/cmdline (revision 1886884)
+++ subversion/tests/cmdline (working copy)
Property changes on: subversion/tests/cmdline
___________________________________________________________________
Modified: svn:ignore
## -11,3 +11,4 ##
.libs
.davautocheck.sh.stop
lock-helper
+svneditor.sh