Skip to content

Comments

Build system modernization#210

Open
zayenz wants to merge 20 commits intorelease/6.3.0from
build-modernization
Open

Build system modernization#210
zayenz wants to merge 20 commits intorelease/6.3.0from
build-modernization

Conversation

@zayenz
Copy link
Member

@zayenz zayenz commented Feb 20, 2026

This PR overhauls the whole Gecode build system. It has the following large changes

  • Removed the contribs directory. Simplifies building and build systems, and has not been used for a long time.
  • CMake is separated from autoconf, updated, and requires version 3.21
  • Autoconf is modernized, and without contribs the configure.ac.in is no longer needed
  • Switched from Perl to Python using uv for all scripts
  • A full test-matrix that compiles on Linux, Mac, and Windows on GitHub.

A new requirement for building is to have uv installed. This simplifies the external dependencies from a system installed Perl or Python to a single dependency that will manage an isolated virtual environment for each script.

@chatgpt-codex-connector

This comment was marked as off-topic.

@zayenz zayenz requested a review from guidotack February 20, 2026 08:44
@zayenz
Copy link
Member Author

zayenz commented Feb 20, 2026

@greptile Review this please

@greptile-apps
Copy link

greptile-apps bot commented Feb 20, 2026

Greptile Summary

This PR comprehensively modernizes Gecode's build infrastructure across CMake, autoconf, and CI/CD pipelines. The changes establish uv as the unified dependency manager for Python-based build scripts, raise CMake to version 3.21 with proper GECODE_* option namespacing, and make configure.ac the canonical autoconf source with version metadata centralized in gecode-version.m4.

Major Changes:

  • CMake modernization: Minimum version raised to 3.21, full decoupling from autoconf, new GecodeSources.cmake for source inventory, proper GECODE_* option naming with deprecation warnings for legacy aliases
  • Autoconf modernization: Updated to 2.69+, configure.ac is now canonical (no longer generated), version metadata shared via gecode-version.m4, Perl dependency replaced with uv
  • Python migration: All Perl build scripts converted to Python 3.9+ with PEP 723 inline metadata for uv execution (genvarimp.py, allexamples.py, genchangelog.py, etc.)
  • CI expansion: Comprehensive test matrix covering Linux, macOS, and Windows across both build systems, including MSYS2-based autoconf testing on Windows
  • Contribs cleanup: Removed unmaintained qecode and quacode modules (13,000+ lines deleted)
  • Windows fixes: CPProfiler now compiles on Windows/MinGW with proper _WIN32 guards and conditional MSVC pragmas

The migration is well-executed with proper backward compatibility (deprecation warnings for old CMake options), comprehensive CI coverage, and detailed changelog entries. All Python scripts use modern syntax with type hints and PEP 723 metadata for reproducible uv-based execution.

Confidence Score: 5/5

  • This PR is safe to merge - comprehensive build system modernization with excellent CI coverage and proper migration path
  • The changes are well-structured with backward compatibility, comprehensive testing across platforms (Linux, macOS, Windows) and build systems (CMake, autoconf), proper deprecation warnings, detailed documentation updates, and appropriate changelog entries. The Python migrations follow best practices with PEP 723 metadata, and the Windows compilation fixes are minimal and correct.
  • No files require special attention - all changes follow consistent patterns and are properly tested

Important Files Changed

Filename Overview
.github/workflows/build.yml Added comprehensive CI matrix testing Linux, macOS, and Windows builds via CMake and autoconf, with uv dependency management
CMakeLists.txt Modernized CMake (min 3.21), decoupled from autoconf, added proper option namespacing (GECODE_*), and uv-based code generation
configure.ac Modernized to autoconf 2.69+, made canonical source (no longer generated from configure.ac.in), centralized version metadata in gecode-version.m4
gecode-version.m4 New canonical version metadata file shared by autoconf and CMake, defines version, soversion, and flatzinc version
misc/genvarimp.py Python migration of variable implementation code generator, uses PEP 723 inline script metadata for uv
gecode/search/cpprofiler/connector.hpp Fixed Windows/MinGW compilation by using standard _WIN32 guards and conditionally applying MSVC-specific pragmas
Makefile.in Replaced Perl script calls with uv-based Python execution, removed contribs support, added CPProfiler linking for Windows
README.md Updated documentation for CMake 3.21 requirement, uv dependency, and GECODE_* option naming conventions

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Build System Modernization] --> B[CMake Path]
    A --> C[Autoconf Path]
    
    B --> B1[CMakeLists.txt<br/>Min version 3.21]
    B1 --> B2[GecodeSources.cmake<br/>Decoupled source lists]
    B2 --> B3[GenerateVarImp.cmake<br/>uv-based codegen]
    
    C --> C1[configure.ac<br/>Canonical source]
    C1 --> C2[gecode-version.m4<br/>Shared metadata]
    C2 --> C3[Makefile.in<br/>uv script execution]
    
    B3 --> D[Python Scripts<br/>PEP 723 metadata]
    C3 --> D
    
    D --> D1[genvarimp.py]
    D --> D2[allexamples.py]
    D --> D3[genchangelog.py]
    D --> D4[Other utilities]
    
    A --> E[CI/CD Matrix]
    E --> E1[Linux: autoconf + CMake]
    E --> E2[macOS: autoconf + CMake]
    E --> E3[Windows: CMake + MSYS2]
    
    E1 --> F[uv dependency]
    E2 --> F
    E3 --> F
    
    A --> G[Cleanup]
    G --> G1[Remove contribs/]
    G --> G2[Remove configure.ac.in]
    G --> G3[Remove Perl scripts]
Loading

Last reviewed commit: 35fa496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants