Skip to content

Commit 9d4096d

Browse files
committed
fix: use local Go toolchain
1 parent 1d74b2c commit 9d4096d

11 files changed

Lines changed: 45 additions & 2 deletions

.github/workflows/sanitizers.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
- "docs/**"
1414
permissions:
1515
contents: read
16+
env:
17+
GOTOOLCHAIN: local
1618
jobs:
1719
# Adapted from https://github.com/beberlei/hdrhistogram-php
1820
sanitizers:

.github/workflows/static.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ permissions:
2929
attestations: write
3030
env:
3131
IMAGE_NAME: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/')) && 'dunglas/frankenphp' || 'dunglas/frankenphp-dev' }}
32+
GOTOOLCHAIN: local
3233
jobs:
3334
prepare:
3435
runs-on: ubuntu-24.04

.github/workflows/tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
- "docs/**"
1414
permissions:
1515
contents: read
16+
env:
17+
GOTOOLCHAIN: local
1618
jobs:
1719
tests-linux:
1820
name: Tests (Linux, PHP ${{ matrix.php-versions }})

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
5757
COPY --from=golang-base /usr/local/go /usr/local/go
5858

5959
ENV PATH=/usr/local/go/bin:$PATH
60+
ENV GOTOOLCHAIN=local
6061

6162
# This is required to link the FrankenPHP binary to the PHP binary
6263
RUN apt-get update && \

alpine.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
5757
COPY --link --from=golang-base /usr/local/go /usr/local/go
5858

5959
ENV PATH=/usr/local/go/bin:$PATH
60+
ENV GOTOOLCHAIN=local
6061

6162
# hadolint ignore=SC2086
6263
RUN apk add --no-cache --virtual .build-deps \

caddy/caddy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func (f *FrankenPHPApp) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
343343
}
344344

345345
if f.MaxThreads > 0 && f.NumThreads > 0 && f.MaxThreads < f.NumThreads {
346-
return errors.New("'max_threads' must be greater than or equal to 'num_threads'")
346+
return errors.New(`"max_threads"" must be greater than or equal to "num_threads"`)
347347
}
348348

349349
return nil

caddy/caddy_test.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,37 @@ func TestPHP(t *testing.T) {
5555
wg.Wait()
5656
}
5757

58+
func TestPHPSimplified(t *testing.T) {
59+
var wg sync.WaitGroup
60+
tester := caddytest.NewTester(t)
61+
tester.InitServer(`
62+
{
63+
skip_install_trust
64+
admin localhost:2999
65+
http_port `+testPort+`
66+
https_port 9443
67+
}
68+
69+
localhost:`+testPort+` {
70+
route {
71+
php {
72+
root ../testdata
73+
}
74+
}
75+
}
76+
`, "caddyfile")
77+
78+
for i := 0; i < 100; i++ {
79+
wg.Add(1)
80+
81+
go func(i int) {
82+
tester.AssertGetResponse(fmt.Sprintf("http://localhost:"+testPort+"/index.php?i=%d", i), http.StatusOK, fmt.Sprintf("I am by birth a Genevese (%d)", i))
83+
wg.Done()
84+
}(i)
85+
}
86+
wg.Wait()
87+
}
88+
5889
func TestLargeRequest(t *testing.T) {
5990
tester := caddytest.NewTester(t)
6091
tester.InitServer(`

dev-alpine.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#checkov:skip=CKV_DOCKER_3
44
FROM golang:1.24-alpine
55

6+
ENV GOTOOLCHAIN=lcoal
67
ENV CFLAGS="-ggdb3"
78
ENV PHPIZE_DEPS="\
89
autoconf \

dev.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#checkov:skip=CKV_DOCKER_3
44
FROM golang:1.24
55

6+
ENV GOTOOLCHAIN=lcoal
67
ENV CFLAGS="-ggdb3"
78
ENV PHPIZE_DEPS="\
89
autoconf \

static-builder-gnu.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ ARG MIMALLOC=''
2222
ARG NO_COMPRESS=''
2323

2424
# go version
25-
ENV GO_VERSION=1.24.1
25+
ENV GO_VERSION=1.24
26+
ENV GOTOOLCHAIN=local
2627

2728
# labels, same as static-builder.Dockerfile
2829
LABEL org.opencontainers.image.title=FrankenPHP

0 commit comments

Comments
 (0)