Patches - Mailing list pgadmin-hackers

From Sandeep Thakkar
Subject Patches
Date
Msg-id CANFyU97JuuR=DsXQXNY_a=hTh0+5kbJyJthZxKJbaFP09iXsTw@mail.gmail.com
Whole thread Raw
Responses Re: Patches  (Dave Page <dpage@pgadmin.org>)
Re: Patches  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
Hi,

I created virtual environment and tried building pgadmin on my Mac with Python 3.3 and QT 5.5. I observed that in venv, the python3-config is copied as python-config. Therefore, it's required to change pgAdmin4.pro to handle this. With the existing .pro, it does not find the python3-config and assumes it is Python2 and throws the following build error:
--
Server.cpp:36:5: error: no matching function for call to 'Py_SetProgramName'  Py_SetProgramName(PGA_APP_NAME.toUtf8().data());

/mnt/hgfs/pginstaller.pune/server/source/pgadmin.osx/mac-build/venv/include/python3.3m/pythonrun.h:25:18: note: candidate function not viable: no known conversion from 'char *' to 'wchar_t *' for 1st

      argument

PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);

--

I have attached the patch (pgadminpro.patch) to fix this.

Another thing i observed is that in venv, the encodings directory in sym linked to the actual one on the system and hence the build fails with the following error:
--
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
--

I have attached the patch (pgadmin-macbuild.patch) to make sure the virtualenv for macbuild copies the required files instead of linking. In the same patch, I also modified the build script to not rename the actual directory of python in venv (as python libs may refer the actual directory) and instead create a sym link. There might be other way to fix this, but I found this to be easy. :)

Thanks!


--
Sandeep Thakkar
Attachment

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Patch for pgAdmin 4 docs
Next
From: Dave Page
Date:
Subject: pgAdmin 4 commit: Add files missed from previous commit.