Author: brane
Date: Sun Jun 8 01:04:33 2025
New Revision: 1926226
URL: http://svn.apache.org/viewvc?rev=1926226&view=rev
Log:
On the user-defined-authn branch: sync with trunk to r1926225.
Added:
serf/branches/user-defined-authn/build/__init__.py
- copied unchanged from r1926225, serf/trunk/build/__init__.py
serf/branches/user-defined-authn/build/scons_extras.py
- copied unchanged from r1926225, serf/trunk/build/scons_extras.py
Modified:
serf/branches/user-defined-authn/ (props changed)
serf/branches/user-defined-authn/.github/workflows/linux.yml
serf/branches/user-defined-authn/LICENSE
serf/branches/user-defined-authn/NOTICE
serf/branches/user-defined-authn/SConstruct
Propchange: serf/branches/user-defined-authn/
------------------------------------------------------------------------------
Merged /serf/trunk:r1926204-1926225
Modified: serf/branches/user-defined-authn/.github/workflows/linux.yml
URL:
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/.github/workflows/linux.yml?rev=1926226&r1=1926225&r2=1926226&view=diff
==============================================================================
--- serf/branches/user-defined-authn/.github/workflows/linux.yml (original)
+++ serf/branches/user-defined-authn/.github/workflows/linux.yml Sun Jun 8
01:04:33 2025
@@ -21,12 +21,12 @@ jobs:
- name: Install prerequisites
run: |
sudo apt-get update
- sudo apt-get install scons libapr1 libapr1-dev libaprutil1
libaprutil1-dev zlib1g zlib1g-dev libssl-dev
+ sudo apt-get -y install scons libapr1-dev libaprutil1-dev zlib1g-dev
libssl-dev libbrotli-dev libkrb5-dev
- uses: actions/checkout@v3
- name: Build
- run: scons
+ run: scons BROTLI=/usr GSSAPI=/usr
- name: Check
run: scons check
Modified: serf/branches/user-defined-authn/LICENSE
URL:
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/LICENSE?rev=1926226&r1=1926225&r2=1926226&view=diff
==============================================================================
--- serf/branches/user-defined-authn/LICENSE (original)
+++ serf/branches/user-defined-authn/LICENSE Sun Jun 8 01:04:33 2025
@@ -200,3 +200,34 @@
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.
+
+
+ADDITIONAL LICENSES:
+
+For parts of the configuration code in build/scons_extras.py:
+
+
+I. MIT License
+
+ Copyright The SCons Foundation
+ Copyright (c) 2003 Stichting NLnet Labs
+ Copyright (c) 2001, 2002, 2003 Steven Knight
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Modified: serf/branches/user-defined-authn/NOTICE
URL:
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/NOTICE?rev=1926226&r1=1926225&r2=1926226&view=diff
==============================================================================
--- serf/branches/user-defined-authn/NOTICE (original)
+++ serf/branches/user-defined-authn/NOTICE Sun Jun 8 01:04:33 2025
@@ -5,3 +5,6 @@ This product includes software developed
under Contributor License Agreements to The Apache Software Foundation
(http://www.apache.org/). See the revision logs for an exact contribution
history.
+
+This product includes software developed by the SCons Foundation under the
+MIT license, see LICENSE.
Modified: serf/branches/user-defined-authn/SConstruct
URL:
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/SConstruct?rev=1926226&r1=1926225&r2=1926226&view=diff
==============================================================================
--- serf/branches/user-defined-authn/SConstruct (original)
+++ serf/branches/user-defined-authn/SConstruct Sun Jun 8 01:04:33 2025
@@ -21,25 +21,41 @@
#
import sys
-import io
import os
import re
EnsureSConsVersion(2,3,0)
-# SCons 4.7 introduced the argument list parameter to CheckFunc.
-# Of course, GetSConsVersion() was added in 4.8, it's more fun that way.
-have_check_func = False
+
+# Compatibility with old versions of SCons
+try:
+ # Python 2 / SCons 2.3.0 etc.
+ from cStringIO import StringIO
+ print("warning: replaced StringIO() for Python version < 3.")
+except ImportError:
+ # Python 3
+ from io import StringIO
+
+# Set up our additional config tests.
+src_dir = File('SConstruct').rfile().get_dir().abspath
+sys.path.insert(0, src_dir)
+import build.scons_extras
+
+custom_tests = {'CheckGnuCC': build.scons_extras.CheckGnuCC}
+
+# SCons 4.7 introduced the function argument list parameter to CheckFunc.
try:
- if GetSConsVersion() >= (4, 7):
- def CheckFunc(conf, name, code, lang='C', args=''):
- return conf.CheckFunc(name, code, lang, args)
- have_check_func = True
-except NameError:
+ import SCons.Conftest as _conftest
+ _conftest.CheckFunc(None, 'clock', '#include <time.h>', 'C', '')
+except AttributeError:
+ # This comes from the 'None' context argument, above. It's fine, we just
+ # proved that CheckFunc has the funcargs parameter, so we don't have to
+ # replace it with our own implementation.
pass
-if not have_check_func:
- def CheckFunc(conf, name, code, lang='C', _=''):
- return conf.CheckFunc(name, code, lang)
+except TypeError:
+ # We have version < 4.7 without funcargs, use our replacement CheckFunc.
+ custom_tests['CheckFunc'] = build.scons_extras.CheckFunc
+ print('warning: replaced Conftest.CheckFunc() for SCons version < 4.7.')
HEADER_FILES = ['serf.h',
@@ -292,7 +308,7 @@ if sys.platform != 'win32':
context.Result(result)
return result
- conf = Configure(env, custom_tests = dict(CheckGnuCC=CheckGnuCC))
+ conf = Configure(env, custom_tests=custom_tests)
have_gcc = conf.CheckGnuCC()
env = conf.Finish()
@@ -440,7 +456,7 @@ if sys.platform == 'win32':
else:
env.Append(CPPPATH=['$OPENSSL/inc32'],
LIBPATH=['$OPENSSL/out32dll'])
- conf = Configure(env)
+ conf = Configure(env, custom_tests=custom_tests)
if conf.CheckLib('libcrypto'):
# OpenSSL 1.1.0+
env.Append(LIBS=['libcrypto.lib', 'libssl.lib'])
@@ -523,38 +539,38 @@ else:
# Check for OpenSSL functions which are only available in some of
# the versions we support. Also handles forks like LibreSSL.
-with io.StringIO(env.File('buckets/ssl_buckets.c')
- .rfile().get_text_contents()) as stream:
- ssl_include_rx = re.compile(r'^\s*#\s*include\s+<openssl/[^>]+>')
- ssl_include_list = []
- for line in stream.readlines():
- if ssl_include_rx.match(line):
- ssl_include_list.append(line.rstrip())
+ssl_include_rx = re.compile(r'^\s*#\s*include\s+<openssl/[^>]+>')
+ssl_include_list = []
+stream = StringIO(env.File('buckets/ssl_buckets.c')
+ .rfile().get_text_contents())
+for line in stream.readlines():
+ if ssl_include_rx.match(line):
+ ssl_include_list.append(line.rstrip())
ssl_includes = '\n'.join(ssl_include_list)
-conf = Configure(env)
-if not CheckFunc(conf, 'BIO_set_init', ssl_includes, 'C', 'NULL, 0'):
+conf = Configure(env, custom_tests=custom_tests)
+if not conf.CheckFunc('BIO_set_init', ssl_includes, 'C', 'NULL, 0'):
env.Append(CPPDEFINES=['SERF_NO_SSL_BIO_WRAPPERS'])
-if not CheckFunc(conf, 'X509_STORE_get0_param', ssl_includes, 'C', 'NULL'):
+if not conf.CheckFunc('X509_STORE_get0_param', ssl_includes, 'C', 'NULL'):
env.Append(CPPDEFINES=['SERF_NO_SSL_X509_STORE_WRAPPERS'])
-if not CheckFunc(conf, 'X509_get0_notBefore', ssl_includes, 'C', 'NULL'):
+if not conf.CheckFunc('X509_get0_notBefore', ssl_includes, 'C', 'NULL'):
env.Append(CPPDEFINES=['SERF_NO_SSL_X509_GET0_NOTBEFORE'])
-if not CheckFunc(conf, 'X509_get0_notAfter', ssl_includes, 'C', 'NULL'):
+if not conf.CheckFunc('X509_get0_notAfter', ssl_includes, 'C', 'NULL'):
env.Append(CPPDEFINES=['SERF_NO_SSL_X509_GET0_NOTAFTER'])
-if not CheckFunc(conf, 'X509_STORE_CTX_get0_chain', ssl_includes, 'C', 'NULL'):
+if not conf.CheckFunc('X509_STORE_CTX_get0_chain', ssl_includes, 'C', 'NULL'):
env.Append(CPPDEFINES=['SERF_NO_SSL_X509_GET0_CHAIN'])
-if not CheckFunc(conf, 'ASN1_STRING_get0_data', ssl_includes, 'C', 'NULL'):
+if not conf.CheckFunc('ASN1_STRING_get0_data', ssl_includes, 'C', 'NULL'):
env.Append(CPPDEFINES=['SERF_NO_SSL_ASN1_STRING_GET0_DATA'])
-if CheckFunc(conf, 'CRYPTO_set_locking_callback', ssl_includes, 'C', 'NULL'):
+if conf.CheckFunc('CRYPTO_set_locking_callback', ssl_includes, 'C', 'NULL'):
env.Append(CPPDEFINES=['SERF_HAVE_SSL_LOCKING_CALLBACKS'])
-if CheckFunc(conf, 'OPENSSL_malloc_init', ssl_includes):
+if conf.CheckFunc('OPENSSL_malloc_init', ssl_includes):
env.Append(CPPDEFINES=['SERF_HAVE_OPENSSL_MALLOC_INIT'])
-if CheckFunc(conf, 'SSL_library_init', ssl_includes):
+if conf.CheckFunc('SSL_library_init', ssl_includes):
env.Append(CPPDEFINES=['SERF_HAVE_OPENSSL_SSL_LIBRARY_INIT'])
-if CheckFunc(conf, 'OpenSSL_version_num', ssl_includes):
+if conf.CheckFunc('OpenSSL_version_num', ssl_includes):
env.Append(CPPDEFINES=['SERF_HAVE_OPENSSL_VERSION_NUM'])
-if CheckFunc(conf, 'SSL_set_alpn_protos', ssl_includes, 'C', 'NULL, NULL, 0'):
+if conf.CheckFunc('SSL_set_alpn_protos', ssl_includes, 'C', 'NULL, NULL, 0'):
env.Append(CPPDEFINES=['SERF_HAVE_OPENSSL_ALPN'])
if conf.CheckType('OSSL_HANDSHAKE_STATE', ssl_includes):
env.Append(CPPDEFINES=['SERF_HAVE_OSSL_HANDSHAKE_STATE'])
@@ -572,11 +588,11 @@ if sys.platform == 'win32':
env.Append(CPPDEFINES=['SERF_HAVE_SSPI'])
if brotli and CALLOUT_OKAY:
- conf = Configure(env)
+ conf = Configure(env, custom_tests=custom_tests)
if conf.CheckCHeader('brotli/decode.h') and \
- CheckFunc(conf, 'BrotliDecoderTakeOutput',
- '#include <brotli/decode.h>',
- 'C', 'NULL, NULL'):
+ conf.CheckFunc('BrotliDecoderTakeOutput',
+ '#include <brotli/decode.h>',
+ 'C', 'NULL, NULL'):
env.Append(CPPDEFINES=['SERF_HAVE_BROTLI'])
else:
print("Cannot find Brotli library >= 1.0.0 in '%s'." % env.get('BROTLI'))
@@ -610,7 +626,7 @@ pkgconfig = env.Textfile('serf-%d.pc' %
env.Default(lib_static, lib_shared, pkgconfig)
if CALLOUT_OKAY:
- conf = Configure(env)
+ conf = Configure(env, custom_tests=custom_tests)
### some configuration stuffs
if conf.CheckCHeader('stdbool.h'):
@@ -672,7 +688,6 @@ else:
check_script = env.File('build/check.py').rstr()
test_dir = env.File('test/test_all.c').rfile().get_dir()
-src_dir = env.File('serf.h').rfile().get_dir()
test_app = ("%s %s %s %s") % (sys.executable, check_script, test_dir, 'test')
# Set the library search path for the test programs