Build Module

Detailed instructions on building and packaging Python language module.

The Python Language Module (plugify-module-python3) is a core component of Plugify that enables the creation and management of Python plugins. This guide will walk you through the process of building the module from source.

Prerequisites

Before building the Python Language Module, ensure you have the following installed:

  • CMake (version 3.14 or later)
  • C++ Compiler with C++23 support. Release builds use:
    • GCC 14 (Linux)
    • MSVC 2022 (Windows)
    • Apple Clang (macOS)
  • Git: the Plugify core is a submodule of the repository, so clone it with --recursive. A separate build of the core is not needed.

Steps to Build the Python Language Module

Clone the Repository

Clone the plugify-module-python3 repository to your local machine:

git clone https://github.com/untrustedmodders/plugify-module-python3.git --recursive
cd plugify-module-python3

Generate Build Files

Create a build directory and generate the build files using CMake:

mkdir build
cd build
cmake ..

Build the Module

Build the module using the following command. The target name is plugify-module-python3.

cmake --build . --target plugify-module-python3

Verify the Build

Once the build process is complete, the compiled module will be located in the build directory. Verify the build by checking for the following files:

  • plugify-module-python3.dll (Windows)
  • libplugify-module-python3.so (Linux)
  • libplugify-module-python3.dylib (macOS)

Integrating the Python Language Module

After building the module, you can integrate it into your Plugify setup:

  1. Install a released package of the module as described in Installation. It brings the manifest and the runtime files the module needs.
  2. Replace the library in its bin folder with the one from your build folder.
  3. Run plg load and check that plg modules lists the module.

Troubleshooting

Common Issues

  1. Build Fails:
    • Ensure that you have the correct version of CMake and a compatible C++ compiler installed.
    • Verify that the submodules are cloned: git submodule update --init --recursive.
  2. Module Not Loaded:
    • Ensure the module file is placed in the correct directory (envs).
    • Check the Plugify logs for any errors related to module loading.
  3. Missing Symbols:
    • Build the module from a release tag, so that the bundled core matches the Plugify version you run.

Advanced Configuration

For more detailed instructions on building Language Modules (e.g., configuring CMake options, enabling tests, or building documentation), refer to the Building Plugify guide. The process is similar but contains much more info.