Skip to content

Commit 95980b3

Browse files
committed
try some workarounds
1 parent 1acd660 commit 95980b3

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
run: |
198198
docker run --platform=${{ matrix.platform }} --rm \
199199
"$(jq -r '."builder-${{ matrix.variant }}"."containerimage.config.digest"' <<< "${METADATA}")" \
200-
sh -c 'go test -tags ${{ matrix.race }} -v ./... && cd caddy && go test -tags nobadger,nomysql,nopgx ${{ matrix.race }} -v ./...'
200+
sh -c 'CGO_CFLAGS="-D_GNU_SOURCE" go test -tags ${{ matrix.race }} -v ./... && cd caddy && go test -tags nobadger,nomysql,nopgx ${{ matrix.race }} -v ./...'
201201
env:
202202
METADATA: ${{ steps.build.outputs.metadata }}
203203
# Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
working-directory: internal/testcli/
5555
run: go build
5656
- name: Run library tests
57-
run: go test -race -v ./...
57+
run: CGO_CFLAGS="-D_GNU_SOURCE" go test -race -v ./...
5858
- name: Run Caddy module tests
5959
working-directory: caddy/
6060
run: go test -tags nobadger,nomysql,nopgx -race -v ./...

internal/testext/exttest.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
package testext
22

3-
//#include "extension.h"
3+
// #cgo darwin pkg-config: libxml-2.0
4+
// #cgo CFLAGS: -Wall -Werror
5+
// #cgo CFLAGS: -I/usr/local/include -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
6+
// #cgo linux CFLAGS: -D_GNU_SOURCE
7+
// #cgo darwin CFLAGS: -I/opt/homebrew/include
8+
// #cgo LDFLAGS: -L/usr/local/lib -L/usr/lib -lphp -lm -lutil
9+
// #cgo linux LDFLAGS: -ldl -lresolv
10+
// #cgo darwin LDFLAGS: -Wl,-rpath,/usr/local/lib -L/opt/homebrew/lib -L/opt/homebrew/opt/libiconv/lib -liconv -ldl
11+
// #include "extension.h"
412
import "C"
513
import (
614
"github.com/dunglas/frankenphp"

0 commit comments

Comments
 (0)