varnishcache / varnish-cache

Varnish Cache source code repository
https://www.varnish-cache.org
Other
3.56k stars 365 forks source link

varnishtest fails to recognise -D as an option on alpine #4090

Closed gquintard closed 2 months ago

gquintard commented 3 months ago

Expected Behavior

/ # varnishtest foo.vtc -D x=1 should start the test, setting the x macro to 1

Current Behavior

/ # varnishtest foo.vtc  -D x=1
Cannot stat file "-D": No such file or directory

Possible Solution

No response

Steps to Reproduce (for bugs)

docker run -it alpine sh -c "apk add varnish; echo varnishtest > foo.vtc; varnishtest foo.vtc -D x=1"

Context

I was packaging so vmods and stumble onto that one.

Varnish Cache version

varnishd (varnish-7.5.0 revision eef25264e5ca5f96a77129308edb83ccf84cb1b1)

Operating system

alpine:3

Source of binary packages used (if any)

No response

gquintard commented 3 months ago

I toyed a bit with it, and it looks like that alpine's getopt wants all the switched before the filenames. So this works:

varnishtest -D x= foo.vtc

I'll leave that around just in case somebody wants to look at it, but feel free to close.

dridi commented 3 months ago

That's how getopt() normally works, have you tried an older build on the same alpine version? It probably got stricter on the alpine side.

bsdphk commented 3 months ago

FreeBSD also wants flags before filenames.

bsdphk commented 2 months ago

WontFix