wg / wrk

Modern HTTP benchmarking tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build is not reproducible

bmwiedemann opened this issue · comments

While working on reproducible builds for openSUSE, I found that
our wrk package does not build reproducibly.

I found that the problem comes from the step where luajit produces bytecode.c from wrk.lua because the ordering of hash-table elements is non-deterministic.

for i in $(seq 100) ; do
obj/bin/luajit -b src/wrk.lua out.c ; md5sum out.c
done | sort | uniq -c

      7 1bd4204083654f5bf1cf06c2ef7d66ca  out.c
      1 1ea98f25d56b7e6612e674cd1cbb01e5  out.c
      9 395d32504ba77a8b1e77d6fe3ba65fb0  out.c
      4 3a0670bd7f137eed1689489bfa8fba21  out.c
      9 3bbb121dbe3f5e55f770f2c2fa731088  out.c
     18 41b1073081dee2b966c103b3244260f3  out.c
      6 687ac115ad5a9dddd1be0225fa5a30e8  out.c
      2 8696465af120e9d965cdd06c1db53712  out.c
      2 9ba9f3f208f84b833a6900e0b58e7206  out.c
      2 9c54df99cc9f973e35008fc9c5070f44  out.c
      7 9e710447f23a61dccdd5b0de36e4ea26  out.c
      2 a29bdae6b54fd80dfb26abf84db66cf7  out.c
      9 cb65480a8b62fe920727e59dc0061ebc  out.c
     10 d2abb54e5332ba5b656aa453435e9154  out.c
     11 ec177bda0950f2af6d120dd8351301e0  out.c
      1 f08bed1cbf3d3422caf932e39ecdbd26  out.c
--- old /usr/bin/wrk (hexdump)
+++ new /usr/bin/wrk (hexdump)
@@ -29912,10 +29912,10 @@
  75780 07003d01 06003301 09003d01 08003200  ..=...3...=...2.
  75790 00804c00 0200000b 666f726d 61740009  ..L.....format..
  757a0 696e6974 000a7365 74757000 0c726573  init..setup..res
- 757b0 6f6c7665 0c686561 64657273 0100040b  olve.headers....
- 757c0 6d657468 6f640847 45540968 6f73740e  method.GET.host.
- 757d0 6c6f6361 6c686f73 740b7363 68656d65  localhost.scheme
- 757e0 09687474 70097061 7468062f 00000000  .http.path./....
+ 757b0 6f6c7665 0c686561 64657273 01000409  olve.headers....
+ 757c0 686f7374 0e6c6f63 616c686f 73740970  host.localhost.p 
+ 757d0 61746806 2f0b7363 68656d65 09687474  ath./.scheme.htt
+ 757e0 700b6d65 74686f64 08474554 00000000  p.method.GET....
  757f0 68747470 5f706172 7365725f 70617573  http_parser_paus
  75800 65000000 00000000 00000000 00000000  e...............
  75810 68747470 5f706172 7365725f 70617273  http_parser_pars