diff mbox series

docker: Install libpq-dev to fix psycopg2-binary build

Message ID 20190501043553.20314-1-ruscur@russell.cc
State Accepted
Headers show
Series docker: Install libpq-dev to fix psycopg2-binary build | expand

Commit Message

Russell Currey May 1, 2019, 4:35 a.m. UTC
psycopg2-binary fails if pg_config isn't installed, which is provided by
libpq-dev.

This seems strange to me since psycopg2-binary suggests that
you use psycopg2-binary instead (of itself) if you don't want to build
psycopg2 so you wouldn't need pg_config, which is very confusing.

It's possible that psycopg2-binary only needs to compile itself on
non-x86 platforms, since I hit this on ppc64le.

Anyway, it works when this is added.

Signed-off-by: Russell Currey <ruscur@russell.cc>
---
 tools/docker/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Donnellan May 1, 2019, 7:27 a.m. UTC | #1
On 1/5/19 2:35 pm, Russell Currey wrote:
> psycopg2-binary fails if pg_config isn't installed, which is provided by
> libpq-dev.
> 
> This seems strange to me since psycopg2-binary suggests that
> you use psycopg2-binary instead (of itself) if you don't want to build
> psycopg2 so you wouldn't need pg_config, which is very confusing.
> 
> It's possible that psycopg2-binary only needs to compile itself on
> non-x86 platforms, since I hit this on ppc64le.
> 
> Anyway, it works when this is added.

I don't think there is a binary psycopg2-binary build for anything other 
than i686/x86_64?

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> 
> Signed-off-by: Russell Currey <ruscur@russell.cc>
> ---
>   tools/docker/Dockerfile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
> index b9ecdb5..eef40e4 100644
> --- a/tools/docker/Dockerfile
> +++ b/tools/docker/Dockerfile
> @@ -26,7 +26,7 @@ RUN apt-get update -qq && \
>       python3.5-dev python3-pip python3-setuptools python3-wheel \
>       python3.4-dev findutils=4.4.2-7 python3.6-dev \
>       libmysqlclient-dev mysql-client curl unzip build-essential \
> -    git postgresql-client tzdata
> +    git postgresql-client tzdata libpq-dev
>   
>   # User
>   RUN useradd --uid=$UID --create-home patchwork
>
Russell Currey May 1, 2019, 7:34 a.m. UTC | #2
On Wed, 2019-05-01 at 17:27 +1000, Andrew Donnellan wrote:
> On 1/5/19 2:35 pm, Russell Currey wrote:
> > psycopg2-binary fails if pg_config isn't installed, which is
> > provided by
> > libpq-dev.
> > 
> > This seems strange to me since psycopg2-binary suggests that
> > you use psycopg2-binary instead (of itself) if you don't want to
> > build
> > psycopg2 so you wouldn't need pg_config, which is very confusing.
> > 
> > It's possible that psycopg2-binary only needs to compile itself on
> > non-x86 platforms, since I hit this on ppc64le.
> > 
> > Anyway, it works when this is added.
> 
> I don't think there is a binary psycopg2-binary build for anything
> other 
> than i686/x86_64?

Right, so it must fall back and build the thing if it doesn't exist for
the platform.

> 
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> 
> > Signed-off-by: Russell Currey <ruscur@russell.cc>
> > ---
> >   tools/docker/Dockerfile | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
> > index b9ecdb5..eef40e4 100644
> > --- a/tools/docker/Dockerfile
> > +++ b/tools/docker/Dockerfile
> > @@ -26,7 +26,7 @@ RUN apt-get update -qq && \
> >       python3.5-dev python3-pip python3-setuptools python3-wheel \
> >       python3.4-dev findutils=4.4.2-7 python3.6-dev \
> >       libmysqlclient-dev mysql-client curl unzip build-essential \
> > -    git postgresql-client tzdata
> > +    git postgresql-client tzdata libpq-dev
> >   
> >   # User
> >   RUN useradd --uid=$UID --create-home patchwork
> >
Daniel Axtens May 3, 2019, 6:14 a.m. UTC | #3
Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:

> On 1/5/19 2:35 pm, Russell Currey wrote:
>> psycopg2-binary fails if pg_config isn't installed, which is provided by
>> libpq-dev.
>> 
>> This seems strange to me since psycopg2-binary suggests that
>> you use psycopg2-binary instead (of itself) if you don't want to build
>> psycopg2 so you wouldn't need pg_config, which is very confusing.
>> 
>> It's possible that psycopg2-binary only needs to compile itself on
>> non-x86 platforms, since I hit this on ppc64le.
>> 
>> Anyway, it works when this is added.
>
> I don't think there is a binary psycopg2-binary build for anything other 
> than i686/x86_64?

Right, yeah that would probably explain it. Given that libpq-dev just
lives in the docker image, I don't think there's any harm here other
than a slightly larger download when doing your first image build. I
think we can live with that for cross-platform support.

Applied.

Daniel


>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
>
>> 
>> Signed-off-by: Russell Currey <ruscur@russell.cc>
>> ---
>>   tools/docker/Dockerfile | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
>> index b9ecdb5..eef40e4 100644
>> --- a/tools/docker/Dockerfile
>> +++ b/tools/docker/Dockerfile
>> @@ -26,7 +26,7 @@ RUN apt-get update -qq && \
>>       python3.5-dev python3-pip python3-setuptools python3-wheel \
>>       python3.4-dev findutils=4.4.2-7 python3.6-dev \
>>       libmysqlclient-dev mysql-client curl unzip build-essential \
>> -    git postgresql-client tzdata
>> +    git postgresql-client tzdata libpq-dev
>>   
>>   # User
>>   RUN useradd --uid=$UID --create-home patchwork
>> 
>
> -- 
> Andrew Donnellan              OzLabs, ADL Canberra
> andrew.donnellan@au1.ibm.com  IBM Australia Limited
>
> _______________________________________________
> Patchwork mailing list
> Patchwork@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork
Stephen Finucane May 3, 2019, 4:01 p.m. UTC | #4
On Fri, 2019-05-03 at 16:14 +1000, Daniel Axtens wrote:
> Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:
> 
> > On 1/5/19 2:35 pm, Russell Currey wrote:
> > > psycopg2-binary fails if pg_config isn't installed, which is provided by
> > > libpq-dev.
> > > 
> > > This seems strange to me since psycopg2-binary suggests that
> > > you use psycopg2-binary instead (of itself) if you don't want to build
> > > psycopg2 so you wouldn't need pg_config, which is very confusing.
> > > 
> > > It's possible that psycopg2-binary only needs to compile itself on
> > > non-x86 platforms, since I hit this on ppc64le.
> > > 
> > > Anyway, it works when this is added.
> > 
> > I don't think there is a binary psycopg2-binary build for anything other 
> > than i686/x86_64?
> 
> Right, yeah that would probably explain it. Given that libpq-dev just
> lives in the docker image, I don't think there's any harm here other
> than a slightly larger download when doing your first image build. I
> think we can live with that for cross-platform support.
> 
> Applied.

Given that we've done this, we should probably switch back to the non-
binary package since this isn't necessary now.

Stephen

> Daniel
> 
> 
> > Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> > 
> > > Signed-off-by: Russell Currey <ruscur@russell.cc>
> > > ---
> > >   tools/docker/Dockerfile | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
> > > index b9ecdb5..eef40e4 100644
> > > --- a/tools/docker/Dockerfile
> > > +++ b/tools/docker/Dockerfile
> > > @@ -26,7 +26,7 @@ RUN apt-get update -qq && \
> > >       python3.5-dev python3-pip python3-setuptools python3-wheel \
> > >       python3.4-dev findutils=4.4.2-7 python3.6-dev \
> > >       libmysqlclient-dev mysql-client curl unzip build-essential \
> > > -    git postgresql-client tzdata
> > > +    git postgresql-client tzdata libpq-dev
> > >   
> > >   # User
> > >   RUN useradd --uid=$UID --create-home patchwork
> > > 
> > 
> > -- 
> > Andrew Donnellan              OzLabs, ADL Canberra
> > andrew.donnellan@au1.ibm.com  IBM Australia Limited
> > 
> > _______________________________________________
> > Patchwork mailing list
> > Patchwork@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/patchwork
> _______________________________________________
> Patchwork mailing list
> Patchwork@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork
Daniel Axtens May 6, 2019, 12:18 a.m. UTC | #5
Stephen Finucane <stephen@that.guru> writes:

> On Fri, 2019-05-03 at 16:14 +1000, Daniel Axtens wrote:
>> Andrew Donnellan <andrew.donnellan@au1.ibm.com> writes:
>> 
>> > On 1/5/19 2:35 pm, Russell Currey wrote:
>> > > psycopg2-binary fails if pg_config isn't installed, which is provided by
>> > > libpq-dev.
>> > > 
>> > > This seems strange to me since psycopg2-binary suggests that
>> > > you use psycopg2-binary instead (of itself) if you don't want to build
>> > > psycopg2 so you wouldn't need pg_config, which is very confusing.
>> > > 
>> > > It's possible that psycopg2-binary only needs to compile itself on
>> > > non-x86 platforms, since I hit this on ppc64le.
>> > > 
>> > > Anyway, it works when this is added.
>> > 
>> > I don't think there is a binary psycopg2-binary build for anything other 
>> > than i686/x86_64?
>> 
>> Right, yeah that would probably explain it. Given that libpq-dev just
>> lives in the docker image, I don't think there's any harm here other
>> than a slightly larger download when doing your first image build. I
>> think we can live with that for cross-platform support.
>> 
>> Applied.
>
> Given that we've done this, we should probably switch back to the non-
> binary package since this isn't necessary now.

We use the binary package on x86, where it provides faster install times
(no compiling stuff from source); it's only on other platforms that we
need to do the compilation. Consider it a graceful fallback :)
>
> Stephen
>
>> Daniel
>> 
>> 
>> > Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
>> > 
>> > > Signed-off-by: Russell Currey <ruscur@russell.cc>
>> > > ---
>> > >   tools/docker/Dockerfile | 2 +-
>> > >   1 file changed, 1 insertion(+), 1 deletion(-)
>> > > 
>> > > diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
>> > > index b9ecdb5..eef40e4 100644
>> > > --- a/tools/docker/Dockerfile
>> > > +++ b/tools/docker/Dockerfile
>> > > @@ -26,7 +26,7 @@ RUN apt-get update -qq && \
>> > >       python3.5-dev python3-pip python3-setuptools python3-wheel \
>> > >       python3.4-dev findutils=4.4.2-7 python3.6-dev \
>> > >       libmysqlclient-dev mysql-client curl unzip build-essential \
>> > > -    git postgresql-client tzdata
>> > > +    git postgresql-client tzdata libpq-dev
>> > >   
>> > >   # User
>> > >   RUN useradd --uid=$UID --create-home patchwork
>> > > 
>> > 
>> > -- 
>> > Andrew Donnellan              OzLabs, ADL Canberra
>> > andrew.donnellan@au1.ibm.com  IBM Australia Limited
>> > 
>> > _______________________________________________
>> > Patchwork mailing list
>> > Patchwork@lists.ozlabs.org
>> > https://lists.ozlabs.org/listinfo/patchwork
>> _______________________________________________
>> Patchwork mailing list
>> Patchwork@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/patchwork
diff mbox series

Patch

diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index b9ecdb5..eef40e4 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -26,7 +26,7 @@  RUN apt-get update -qq && \
     python3.5-dev python3-pip python3-setuptools python3-wheel \
     python3.4-dev findutils=4.4.2-7 python3.6-dev \
     libmysqlclient-dev mysql-client curl unzip build-essential \
-    git postgresql-client tzdata
+    git postgresql-client tzdata libpq-dev
 
 # User
 RUN useradd --uid=$UID --create-home patchwork