Skip to content

Commit c4e3838

Browse files
committed
chore: wip
1 parent e7cc1fd commit c4e3838

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

.github/workflows/precompile-binaries.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,18 @@ jobs:
175175
zlib \
176176
libiconv
177177
178+
# Verify readline installation
179+
echo "Checking readline installation:"
180+
ls -la $(brew --prefix readline)/include/readline/readline.h || echo "readline.h not found in expected location"
181+
ls -la $(brew --prefix readline)/lib/libreadline.* || echo "libreadline not found in expected location"
182+
183+
# Create symlinks to help PHP find readline
184+
echo "Creating symlinks for readline:"
185+
sudo mkdir -p /usr/local/include/readline
186+
sudo ln -sf $(brew --prefix readline)/include/readline/readline.h /usr/local/include/readline/readline.h
187+
sudo ln -sf $(brew --prefix readline)/include/readline/history.h /usr/local/include/readline/history.h
188+
sudo ln -sf $(brew --prefix readline)/lib/libreadline.* /usr/local/lib/
189+
178190
- name: Create build configuration
179191
run: |
180192
mkdir -p ${{ env.BUILD_DIR }} ${{ env.OUTPUT_DIR }}
@@ -212,6 +224,10 @@ jobs:
212224
echo "LDFLAGS=-L$(brew --prefix)/lib -L$(brew --prefix openssl@3)/lib" >> $GITHUB_ENV
213225
echo "CPPFLAGS=-I$(brew --prefix)/include -I$(brew --prefix openssl@3)/include" >> $GITHUB_ENV
214226
227+
# Set readline-specific paths
228+
echo "READLINE_CFLAGS=-I$(brew --prefix readline)/include" >> $GITHUB_ENV
229+
echo "READLINE_LIBS=-L$(brew --prefix readline)/lib -lreadline" >> $GITHUB_ENV
230+
215231
- name: Download and extract PHP source
216232
run: |
217233
cd ${{ env.BUILD_DIR }}
@@ -235,7 +251,20 @@ jobs:
235251
# Configure with platform-specific options
236252
if [[ "${{ matrix.platform }}" == "darwin" ]]; then
237253
# On macOS, use Homebrew-installed libraries
238-
EXTRA_CONFIG="--with-iconv=$(brew --prefix libiconv)"
254+
# Set environment variables for readline detection
255+
export CPPFLAGS="$CPPFLAGS -I$(brew --prefix readline)/include"
256+
export LDFLAGS="$LDFLAGS -L$(brew --prefix readline)/lib"
257+
export LIBS="$LIBS -lreadline"
258+
259+
# Try to find readline.h and set the path explicitly
260+
READLINE_PATH=$(brew --prefix readline)
261+
if [[ -f "$READLINE_PATH/include/readline/readline.h" ]]; then
262+
echo "Found readline.h at $READLINE_PATH/include/readline/readline.h"
263+
EXTRA_CONFIG="--with-iconv=$(brew --prefix libiconv) --with-readline=$READLINE_PATH"
264+
else
265+
echo "readline.h not found, disabling readline support"
266+
EXTRA_CONFIG="--with-iconv=$(brew --prefix libiconv) --disable-readline"
267+
fi
239268
else
240269
# On Linux, use system-installed libraries
241270
# System libraries should be available via apt-get installation
@@ -248,6 +277,17 @@ jobs:
248277
echo " Prefix: $INSTALL_PREFIX"
249278
echo " Extra config: $EXTRA_CONFIG"
250279
280+
# Debug: Check readline installation on macOS
281+
if [[ "${{ matrix.platform }}" == "darwin" ]]; then
282+
echo "Debug: Checking readline installation on macOS:"
283+
echo " READLINE_CFLAGS: $READLINE_CFLAGS"
284+
echo " READLINE_LIBS: $READLINE_LIBS"
285+
echo " CPPFLAGS: $CPPFLAGS"
286+
echo " LDFLAGS: $LDFLAGS"
287+
echo " Checking if readline.h exists:"
288+
find $(brew --prefix) -name "readline.h" 2>/dev/null || echo " No readline.h found"
289+
fi
290+
251291
# Check if libcurl is found via pkg-config
252292
if pkg-config --exists libcurl; then
253293
echo "libcurl found via pkg-config"

0 commit comments

Comments
 (0)