Skip to content

Commit

Permalink
Merge branch 'apache:trunk' into apr-2-ldap
Browse files Browse the repository at this point in the history
  • Loading branch information
minfrin authored Aug 29, 2024
2 parents 2fd0919 + 374474b commit d24fe29
Show file tree
Hide file tree
Showing 455 changed files with 3,491 additions and 1,981 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ on:
env:
MARGS: "-j2"
CFLAGS: "-g"
# This will need updating as the ubuntu-latest image changes:
PHP_FPM: "/usr/sbin/php-fpm8.1"

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
include:
# -------------------------------------------------------------------------
- name: Empty APLOGNO() test
env: |
Expand Down Expand Up @@ -169,6 +171,19 @@ jobs:
TEST_ARGS="-defines LDAP"
TESTS="t/modules/"
# -------------------------------------------------------------------------
- name: APR 1.7.x, APR-util 1.7.x, LDAP
config: --enable-mods-shared=reallyall
pkgs: ldap-utils
env: |
APR_VERSION=1.7.x
APU_VERSION=1.7.x
APU_CONFIG="--with-crypto --with-ldap"
TEST_MALLOC=1
TEST_LDAP=1
TEST_ARGS="-defines LDAP"
TESTS="t/modules/"
CLEAR_CACHE=1
# -------------------------------------------------------------------------
### TODO: if: *condition_not_24x
- name: APR trunk thread debugging
config: --enable-mods-shared=reallyall --with-mpm=event
Expand Down Expand Up @@ -241,7 +256,7 @@ jobs:
APR_VERSION=1.7.4
APU_VERSION=1.6.3
APU_CONFIG="--with-crypto"
RUSTLS_VERSION="v0.10.0"
RUSTLS_VERSION="v0.13.0"
NO_TEST_FRAMEWORK=1
TEST_INSTALL=1
TEST_MOD_TLS=1
Expand Down Expand Up @@ -271,7 +286,7 @@ jobs:
- name: OpenSSL 3.1
config: --enable-mods-shared=most --enable-maintainer-mode --disable-md --disable-http2 --disable-ldap --disable-crypto
env: |
TEST_OPENSSL3=3.1.5
TEST_OPENSSL3=3.1.6
APR_VERSION=1.7.4
APU_VERSION=1.6.3
APU_CONFIG="--without-crypto"
Expand All @@ -280,24 +295,25 @@ jobs:
config: --enable-mods-shared=most --enable-maintainer-mode --disable-md --disable-http2 --disable-ldap --disable-crypto
notest-cflags: -Werror -O2 -Wno-deprecated-declarations
env: |
TEST_OPENSSL3=3.2.1
TEST_OPENSSL3=3.2.2
APR_VERSION=1.7.4
APU_VERSION=1.6.3
APU_CONFIG="--without-crypto"
# -------------------------------------------------------------------------
- name: OpenSSL 3.2 no-engine
config: --enable-mods-shared=most --enable-maintainer-mode --disable-md --disable-http2 --disable-ldap --disable-crypto
env: |
TEST_OPENSSL3=3.2.1
TEST_OPENSSL3=3.2.2
OPENSSL_CONFIG=no-engine
APR_VERSION=1.7.4
APU_VERSION=1.6.3
APU_CONFIG="--without-crypto"
# -------------------------------------------------------------------------
- name: OpenSSL 3.3 (alpha) no-engine
- name: OpenSSL 3.3 no-engine -Werror
config: --enable-mods-shared=most --enable-maintainer-mode --disable-md --disable-http2 --disable-ldap --disable-crypto
notest-cflags: -Werror -O2
env: |
TEST_OPENSSL3=3.3.0-alpha1
TEST_OPENSSL3=3.3.1
OPENSSL_CONFIG=no-engine
APR_VERSION=1.7.4
APU_VERSION=1.6.3
Expand All @@ -324,7 +340,7 @@ jobs:
cpanminus libtool-bin libapr1-dev libaprutil1-dev
liblua5.3-dev libbrotli-dev libcurl4-openssl-dev
libnghttp2-dev libjansson-dev libpcre2-dev gdb
perl-doc ${{ matrix.pkgs }}
perl-doc libsasl2-dev ${{ matrix.pkgs }}
- uses: actions/checkout@v4
- name: Cache installed libraries
uses: actions/cache@v4
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Windows

on:
push:
branches: [ "*" ]
paths-ignore:
- 'docs/**'
- STATUS
- CHANGES
- changes-entries/*
pull_request:
branches: [ "trunk", "2.4.x" ]
paths-ignore:
- 'docs/**'
- STATUS
- CHANGES
- changes-entries/*

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: Default
triplet: x64-windows
arch: x64
build-type: Debug
generator: "Ninja"

runs-on: windows-latest
timeout-minutes: 30
name: ${{ matrix.name }}
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install dependencies
run: vcpkg install --triplet ${{ matrix.triplet }} apr[private-headers] apr-util pcre2 openssl

- uses: actions/checkout@v3

- name: Configure CMake
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ matrix.arch }}
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ^
-G "${{ matrix.generator }}" ^
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-DAPR_INCLUDE_DIR=C:/vcpkg/installed/${{ matrix.triplet }}/include ^
"-DAPR_LIBRARIES=C:/vcpkg/installed/${{ matrix.triplet }}/lib/libapr-1.lib;C:/vcpkg/installed/${{ matrix.triplet }}/lib/libaprutil-1.lib"
- name: Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ matrix.arch }}
cmake --build ${{github.workspace}}/build --config ${{ matrix.build-type }}
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ Release
/build/config.sub
/build/config.guess
/build/config_vars.sh
/build/confdefs.h
/build/config.log
/build/config.nice
/build/srclib/
/build/srclib/pth
/build/srclib/apr
/build/srclib/apr-util
/build/srclib/apr-iconv
/build/srclib/distcache
/build/srclib/lua
/build/srclib/pcre
/build/srclib/openssl
/build/srclib/zlib

# /build/pkg/
/build/pkg/pkginfo
Expand Down Expand Up @@ -371,4 +384,4 @@ test/*/*/__pycache__

# make check
check
build/config_vars.out
build/config_vars.out
98 changes: 57 additions & 41 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ PROJECT(HTTPD C)

INCLUDE(CheckSymbolExists)
INCLUDE(CheckCSourceCompiles)
INCLUDE("build/build-modules-c.cmake")

FIND_PACKAGE(LibXml2)
FIND_PACKAGE(Lua51)
FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(CURL)
FIND_PACKAGE(PCRE2 COMPONENTS 8BIT)

# Options for support libraries not supported by cmake-bundled FindFOO

Expand All @@ -49,7 +51,10 @@ ENDIF()
# PCRE names its libraries differently for debug vs. release builds.
# We can't query our own CMAKE_BUILD_TYPE at configure time.
# If the debug version exists in PREFIX/lib, default to that one.
IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcre2-8d.lib")
IF(PCRE2_FOUND)
SET(default_pcre_libraries "PCRE2::8BIT")
SET(default_pcre_cflags "-DHAVE_PCRE2")
ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcre2-8d.lib")
SET(default_pcre_libraries ${CMAKE_INSTALL_PREFIX}/lib/pcre2-8d.lib)
SET(default_pcre_cflags "-DHAVE_PCRE2")
ELSEIF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/pcre2-8.lib")
Expand Down Expand Up @@ -137,16 +142,6 @@ FOREACH(onelib ${APR_LIBRARIES})
ENDIF()
ENDFOREACH()

MACRO(DEFINE_WITH_BLANKS output_definition input_symbol input_value)
IF(MSVC_IDE OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.11)
SET(${output_definition} "-D${input_symbol}=\"${input_value}\"")
ELSE()
# command-line tool + older cmake, where extra quotes must be added and
# escaped to survive
SET(${output_definition} "-D${input_symbol}=\"\\\"${input_value}\\\"\"")
ENDIF()
ENDMACRO()

MACRO(GET_MOD_ENABLE_RANK macro_modname macro_mod_enable_val macro_output_rank)
IF(${macro_mod_enable_val} STREQUAL "O")
SET(${macro_output_rank} 0)
Expand Down Expand Up @@ -558,6 +553,10 @@ IF(LIBXML2_FOUND)
ENDIF()
SET(mod_proxy_scgi_extra_libs mod_proxy)
SET(mod_proxy_wstunnel_extra_libs mod_proxy)
SET(mod_lbmethod_bybusyness_extra_libs mod_proxy)
SET(mod_lbmethod_bytraffic_extra_libs mod_proxy)
SET(mod_lbmethod_byrequests_extra_libs mod_proxy)
SET(mod_lbmethod_heartbeat_extra_libs mod_proxy)
SET(mod_proxy_http2_requires NGHTTP2_FOUND)
SET(mod_proxy_http2_extra_defines ssize_t=long)
SET(mod_proxy_http2_extra_includes ${NGHTTP2_INCLUDE_DIR})
Expand Down Expand Up @@ -648,26 +647,20 @@ SET(install_targets)
SET(install_bin_pdb)
SET(install_modules) # special handling vs. other installed targets
SET(install_modules_pdb)
SET(builtin_module_shortnames "win32 mpm_winnt http so") # core added automatically
SET(builtin_module_shortnames)
LIST(APPEND builtin_module_shortnames "win32" "mpm_winnt" "http" "so") # core added automatically
SET(extra_builtin_modules) # the ones specified with -DWITH_MODULES=

IF(WITH_MODULES) # modules statically linked with the server
STRING(REPLACE "," ";" WITH_MODULE_LIST ${WITH_MODULES})
FOREACH(static_mod ${WITH_MODULE_LIST})
STRING(REGEX MATCH "[^/]+\\.c" mod_basename ${static_mod})
STRING(REGEX REPLACE "^mod_(.*)\\.c" "\\1" mod_module_name ${mod_basename})
SET(builtin_module_shortnames "${builtin_module_shortnames} ${mod_module_name}")
CONFIGURE_FILE(${static_mod} ${PROJECT_BINARY_DIR}/ COPYONLY)
SET(extra_builtin_modules ${extra_builtin_modules} ${PROJECT_BINARY_DIR}/${mod_basename})
ENDFOREACH()
EXECUTE_PROCESS(COMMAND cmd /c "echo ${builtin_module_shortnames}| awk -f ${CMAKE_CURRENT_SOURCE_DIR}/build/build-modules-c.awk > ${PROJECT_BINARY_DIR}/modules.c" RESULT_VARIABLE rv)
IF(rv)
MESSAGE(FATAL_ERROR "build-modules-c.awk failed (${rv})")
ENDIF()
ELSE()
# no extra built-in modules; use the default modules.c to avoid the awk prereq
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/os/win32/modules.c ${PROJECT_BINARY_DIR}/ COPYONLY)
ENDIF()
STRING(REPLACE "," ";" WITH_MODULE_LIST "${WITH_MODULES}")
FOREACH(static_mod ${WITH_MODULE_LIST})
STRING(REGEX MATCH "[^/]+\\.c" mod_basename ${static_mod})
STRING(REGEX REPLACE "^mod_(.*)\\.c" "\\1" mod_module_name ${mod_basename})
LIST(APPEND builtin_module_shortnames "${mod_module_name}")
CONFIGURE_FILE(${static_mod} ${PROJECT_BINARY_DIR}/ COPYONLY)
SET(extra_builtin_modules ${extra_builtin_modules} ${PROJECT_BINARY_DIR}/${mod_basename})
ENDFOREACH()

generate_builtin_modules_c("${PROJECT_BINARY_DIR}/modules.c" "${builtin_module_shortnames}")

# for easy reference from .dll/.so builds
CONFIGURE_FILE(os/win32/BaseAddr.ref ${PROJECT_BINARY_DIR}/ COPYONLY)
Expand Down Expand Up @@ -893,8 +886,11 @@ FOREACH (mod ${MODULE_PATHS})
LINK_FLAGS /base:@${PROJECT_BINARY_DIR}/BaseAddr.ref,${mod_name}.so
)
TARGET_LINK_LIBRARIES(${mod_name} ${${mod_extra_libs}} libhttpd ${EXTRA_LIBS} ${APR_LIBRARIES} ${HTTPD_SYSTEM_LIBS})
DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "${mod_name} for Apache HTTP Server")
SET_TARGET_PROPERTIES(${mod_name} PROPERTIES COMPILE_FLAGS "${define_long_name} -DBIN_NAME=${mod_name}.so ${EXTRA_COMPILE_FLAGS}")
TARGET_COMPILE_DEFINITIONS(${mod_name} PRIVATE
"LONG_NAME=${mod_name} for Apache HTTP Server"
"BIN_NAME=${mod_name}.so"
)
TARGET_COMPILE_OPTIONS(${mod_name} PRIVATE "${EXTRA_COMPILE_FLAGS}")

# Extra defines?
SET(mod_extra_defines "${mod_name}_extra_defines")
Expand All @@ -921,17 +917,27 @@ SET_TARGET_PROPERTIES(libhttpd PROPERTIES
SET(install_targets ${install_targets} libhttpd)
SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:libhttpd>)
TARGET_LINK_LIBRARIES(libhttpd ${EXTRA_LIBS} ${APR_LIBRARIES} ${PCRE_LIBRARIES} ${HTTPD_SYSTEM_LIBS})
DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server Core")
SET_TARGET_PROPERTIES(libhttpd PROPERTIES COMPILE_FLAGS "-DAP_DECLARE_EXPORT -DAPREQ_DECLARE_EXPORT ${define_long_name} ${PCRE_CFLAGS} -DBIN_NAME=libhttpd.dll ${EXTRA_COMPILE_FLAGS}")
TARGET_COMPILE_DEFINITIONS(libhttpd PRIVATE
"LONG_NAME=Apache HTTP Server Core"
"BIN_NAME=libhttpd.dll"
"AP_DECLARE_EXPORT"
"APREQ_DECLARE_EXPORT"
)
TARGET_COMPILE_OPTIONS(libhttpd PRIVATE ${PCRE_CFLAGS} ${EXTRA_COMPILE_FLAGS})
ADD_DEPENDENCIES(libhttpd test_char_header)

########### HTTPD EXECUTABLES ##########
ADD_EXECUTABLE(httpd server/main.c build/win32/httpd.rc)
SET(install_targets ${install_targets} httpd)
SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:httpd>)
DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server")
TARGET_COMPILE_DEFINITIONS(httpd PRIVATE
"APP_FILE"
"LONG_NAME=Apache HTTP Server"
"BIN_NAME=httpd.exe"
"ICON_FILE=${CMAKE_SOURCE_DIR}/build/win32/apache.ico"
)
TARGET_COMPILE_OPTIONS(httpd PRIVATE "${EXTRA_COMPILE_FLAGS}")
SET_TARGET_PROPERTIES(httpd PROPERTIES
COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=httpd.exe -DICON_FILE=${CMAKE_SOURCE_DIR}/build/win32/apache.ico ${EXTRA_COMPILE_FLAGS}"
LINK_FLAGS "/stack:0x40000"
)
TARGET_LINK_LIBRARIES(httpd libhttpd ${EXTRA_LIBS})
Expand All @@ -954,8 +960,12 @@ FOREACH(pgm ${standard_support})
ADD_EXECUTABLE(${pgm} support/${pgm}.c ${${extra_sources}} build/win32/httpd.rc)
SET(install_targets ${install_targets} ${pgm})
SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:${pgm}>)
DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server ${pgm} program")
SET_TARGET_PROPERTIES(${pgm} PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=${pgm}.exe ${EXTRA_COMPILE_FLAGS}")
TARGET_COMPILE_DEFINITIONS(${pgm} PRIVATE
"APP_FILE"
"LONG_NAME=Apache HTTP Server ${pgm} program"
"BIN_NAME=${pgm}.exe"
)
TARGET_COMPILE_OPTIONS(${mod_name} PRIVATE "${EXTRA_COMPILE_FLAGS}")
TARGET_LINK_LIBRARIES(${pgm} ${EXTRA_LIBS} ${APR_LIBRARIES})
ENDFOREACH()

Expand All @@ -964,8 +974,11 @@ SET(install_targets ${install_targets} ab)
SET(install_bin_pdb ${install_bin_pdb} $<TARGET_PDB_FILE:ab>)
SET(tmp_includes ${HTTPD_INCLUDE_DIRECTORIES})
SET_TARGET_PROPERTIES(ab PROPERTIES INCLUDE_DIRECTORIES "${tmp_includes}")
DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server ab program")
SET_TARGET_PROPERTIES(ab PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=ab.exe ${EXTRA_COMPILE_FLAGS}")
TARGET_COMPILE_DEFINITIONS(ab PRIVATE
"APP_FILE"
"LONG_NAME=Apache HTTP Server ab program"
"BIN_NAME=ab.exe"
)
TARGET_LINK_LIBRARIES(ab ${EXTRA_LIBS} ${APR_LIBRARIES} Ws2_32.lib)

IF(OPENSSL_FOUND)
Expand All @@ -975,8 +988,11 @@ IF(OPENSSL_FOUND)
SET_TARGET_PROPERTIES(abs PROPERTIES COMPILE_DEFINITIONS HAVE_OPENSSL)
SET(tmp_includes ${HTTPD_INCLUDE_DIRECTORIES} ${OPENSSL_INCLUDE_DIR})
SET_TARGET_PROPERTIES(abs PROPERTIES INCLUDE_DIRECTORIES "${tmp_includes}")
DEFINE_WITH_BLANKS(define_long_name "LONG_NAME" "Apache HTTP Server ab/SSL program")
SET_TARGET_PROPERTIES(abs PROPERTIES COMPILE_FLAGS "-DAPP_FILE ${define_long_name} -DBIN_NAME=abs.exe ${EXTRA_COMPILE_FLAGS}")
TARGET_COMPILE_DEFINITIONS(abs PRIVATE
"APP_FILE"
"LONG_NAME=Apache HTTP Server ab/SSL program"
"BIN_NAME=abs.exe"
)
TARGET_LINK_LIBRARIES(abs ${EXTRA_LIBS} ${APR_LIBRARIES} ${OPENSSL_LIBRARIES} Ws2_32.lib)
ENDIF()

Expand Down
3 changes: 0 additions & 3 deletions README.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ The following tools must be in PATH:
cmake version 3.1.3 or later is required to work with current OpenSSL
releases. (OpenSSL is an optional prerequisite of httpd.)
* Perl
* If the WITH_MODULES feature is used: awk
* If using a command-line compiler: compiler and linker and related tools
(Refer to the cmake documentation for more information.)

Expand Down Expand Up @@ -100,8 +99,6 @@ How to build

2. Make sure cmake and Perl are in PATH. Additionally, some backends
require compile tools in PATH. (Hint: "Visual Studio Command Prompt")
In the unlikely event that you use -DWITH_MODULES, described below, make
sure awk is in PATH.

3. cmake -G "some backend, like 'NMake Makefiles'"
-DCMAKE_INSTALL_PREFIX=d:/path/to/httpdinst
Expand Down
2 changes: 1 addition & 1 deletion STATUS
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
end of the ap_process_request_internal() processing so sub_req-esters
know this request cannot be run. This provides authors of older
modules better compatibility, while still improving the security and
robustness of 2.0.
robustness of 2.0.

Status: still need to decide where this goes, OtherBill comments...
Message-ID: <[email protected]>
Expand Down
Loading

0 comments on commit d24fe29

Please sign in to comment.