dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.79k stars 950 forks source link

Build issue. Linker looking in wrong dir #220

Closed Forza-tng closed 2 years ago

Forza-tng commented 2 years ago

Describe the bug It seems that the linker is looking in the wrong path for the third_party .a files. For example third_party/libs/dconv/lib/libdouble-conversion.a is actually available at third_party/libs/dconv/libdouble-conversion.a. The same goes for all of the files in the output below.

To Reproduce Steps to reproduce the behavior:

  1. git clone --recursive https://github.com/dragonflydb/dragonfly && cd dragonfly
  2. helio/blaze.sh -release
  3. cd build-opt
  4. ninja dragonfly

Expected behavior Clean build.

Screenshots

/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot
find third_party/libs/dconv/lib/libdouble-conversion.a: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot
find third_party/libs/mimalloc/lib/libmimalloc.a: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot
find third_party/libs/xxhash/lib/libxxhash.a: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Desktop (please complete the following information):

Additional context

I've tried with GCC 11.3.0 and 12.1.1 with the same results. GCC 12 produced some additional warnings, but it compiled fine if I moved the .a files to the correct dirs.

romange commented 2 years ago

Weird. Maybe it's related to newer cmake? What's your cmake version?

Forza-tng commented 2 years ago

I'm using cmake 3.22.4.

romange commented 2 years ago

I succeeded to reproduce on Gentoo with cmake 3.22.2. Submitted https://github.com/romange/helio/commit/a2fffa3132683fa61f53f9e80caa57e4f714f0bc will fix dragonfly tomorrow.

Forza-tng commented 2 years ago

Amazing :) I'll try it later tonight again.

Thank you 🙏

Edit: It solved the build issues. :)