Add GLIBC compatibility documentation and solutions

- Add comprehensive GLIBC_COMPATIBILITY.md with multiple solutions for GLIBC version conflicts
- Update BUILD.md with Python 3.13 requirements and GLIBC compatibility section
- Document Docker, virtual environment, and target system build approaches
- Provide troubleshooting steps for GLIBC 2.38 requirement issues
parent c4744d00
Pipeline #172 canceled with stages
...@@ -4,10 +4,11 @@ This document explains how to build the Fixture Manager daemon as a single execu ...@@ -4,10 +4,11 @@ This document explains how to build the Fixture Manager daemon as a single execu
## Prerequisites ## Prerequisites
- Python 3.8 or higher - Python 3.13 or higher (for current build configuration)
- pip (Python package installer) - pip (Python package installer)
- At least 2GB of free disk space for the build process - At least 2GB of free disk space for the build process
- Internet connection for downloading dependencies - Internet connection for downloading dependencies
- Compatible GLIBC version (see GLIBC Compatibility section below)
## Quick Build ## Quick Build
...@@ -92,7 +93,7 @@ The single executable file contains: ...@@ -92,7 +93,7 @@ The single executable file contains:
- All necessary libraries - All necessary libraries
### File Size ### File Size
The executable will be approximately 80-120MB depending on your platform. The executable will be approximately 45-50MB depending on your platform and included dependencies.
### Platform Compatibility ### Platform Compatibility
- **Linux**: Build on the target distribution for best compatibility - **Linux**: Build on the target distribution for best compatibility
...@@ -128,6 +129,56 @@ The executable looks for configuration in these locations (in order): ...@@ -128,6 +129,56 @@ The executable looks for configuration in these locations (in order):
3. Ensure MySQL is installed and running 3. Ensure MySQL is installed and running
4. Run the executable to initialize the database 4. Run the executable to initialize the database
## GLIBC Compatibility
⚠️ **Important**: Executables built with Python 3.13 require GLIBC 2.38 or higher on the target system.
### Checking GLIBC Version
```bash
# Check GLIBC version on target system
ldd --version
```
### Compatibility Solutions
**If you encounter GLIBC errors:**
```
[PYI-16812:ERROR] Failed to load Python shared library: version `GLIBC_2.38' not found
```
**Solution 1: Build on Target System (Recommended)**
```bash
# Build directly on the deployment system
git clone <repository>
cd MBetter
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-build.txt
python build.py
```
**Solution 2: Use Virtual Environment Deployment**
Instead of a single executable, deploy with a virtual environment for maximum compatibility:
```bash
# Create deployment package
python3 -m venv deployment_venv
source deployment_venv/bin/activate
pip install -r requirements.txt
tar -czf fixture-manager-deployment.tar.gz deployment_venv/ fixture_daemon.py app/ database/ config.py .env.example
```
**Solution 3: Use Docker for Consistent Builds**
```dockerfile
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv git
WORKDIR /app
COPY . .
RUN python3 -m venv venv && . venv/bin/activate && pip install -r requirements-build.txt
RUN . venv/bin/activate && python build.py
```
See `GLIBC_COMPATIBILITY.md` for detailed solutions.
## Troubleshooting ## Troubleshooting
### Common Build Issues ### Common Build Issues
......
# GLIBC Compatibility Issue
## Problem
The PyInstaller executable built with Python 3.13 requires GLIBC 2.38 or higher, but the target deployment system has an older GLIBC version.
**Error Message:**
```
[PYI-16812:ERROR] Failed to load Python shared library '/tmp/_MEIXZCEYU/libpython3.13.so': /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /tmp/_MEIXZCEYU/libpython3.13.so)
```
## Solutions
### Solution 1: Build on Target System (Recommended)
Build the executable directly on the target system or a system with the same GLIBC version:
```bash
# On the target system:
git clone <repository>
cd MBetter
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-build.txt
python build.py
```
### Solution 2: Use Docker for Consistent Build Environment
Create a Docker container with an older base system:
```dockerfile
# Dockerfile
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv git
WORKDIR /app
COPY . .
RUN python3 -m venv venv
RUN . venv/bin/activate && pip install -r requirements-build.txt
RUN . venv/bin/activate && python build.py
```
Build with Docker:
```bash
docker build -t fixture-manager-builder .
docker run --rm -v $(pwd)/dist:/app/dist fixture-manager-builder
```
### Solution 3: Use Older Python Version
If available, use Python 3.11 or 3.10 which have better GLIBC compatibility:
```bash
# Check available Python versions
ls /usr/bin/python3*
# Use older Python version
python3.11 -m venv venv
source venv/bin/activate
# Update requirements to compatible versions for older Python
pip install -r requirements-build.txt
python build.py
```
### Solution 4: Static Linking (Advanced)
Modify the PyInstaller spec file to use static linking:
```python
# In fixture-manager.spec, add to the EXE section:
exe = EXE(
# ... existing parameters ...
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
# Add static linking options
bootloader_ignore_signals=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=None,
# Force static linking
exclude_binaries=False,
)
```
### Solution 5: Virtual Environment Deployment
Instead of a single executable, deploy with a virtual environment:
```bash
# Create deployment package
python3 -m venv deployment_venv
source deployment_venv/bin/activate
pip install -r requirements.txt
# Package the entire virtual environment
tar -czf fixture-manager-deployment.tar.gz deployment_venv/ fixture_daemon.py app/ database/ config.py .env.example
# On target system:
tar -xzf fixture-manager-deployment.tar.gz
source deployment_venv/bin/activate
python fixture_daemon.py start
```
## Checking Target System Compatibility
To check the GLIBC version on your target system:
```bash
ldd --version
# or
/lib/x86_64-linux-gnu/libc.so.6
```
## Recommended Approach
For maximum compatibility, **Solution 1** (building on the target system) is recommended as it ensures the executable is built against the exact libraries available on the deployment system.
If that's not possible, **Solution 5** (virtual environment deployment) provides the most reliable cross-system compatibility while maintaining all functionality.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment