On Sat, Jun 8, 2024 at 2:05 PM Timofey Zhakov <t...@chemodax.net> wrote: > > On Sat, Jun 8, 2024 at 7:07 PM Daniel Sahlberg > <daniel.l.sahlb...@gmail.com> wrote: > > > > Hi! > > > > Den lör 8 juni 2024 kl 16:12 skrev Timofey Zhakov <t...@chemodax.net>: > >> > >> Hi all! > >> > >> When I was starting using and developing Subversion, I had a big > >> challenge to build it for the first time, especially because > >> Subversion itself and its dependencies have different build systems, > >> so this is a very complicated process. > >> > >> The build process can be improved by adding a generator for the CMake > >> build system. This can be easily implemented due to the extensibility > >> of the Subversion's gen-make. > >> > >> Some advantages of using CMake in Subversion: > >> - CMake is used by some Subversion dependencies, so there is nothing > >> else to learn. > >> - Great Visual Studio integration for build and tests. In addition, > >> there is a VSCode extension for CMake. > >> - CMake provides a very useful and simple system for finding dependencies. > >> - Better for build scripts and reproducibility of the build. > >> > >> The commands that would be needed to build Subversion, if you have all > >> dependencies installed: > >> > >> ``` > >> $ .\gen-make.py -t cmake > >> $ cmake -B out -DCMAKE_INSTALL_PREFIX=/path/to/deps > >> $ cmake --build out > >> ``` > >> > >> Additionally, there is a great tool, vcpkg, which can be used to build > >> dependencies. It is integrated with CMake. The following command can > >> be used to install dependencies: > >> > >> ``` > >> git clone https://github.com/microsoft/vcpkg > >> cd vcpkg > >> .\bootstrap-vcpkg.bat -disableMetrics > >> .\vcpkg.exe install apr apr-util expat zlib > >> ``` > >> > >> I am attaching a draft patch with the implementation of the CMake > >> generator. > >> > >> What do you think? > > > > > I think it would be a very good addition to support CMake. Thanks for > > bringing this up! > Thanks! > > > I'm just thinking about if it is worth supporting yet another build > > generator. The answer I'm looking for is not to shoot down this effort - > > rather: > > * Can we drop any of the existing targets? > > - vcproj probably can go away since CMake has a higher longterm chance of > > creating valid project files for future VS versions. > > - make, maybe we could switch completely? Are there any compelling reasons > > for NOT using CMake to create Makefile? > > * If we end up deciding to switch - shouldn't we rather rip out the > > existing build-system generator architecture? Otherwise we end up in a > > situation where we have a configuration (build.conf) and a generator > > (gen-make.py and related) creating rulefile(s) for CMake only to have CMake > > create rulefile(s) for whatever buildsystem actually used for building. > > I agree with you, because the current build system is too hard to > maintain and it's so complex, but there would be a lot of possible > breaking changes; some people might prefer to use the older build > systems, because they are more stable. Additionally, all existing > scripts won't work. > > That's why I decided to generate it by gen-make. Additionally, CMake > files can be included into release tar-ball like 'configure'. > > > That said, I'm having some trouble figuring out how to tell CMake where APR > > is installed. I run vcpkg as above in c:\devel, meaning I now have > > everything installed in c:\devel\vcpkg\installed\x64-windows (for example > > c:\devel\vcpkg\installed\x64-windows\include\apr.h). Still I get: > > > > [[[ > > C:\Devel\svn_trunk_cmake>cmake -B out > > -DCMAKE_INSTALL_PREFIX=c:\devel\vcpkg\installed\x64-windows > > -- Selecting Windows SDK version 10.0.22621.0 to target Windows 6.2.9200. > > CMake Warning at CMakeLists.txt:38 (find_package): > > By not providing "Findapr.cmake" in CMAKE_MODULE_PATH this project has > > asked CMake to find a package configuration file provided by "apr", but > > CMake did not find one. > > > > ...cut... > > ]]] > > > > I'm sure I'm doing things wrong but I can't figure out what... > > Sorry for not mentioning; there is a little problem in APR and APR > util because they don't export CMake targets [1], so the way I used to > link doesn't work with the latest versions. I was using apr-2 (from > trunk), where this was fixed. > > There is the same problem with serf, so I didn't implement it in CMake yet. > > Another problem that I didn't mention is that it's required to apply > the 'svn-fix-ws2_32.patch.txt' [2]. I duplicated the attachment to the > email. > > [1] CMake targets can be exported from the CMake project and they are > used for linking libraries, their dependencies, and setting the > include directories. > [2] https://lists.apache.org/thread/5vc4vj76o8mdkyvyqoqcgc0cjnhpx72k > > > -- > Timofei Zhakov
Hi Timofei, I am really glad to see this being addressed! CMake has been requested here before (such as [1], [2], and [3]) and the difficulty of building on Windows has been discussed/lamented here many times (such as [1]). I agree with the rationale of keeping the existing build system as-is and adding CMake as an option for those who want it. As you said, this avoids breaking changes. If it makes life easier and gets us more Windows contributors (especially testers at release time), I would strongly propose it (I mean: the final, non-draft patch) for backport for the 1.14.4 release. Caveat: So far I only glanced at the patch quickly; I will provide actual feedback after I look more carefully and test it. By the way, I don't know whether we'd normally allow a new build mode in a point release, but even if we normally wouldn't, I'd urge us to consider making an exception because we need more Windows testers. References: [1] Building SVN on Windows: dev@ thread "Building SVN (dependencies) on Windows" started 20 Apr 2020 https://lists.apache.org/thread/qf1tfohrwjrjk4qm1j1l8z11hfthlcq3 Notably this response from Wireshark maintainer Graham Bloice: https://lists.apache.org/thread/qdvl8hdb19fnq75qfx5wmxm5b1ylkdzd [2] Building SVN for Synology NAS: dev@ thread "SVN on Synology" started 17 Aug 2020 https://lists.apache.org/thread/q85nxhcfq574mxnnt8fdb2v1sxl09d32 Johan discusses CMake in this reply: https://lists.apache.org/thread/32kydm0y6826h099xgk48prxn8vbq9p9 [3] Building SVN for Android with NDK: dev@ thread "Cross compiling build instructions" started 15 Oct 2019 https://lists.apache.org/thread/qqll3l0kcon2k47q8qjyqr4htd9jmz2p CMake discussed in this follow-up: https://lists.apache.org/thread/djj5gns3d06t4k0m6mxs2s1zr8xkbgwo Your efforts are very much appreciated. Thanks, and cheers, Nathan