Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling pg_repack on Ubuntu 12.04 with apt.postgresql.org packages [SOLVED] #53

Closed
jberkus opened this issue Oct 16, 2015 · 3 comments

Comments

@jberkus
Copy link

jberkus commented Oct 16, 2015

Posting this issue here just in case anyone else runs into it.

The problem:
Ubuntu 12.04
PostgreSQL 9.3 installed from apt.postgresql.org packages.

root@dev-postgres:/var/lib/postgresql/pg_repack# make
make[1]: Entering directory `/var/lib/postgresql/pg_repack/bin'
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g pg_repack.o pgut/pgut.o pgut/pgut-fe.o -L/usr/lib/x86_64-linux-gnu -lpq -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5 -L/usr/lib/x86_64-linux-gnu/mit-krb5 -L/usr/lib/x86_64-linux-gnu -Wl,--as-needed -lpgport -lpgcommon -lssl -lcrypto -lkrb5 -lcom_err -lgssapi_krb5 -lz -ledit -lcrypt -ldl -lm -o pg_repack
/usr/bin/ld: cannot find -ledit
collect2: ld returned 1 exit status
make[1]: *** [pg_repack] Error 1

The solution:

Install "libedit-dev" from the Ubuntu Repositories.

Reason:

pg_repack gets a list of gcc linking flags from the package libpq-dev. That includes libedit, but libedit-dev is not marked as a dependancy of libpq-dev, so it's not installed.

Underlying issue will be raised with apt.postgresql.org.

@jberkus
Copy link
Author

jberkus commented Oct 16, 2015

Follow-up question: does it actually make sense to pull the full list of GCC flags from libpq-dev?

@schmiddy
Copy link
Member

(Sorry for the late follow-up)

Yeah, from the perspective of an end-user it's silly to have pg_repack requiring libedit / libreadline.

Unfortunately we are being given the LIBS we think we need to link against by pg_config and it feels dodgy/wrong for us to ignore its instructions, although we do it anyway. I suppose we could filter out -lreadline and -ledit as well, I don't reckon we should ever need anything from those libraries. @dvarrazzo what do you think?

And @jberkus I'm a bit out of the loop on the debian packages, did libedit-dev ever get added as a dependency of libpq-dev?

@MichaelDBA
Copy link
Collaborator

Closing this issue since the recompiling issue is on old distro (Ubuntu 12.04) and a very old EOLed PG Version (9.3).

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

No branches or pull requests

3 participants