Closed ghost closed 4 years ago
Here's the log (from debian docker container): buildlog.txt
This error seems to be (loosely) related to #61. However adding
-Wl,--no-as-needed
to gitrekt makefile does not resolve the issue for me.
From your output logs, this seems very related to #61. Can you runldd
on geef_nif.so
(see comment) and paste the results here?
Did you modify the LD_FLAGS
variable in Makefile
as indicated here? Could you run make clean && make
in apps/gitrekt
and past the output here?
@redrabbit
From your output logs, this seems very related to #61. Can you run
ldd
ongeef_nif.so
(see comment) and paste the results here?
root@gitgud1:/var/opt/gitgud/apps/gitrekt# ldd priv/geef_nif.so
linux-vdso.so.1 (0x00007ffe37537000)
libgit2.so.24 => /usr/lib/x86_64-linux-gnu/libgit2.so.24 (0x00007f3b7fdb7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3b7fa18000)
libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f3b7f799000)
libhttp_parser.so.2.1 => /usr/lib/x86_64-linux-gnu/libhttp_parser.so.2.1 (0x00007f3b7f592000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f3b7f378000)
libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f3b7f14b000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3b7ef43000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3b7ed26000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3b802aa000)
libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007f3b7eb00000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f3b7e8de000)
librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f3b7e6c1000)
libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f3b7e4b3000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f3b7e27c000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f3b7dee3000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f3b7dc98000)
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f3b7d9be000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f3b7d78b000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f3b7d587000)
liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f3b7d378000)
libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f3b7d127000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f3b7ce17000)
libunistring.so.0 => /usr/lib/x86_64-linux-gnu/libunistring.so.0 (0x00007f3b7cb00000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f3b7c8cb000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f3b7c648000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f3b7c3e3000)
libidn.so.11 => /lib/x86_64-linux-gnu/libidn.so.11 (0x00007f3b7c1af000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f3b7bf9c000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f3b7bd90000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3b7bb8c000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f3b7b988000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f3b7b771000)
libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f3b7b556000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f3b7b342000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f3b7b139000)
Did you modify the
LD_FLAGS
variable inMakefile
as indicated here? Could you runmake clean && make
inapps/gitrekt
and past the output here?
root@gitgud1:/var/opt/gitgud/apps/gitrekt# make clean
rm -f -r c_src/library.o c_src/oid.o c_src/commit.o c_src/config.o c_src/reflog.o
c_src/revwalk.o c_src/pack.o c_src/reference.o c_src/tag.o c_src/index.o c_src/object.o c_src/geef.o
c_src/pathspec.o c_src/revparse.o c_src/diff.o c_src/blob.o c_src/signature.o c_src/tree.o
c_src/postgres_backend.o c_src/repository.o priv/geef_nif.so
root@gitgud1:/var/opt/gitgud/apps/gitrekt# cat Makefile
ERLANG_PATH ?= $(shell erl -eval 'io:format("~s", [lists:concat([code:root_dir(), "/erts-", erlang:system_info(version), "/include"])])' -s init stop -noshell)
CFLAGS ?= -O2 -Wall -Wextra -Wno-unused-parameter -I$(ERLANG_PATH)
LDFLAGS += -Wl,--no-as-needed -lgit2
ifneq ($(OS),Windows_NT)
CFLAGS += -fPIC
ifeq ($(shell uname),Darwin)
LDFLAGS += -dynamiclib -undefined dynamic_lookup
endif
endif
src = $(wildcard c_src/*.c)
obj = $(src:.c=.o)
all: priv/geef_nif.so
priv/geef_nif.so: $(src)
@mkdir -p priv
$(CC) $(CFLAGS) -shared -w $(LDFLAGS) -o $@ $^
clean:
$(RM) -r $(obj) priv/geef_nif.so
.PHONY: clean
root@gitgud1:/var/opt/gitgud/apps/gitrekt# make
cc -O2 -Wall -Wextra -Wno-unused-parameter -I/usr/local/lib/erlang/erts-10.5.1/include -fPIC
-shared -w -Wl,--no-as-needed -lgit2 -o priv/geef_nif.so c_src/library.c c_src/oid.c c_src/commit.c
c_src/config.c c_src/reflog.c c_src/revwalk.c c_src/pack.c c_src/reference.c c_src/tag.c
c_src/index.c c_src/object.c c_src/geef.c c_src/pathspec.c c_src/revparse.c c_src/diff.c
c_src/blob.c c_src/signature.c c_src/tree.c c_src/postgres_backend.c c_src/repository.c
After make, recompiling using mix compile --force
does not change the error or output.
I've just tried with a fresh Ubuntu 19.04 and did not get any trouble compiling and running the server. I'll check with 18.04 asap.
Could you maybe try with Ubuntu 19.04. I don't really understand how we can get different results using Docker containers.
How did you install Elixir and Erlang? You are running 1.9.1 which is quite new. With the standard Ubuntu package repositories, I've got version 1.7.4 installed.
You are right, on 19.04 it works - but only with the changes to gitrekt's Makefile
. libgit2-dev
is 0.27.7 on 19.04 - I'll try to see if I can manually compile a newer version of libgit2 on 18.04 (or debian) and test if it's related to the version.
Update: I installed in the debian container libgit2-dev
0.27.4 from stretch-backports
- with the backport I can successfully compile the application.
@CharlotteDunois did you have to update the Makefile
as well with Debian or did it work out of the box?
@redrabbit I can confirm that it works out of the box with 0.27.4
.
Trying to compile gitgud will lead to the following error:
Debian (Docker (elixir-1.9.1 image) and Jessie (no Docker)):
Ubuntu (Docker (built from 18.04 image)):
Both use the same erlang + elixir version:
On Ubuntu the following libgit2-dev version is installed: v0.26.0 On Debian the following libgit2-dev version is installed: v0.25.1
This error seems to be (loosely) related to #61. However adding
-Wl,--no-as-needed
to gitrekt makefile does not resolve the issue for me.I am opening this issue ticket here, because you maintainers know certainly more about geef than me. If this is a bug in geef, please open an issue on the related issue tracker.