Skip to content

Instantly share code, notes, and snippets.

View jun66j5's full-sized avatar

Jun Omae (大前 潤) jun66j5

  • OpenGroove,Inc.
  • Tokyo, Japan
View GitHub Profile
@jun66j5
jun66j5 / gist:e0dd2f06e1906f62441cf320de047b8d
Created September 16, 2024 10:55
Errors on compiling swig-rb with msvc
"C:\usr\src\subversion\trunk-py312\subversion_vcnet.sln" (__MORE__;__SWIG_PYTHON__;__SWIG_PERL__;__SWIG_RUBY__;__JAVAHL__;__JAVAHL_TESTS__ target) (1) ->
"C:\usr\src\subversion\trunk-py312\build\win32\vcnet-vcproj\__SWIG_RUBY__.vcxproj" (default target) (152) ->
"C:\usr\src\subversion\trunk-py312\build\win32\vcnet-vcproj\ruby_core.vcxproj" (default target) (153) ->
"C:\usr\src\subversion\trunk-py312\build\win32\vcnet-vcproj\libsvn_swig_ruby_dll.vcxproj" (default target) (155) ->
"C:\usr\src\subversion\trunk-py312\build\win32\vcnet-vcproj\libsvn_swig_ruby.vcxproj" (default target) (156) ->
(ClCompile target) ->
C:\usr\src\subversion\trunk-py312\subversion\bindings\swig\ruby\libsvn_swig_ruby\swigutil_rb__pre_ruby.h(60,14): error C2632: 'long' followed by '__int64' is illegal [C:\usr\src\subversion\trunk-py312\build\win32\vcnet-vcproj\libsvn_swig_ruby.vcxproj]
C:\usr\src\subversion\trunk-py312\subversion\bindings\swig\ruby\libsvn_swig_ruby\swigutil_rb.
Code page 37
========
default no_best_fit_chars
37 U+0080 (20) (20)
37 U+0081 ! (21) ! (21)
37 U+0082 " (22) " (22)
37 U+0083 # (23) # (23)
37 U+0084 $ (24) $ (24)
37 U+0085 (15) (15)
37 U+0086 (06) (06)
@jun66j5
jun66j5 / rcsfile-replace-private-data.py
Created November 25, 2021 23:37
Replace private data in RCS file
#! /usr/bin/python
import os
import re
import sys
_rcsdiff_re = re.compile(r"""
\n
([^\n]+)\n
diff --git a/build/run_tests.py b/build/run_tests.py
index 7ae07806b..d6cf417e1 100755
--- a/build/run_tests.py
+++ b/build/run_tests.py
@@ -91,6 +91,26 @@ class TextColors:
cls.SUCCESS = ''
+if hasattr(subprocess.Popen, '__enter__'):
+ Popen = subprocess.Popen
javascript:(function(b,k,e,l,s) { b = document.body; k = new Set(); e = function(event) { var m = /^\w[\w\d]*/.exec(event.target.textContent); if (m) b.className += ' x-highlight-' + m[0]; }; l = function(event) { var m = /^\w[\w\d]*/.exec(event.target.textContent); if (m) b.className = b.className.replace(' x-highlight-' + m[0], ''); }; document.querySelectorAll('dl em, dl span.pre').forEach(function(node) { var m = /^\w[\w\d]*/.exec(node.textContent); if (m) { node.className += ' x-highlight-' + m[0]; node.addEventListener('mouseenter', e); node.addEventListener('mouseleave', l); k.add(m[0]); } }); s = document.createElement('style'); k = Array.from(k.keys()); s.textContent = k.map(v => 'body.@ .@'.replace(/@/g, 'x-highlight-' + v)) .join(', ') + ' { background-color: lightgreen }'; b.appendChild(s); })()
@jun66j5
jun66j5 / patterns of apr_pool_t arguments
Last active May 26, 2020 05:51
swig-py apis with multiple apr_pool_t arguments
apr_pool_t pool
apr_pool_t result
apr_pool_t result_pool
apr_pool_t scratch_pool
apr_pool_t node_pool, apr_pool_t pool
apr_pool_t result_pool, apr_pool_t scratch_pool
Handle correctly multiple apr_pool_t * arguments of function in Python
bindings to fix negative ref count of _global_py_pool object.
* subversion/bindings/swig/include/svn_types.swg
(%typemap(default) apr_pool_t *): Retrieve apr_pool_t * pointer from args
parameter only when _global_pool is NULL in order to increase correctly ref
count.
(%typemap(in) apr_pool_t *): Retrieve apr_pool_t * pointer from the Python
object when an argument is not the last apr_pool_t * argument.
(%typemap(freearg) apr_pool_t *): Decreament ref count of Python object only
Index: subversion/bindings/swig/core.i
===================================================================
--- subversion/bindings/swig/core.i (revision 1877480)
+++ subversion/bindings/swig/core.i (working copy)
@@ -23,8 +23,10 @@
* of the more specific module files.
*/
+%include svn_module.swg
+
* build/run_tests.py
(open_logfile): New function returning file-like object which is reassignable
sys.stdout and sys.stderr.
(TestHarness.run): Use open_logfile() instead of codecs.open().
(TestHarness._open_log): Ditto.
(TestHarness._run_py_test): Reassign sys.stdout and sys.stderr instead of
uses of os.dup2().
* subversion/tests/cmdline/svntest/main.py
(LoggingStdoutHandler): New function to use the value of sys.stdout at call
@jun66j5
jun66j5 / build.cmd
Created April 23, 2020 18:41
Build script for Subversion on Windows x64
@REM
@REM Top-directory/
@REM httpd/ .... Apache Lounge Distribution / Apache 2.4.x win64 VS16
@REM Apache24/
@REM include/
@REM expat_external.h .... https://github.com/libexpat/libexpat/raw/R_2_2_9/expat/lib/expat_external.h
@REM py3c/ .... https://github.com/encukou/py3c
@REM include/
@REM py3c.pc.in
@REM sqlite/ .... SQLite amalgamation