Skip to content

Make compilele-redis.sh executable#2

Merged
codemonstur merged 2 commits intocodemonstur:developfrom
martin-g:fix-build-on-arm642
Mar 16, 2021
Merged

Make compilele-redis.sh executable#2
codemonstur merged 2 commits intocodemonstur:developfrom
martin-g:fix-build-on-arm642

Conversation

@martin-g
Copy link
Copy Markdown

This fixed the build for ARM64 here.

make test fails with:


[14751] 16 Mar 08:48:36.572 # --- CLIENT LIST OUTPUT
[14751] 16 Mar 08:48:36.573 # id=3 addr=127.0.0.1:43205 fd=5 name= age=4 idle=0 flags=N db=9 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=set

[14751] 16 Mar 08:48:36.573 # --- CURRENT CLIENT INFO
[14751] 16 Mar 08:48:36.573 # client: id=3 addr=127.0.0.1:43205 fd=5 name= age=4 idle=0 flags=N db=9 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=set
[14751] 16 Mar 08:48:36.573 # argv[0]: 'set'
[14751] 16 Mar 08:48:36.573 # argv[1]: '923'
[14751] 16 Mar 08:48:36.573 # argv[2]: '923'

[exception]: Executing test client: I/O error reading reply.
I/O error reading reply
    while executing
"[srv $level "client"] {*}$args"
    (procedure "r" line 7)
    invoked from within
"r set $x $x"
    ("uplevel" body line 4)
    invoked from within
"uplevel 1 $code"
    (procedure "test" line 29)
    invoked from within
"test {SET 10000 numeric keys and access all them in reverse order} {
            set err {}
            for {set x 0} {$x < 10000} {incr x} {
        ..."
    ("uplevel" body line 23)
    invoked from within
"uplevel 1 $code"
    (procedure "tags" line 3)
    invoked from within
"tags {"slow"} {
        test {Very big payload random access} {
            set err {}
            array set payload {}
            for {set j 0} {$j ..."
    ("uplevel" body line 55)
    invoked from within
"uplevel 1 $code "
    (procedure "start_server" line 3)
    invoked from within
"start_server {tags {"basic"}} {
    test {DEL all keys to start with a clean DB} {
        foreach key [r keys *] {r del $key}
        r dbsize
    } ..."
    (file "tests/unit/basic.tcl" line 1)
    invoked from within
"source $path"
    (procedure "execute_tests" line 4)
    invoked from within
"execute_tests $data"
    (procedure "test_client_main" line 10)
    invoked from within
"test_client_main $::test_server_port "
Killing still running Redis server 14751
make[1]: *** [Makefile:211: test] Error 1
make[1]: Leaving directory '/redis/src'
make: *** [Makefile:6: test] Error 2
7

I will debug this error now!

@martin-g
Copy link
Copy Markdown
Author

The error in make test seems to be a QEMU related.
All is fine when executing make build-arm on real ARM64 hardware. I just needed to comment out @docker run -it --rm --privileged multiarch/qemu-user-static --credential yes --persistent yes there

@martin-g
Copy link
Copy Markdown
Author

The test failure is still there with Redis 6.0.10 too

@martin-g
Copy link
Copy Markdown
Author

The binary files (target/redis-2.8.19/src/redis-server) produced by Docker+QEMU and direct build on my ARM64 machine have the same file size: 5243928, but cmp gives some differences:

 cmp -l -b redis-server-built-on-arm64 redis-server-built-with-docker
    669 174 |    263 M-3
    670 366 M-v  304 M-D
    671 130 X     61 1
    672 203 M-^C 244 M-$
    673 323 M-S  122 R
    674 163 s    144 d
    675  15 ^M   351 M-i
    676 372 M-z   72 :
    677 212 M-^J 327 M-W
    678 176 ~     32 ^Z
    679 266 M-6  351 M-i
    680 105 E    226 M-^V
    681  30 ^X    64 4
    682 151 i    146 f
    683 310 M-H  303 M-C
    684 120 P    263 M-3
    685 270 M-8  336 M-^
    686 144 d    130 X
    687 273 M-;  171 y
    688 257 M-/  244 M-$
 798351 145 e    143 c
 798352  61 1     65 5
 798353  62 2     60 0
 798355 143 c     63 3
 798356 144 d    142 b
 798357  64 4     60 0
 798358 146 f     60 0
 798360 141 a     61 1
 798361 142 b     65 5
 798362  65 5     66 6
 798369  70 8     71 9
 798370  66 6     63 3
 798371  62 2     67 7
 798372  61 1     60 0
 798373  67 7     66 6

@codemonstur codemonstur changed the base branch from master to develop March 16, 2021 19:00
@codemonstur codemonstur merged commit 4e00de1 into codemonstur:develop Mar 16, 2021
@codemonstur
Copy link
Copy Markdown
Owner

I don't have ARM hardware available so I can't generate a binary directly. It'll have to go through QEMU.
I think the best way to use the library for you is to generate your own binary and stick it in a resource and then configure a RedisServer to use it like so:

final ExecutableProvider executables = new ExecutableProviderBuilder()
    .add2_8_19()
    .put(OS.UNIX, Architecture.aarch64, "/path/to/resource/redis-server-arm")
    .build();

new RedisServer(Redis.DEFAULT_REDIS_PORT, executables);

Let me know if this works for you.

@martin-g
Copy link
Copy Markdown
Author

If just redis-server works (i.e. looked up in the $PATH) then I think this could work well even for the OSS projects I care about!
In TravisCI I can apt install redis-server and use the binary!
I will test it right away!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants