Skip to content

Commit 582e649

Browse files
RahulHereRahulHere
authored andcommitted
Fix missing headers in prebuilt packages
The build scripts and Dockerfiles had an INSTALL_DIR path mismatch that caused headers to not be copied to the build output. CMake installed to ${BUILD_DIR}/install but the scripts tried to copy from install_prefix_dir. Also added header verification to the GitHub workflow to ensure headers are always included in prebuilt packages. Changes: - Fix INSTALL_DIR path in build-mac-x64.sh, build-mac-arm64.sh, build-linux-x64.sh, build-linux-arm64.sh - Fix CMAKE_INSTALL_PREFIX and copy paths in Dockerfile.linux-x64, Dockerfile.linux-arm64, Dockerfile.linux-arm64-cross - Add header verification step to build-all.yml workflow for all platforms
1 parent 3b43dbc commit 582e649

8 files changed

Lines changed: 46 additions & 20 deletions

File tree

.github/workflows/build-all.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ jobs:
6868
echo "Error: Library not found!"
6969
exit 1
7070
fi
71+
# Check for headers
72+
if [ -d "build-output/linux-${{ matrix.arch }}/include/mcp" ]; then
73+
echo "✓ Headers found"
74+
ls build-output/linux-${{ matrix.arch }}/include/mcp/ | head -10
75+
else
76+
echo "Error: Headers not found!"
77+
exit 1
78+
fi
7179
7280
- name: Upload artifacts
7381
uses: actions/upload-artifact@v4
@@ -113,6 +121,14 @@ jobs:
113121
echo "Error: DLL not found!"
114122
exit 1
115123
fi
124+
# Check for headers
125+
if [ -d "build-output/windows-${{ matrix.arch }}/include/mcp" ]; then
126+
echo "✓ Headers found"
127+
ls build-output/windows-${{ matrix.arch }}/include/mcp/ | head -10
128+
else
129+
echo "Error: Headers not found!"
130+
exit 1
131+
fi
116132
117133
- name: Upload artifacts
118134
uses: actions/upload-artifact@v4
@@ -177,6 +193,14 @@ jobs:
177193
echo "Error: Library not found!"
178194
exit 1
179195
fi
196+
# Check for headers
197+
if [ -d "build-output/mac-${{ matrix.arch }}/include/mcp" ]; then
198+
echo "✓ Headers found"
199+
ls build-output/mac-${{ matrix.arch }}/include/mcp/ | head -10
200+
else
201+
echo "Error: Headers not found!"
202+
exit 1
203+
fi
180204
181205
- name: Upload artifacts
182206
uses: actions/upload-artifact@v4

docker-mcp/Dockerfile.linux-arm64

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,18 @@ RUN mkdir -p cmake-build && cd cmake-build && \
3535
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} \
3636
-DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} \
3737
-DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} \
38+
-DCMAKE_INSTALL_PREFIX=/build/cmake-build/install \
3839
/build && \
3940
make -j$(nproc) && \
4041
make install
4142

4243
# Create output directory and organize files
4344
RUN mkdir -p /output && \
44-
cp /build/install_prefix_dir/lib/libgopher-mcp*.so* /output/ 2>/dev/null || true && \
45-
cp /build/install_prefix_dir/lib/libgopher_mcp_c*.so* /output/ 2>/dev/null || true && \
46-
cp /build/install_prefix_dir/lib/libfmt*.so* /output/ 2>/dev/null || true && \
47-
cp /build/install_prefix_dir/lib/libllhttp*.so* /output/ 2>/dev/null || true && \
48-
cp -r /build/install_prefix_dir/include /output/ 2>/dev/null || true
45+
cp /build/cmake-build/install/lib/libgopher-mcp*.so* /output/ 2>/dev/null || true && \
46+
cp /build/cmake-build/install/lib/libgopher_mcp_c*.so* /output/ 2>/dev/null || true && \
47+
cp /build/cmake-build/install/lib/libfmt*.so* /output/ 2>/dev/null || true && \
48+
cp /build/cmake-build/install/lib/libllhttp*.so* /output/ 2>/dev/null || true && \
49+
cp -r /build/cmake-build/install/include /output/ 2>/dev/null || true
4950

5051
# Build verification tool
5152
RUN printf '%s\n' \

docker-mcp/Dockerfile.linux-arm64-cross

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ RUN mkdir -p cmake-build && cd cmake-build && \
9393
-DBUILD_C_API=ON \
9494
-DBUILD_BINDINGS_EXAMPLES=OFF \
9595
-DBUILD_EXAMPLES=OFF \
96-
-DCMAKE_INSTALL_PREFIX=/build/install_prefix_dir \
96+
-DCMAKE_INSTALL_PREFIX=/build/cmake-build/install \
9797
-DOPENSSL_ROOT_DIR=/usr \
9898
-DOPENSSL_INCLUDE_DIR=/usr/include \
9999
-DOPENSSL_CRYPTO_LIBRARY=/usr/lib/aarch64-linux-gnu/libcrypto.so \
@@ -104,11 +104,11 @@ RUN mkdir -p cmake-build && cd cmake-build && \
104104

105105
# Create output directory and organize files
106106
RUN mkdir -p /output && \
107-
cp /build/install_prefix_dir/lib/libgopher-mcp*.so* /output/ 2>/dev/null || true && \
108-
cp /build/install_prefix_dir/lib/libgopher_mcp_c*.so* /output/ 2>/dev/null || true && \
109-
cp /build/install_prefix_dir/lib/libfmt*.so* /output/ 2>/dev/null || true && \
110-
cp /build/install_prefix_dir/lib/libllhttp*.so* /output/ 2>/dev/null || true && \
111-
cp -r /build/install_prefix_dir/include /output/ 2>/dev/null || true
107+
cp /build/cmake-build/install/lib/libgopher-mcp*.so* /output/ 2>/dev/null || true && \
108+
cp /build/cmake-build/install/lib/libgopher_mcp_c*.so* /output/ 2>/dev/null || true && \
109+
cp /build/cmake-build/install/lib/libfmt*.so* /output/ 2>/dev/null || true && \
110+
cp /build/cmake-build/install/lib/libllhttp*.so* /output/ 2>/dev/null || true && \
111+
cp -r /build/cmake-build/install/include /output/ 2>/dev/null || true
112112

113113
# Build verification tool using cross-compiler
114114
RUN printf '%s\n' \

docker-mcp/Dockerfile.linux-x64

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ RUN mkdir -p cmake-build && cd cmake-build && \
2727
-DBUILD_C_API=ON \
2828
-DBUILD_BINDINGS_EXAMPLES=OFF \
2929
-DBUILD_EXAMPLES=OFF \
30+
-DCMAKE_INSTALL_PREFIX=/build/cmake-build/install \
3031
/build && \
3132
make -j$(nproc) && \
3233
make install
3334

3435
# Create output directory and organize files
3536
RUN mkdir -p /output && \
36-
cp /build/install_prefix_dir/lib/libgopher-mcp*.so* /output/ 2>/dev/null || true && \
37-
cp /build/install_prefix_dir/lib/libgopher_mcp_c*.so* /output/ 2>/dev/null || true && \
38-
cp /build/install_prefix_dir/lib/libfmt*.so* /output/ 2>/dev/null || true && \
39-
cp /build/install_prefix_dir/lib/libllhttp*.so* /output/ 2>/dev/null || true && \
40-
cp -r /build/install_prefix_dir/include /output/ 2>/dev/null || true
37+
cp /build/cmake-build/install/lib/libgopher-mcp*.so* /output/ 2>/dev/null || true && \
38+
cp /build/cmake-build/install/lib/libgopher_mcp_c*.so* /output/ 2>/dev/null || true && \
39+
cp /build/cmake-build/install/lib/libfmt*.so* /output/ 2>/dev/null || true && \
40+
cp /build/cmake-build/install/lib/libllhttp*.so* /output/ 2>/dev/null || true && \
41+
cp -r /build/cmake-build/install/include /output/ 2>/dev/null || true
4142

4243
# Build verification tool
4344
RUN printf '%s\n' \

docker-mcp/build-linux-arm64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
2323
# Build configuration
2424
BUILD_DIR="${PROJECT_ROOT}/build-linux-arm64"
2525
DEPS_DIR="${PROJECT_ROOT}/_deps-linux-arm64"
26-
INSTALL_DIR="${PROJECT_ROOT}/install_prefix_dir"
26+
INSTALL_DIR="${BUILD_DIR}/install"
2727
OUTPUT_DIR="${PROJECT_ROOT}/build-output/linux-arm64"
2828

2929
# Detect architecture

docker-mcp/build-linux-x64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
2323
# Build configuration
2424
BUILD_DIR="${PROJECT_ROOT}/build-linux-x64"
2525
DEPS_DIR="${PROJECT_ROOT}/_deps-linux-x64"
26-
INSTALL_DIR="${PROJECT_ROOT}/install_prefix_dir"
26+
INSTALL_DIR="${BUILD_DIR}/install"
2727
OUTPUT_DIR="${PROJECT_ROOT}/build-output/linux-x64"
2828

2929
# Detect architecture

docker-mcp/build-mac-arm64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
2424
# Build configuration
2525
BUILD_DIR="${PROJECT_ROOT}/build-mac-arm64"
2626
DEPS_DIR="${PROJECT_ROOT}/_deps-arm64"
27-
INSTALL_DIR="${PROJECT_ROOT}/install_prefix_dir"
27+
INSTALL_DIR="${BUILD_DIR}/install"
2828
OUTPUT_DIR="${PROJECT_ROOT}/build-output/mac-arm64"
2929
MIN_MACOS_VERSION="11.0" # Minimum version for Apple Silicon
3030

docker-mcp/build-mac-x64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
2424
# Build configuration
2525
BUILD_DIR="${PROJECT_ROOT}/build-mac-x64"
2626
DEPS_DIR="${PROJECT_ROOT}/_deps-x64"
27-
INSTALL_DIR="${PROJECT_ROOT}/install_prefix_dir"
27+
INSTALL_DIR="${BUILD_DIR}/install"
2828
OUTPUT_DIR="${PROJECT_ROOT}/build-output/mac-x64"
2929
MIN_MACOS_VERSION="10.14"
3030

0 commit comments

Comments
 (0)