Thread: Patches

Patches

From
Sandeep Thakkar
Date:
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

Re: Patches

From
Dave Page
Date:
Hi

On Thu, Jun 16, 2016 at 8:51 AM, Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
> 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:

My Mac is a fully patched El Capitan installation, and has Python
2.7.10. Why do you need Python 3 support for this build?

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Patches

From
Dave Page
Date:
On Thu, Jun 16, 2016 at 8:51 AM, Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
> 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.

Configuration and build fails for me with this:

Project MESSAGE: Building for QT5+...
Project MESSAGE: Configure pgAdmin4 to run in debug mode...
Project MESSAGE: Building for Linux/Mac...
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
Project MESSAGE: Python3 detected.

(pgadmin4)piranha:pgAdmin4 dpage$ which python-config
/usr/bin/python-config
(pgadmin4)piranha:pgAdmin4 dpage$ which python3-config
(pgadmin4)piranha:pgAdmin4 dpage$ locate python3-config
(pgadmin4)piranha:pgAdmin4 dpage$ python-config --libs
-lpython2.7 -ldl -framework CoreFoundation

Though - I also get some funky output without the patch (but, the
build succeeds):

Project MESSAGE: Building for QT5+...
Project MESSAGE: Configure pgAdmin4 to run in debug mode...
Project MESSAGE: Building for Linux/Mac...
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found


> 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. :)

This second patch breaks builds for me:

PYTHON_HOME not set. Setting it to default
QTDIR not set. Setting it to default
PGDIR not set. Setting it to default
Cleaning up the old environment and app bundle
Running virtualenv with interpreter
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 2311, in <module>
    main()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 703, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 916, in
create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1111,
in install_python
    copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 352, in copyfile
    copyfileordir(src, dest, symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 324, in
copyfileordir
    shutil.copytree(src, dest, symlink)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 208, in copytree
    raise Error, errors
shutil.Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c.in',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c.in',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c.in'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/install-sh',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/install-sh',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/install-sh'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.a',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.a',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.a'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.dylib',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.dylib'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Makefile',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Makefile'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/makesetup',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/makesetup',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/makesetup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/python.o',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/python.o',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/python.o'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.config',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.config',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.config'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.local',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.local',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.local'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config'")]
make: *** [appbundle] Error 1

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Patches

From
Sandeep Thakkar
Date:


On Thu, Jun 16, 2016 at 3:19 PM, Dave Page <dpage@pgadmin.org> wrote:
On Thu, Jun 16, 2016 at 8:51 AM, Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
> 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.

Configuration and build fails for me with this:

yeah, the 'contains' function is trying to match the whole string. Replacing that line in the patch with "contains( LIBS, -lpython2.* )" should work fine. 
 
Project MESSAGE: Building for QT5+...
Project MESSAGE: Configure pgAdmin4 to run in debug mode...
Project MESSAGE: Building for Linux/Mac...
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
Project MESSAGE: Python3 detected.

(pgadmin4)piranha:pgAdmin4 dpage$ which python-config
/usr/bin/python-config
(pgadmin4)piranha:pgAdmin4 dpage$ which python3-config
(pgadmin4)piranha:pgAdmin4 dpage$ locate python3-config
(pgadmin4)piranha:pgAdmin4 dpage$ python-config --libs
-lpython2.7 -ldl -framework CoreFoundation

Though - I also get some funky output without the patch (but, the
build succeeds):

Project MESSAGE: Building for QT5+...
Project MESSAGE: Configure pgAdmin4 to run in debug mode...
Project MESSAGE: Building for Linux/Mac...
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found


> 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. :)

This second patch breaks builds for me:

This is strange because I just added a new option "--always-copy" to virtualenv. What is your path to virtualenv? Could you please try running 'virtualenv -v  --always-copy -p /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2 /tmp/venv'
 
PYTHON_HOME not set. Setting it to default
QTDIR not set. Setting it to default
PGDIR not set. Setting it to default
Cleaning up the old environment and app bundle
Running virtualenv with interpreter
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 2311, in <module>
    main()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 703, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 916, in
create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1111,
in install_python
    copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 352, in copyfile
    copyfileordir(src, dest, symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 324, in
copyfileordir
    shutil.copytree(src, dest, symlink)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 208, in copytree
    raise Error, errors
shutil.Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c.in',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c.in',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/config.c.in'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/install-sh',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/install-sh',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/install-sh'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.a',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.a',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.a'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.dylib',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/libpython2.7.dylib'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Makefile',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Makefile'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/makesetup',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/makesetup',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/makesetup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/python.o',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/python.o',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/python.o'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.config',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.config',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.config'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.local',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.local',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config/Setup.local'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config',
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config',
"[Errno 1] Operation not permitted:
'/Users/dpage/git/pgadmin4/mac-build/venv/lib/python2.7/config'")]
make: *** [appbundle] Error 1

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Sandeep Thakkar

Re: Patches

From
Dave Page
Date:
On Thu, Jun 16, 2016 at 11:40 AM, Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
>
>
>> > I have attached the patch (pgadminpro.patch) to fix this.
>>
>> Configuration and build fails for me with this:
>>
> yeah, the 'contains' function is trying to match the whole string. Replacing
> that line in the patch with "contains( LIBS, -lpython2.* )" should work
> fine.

Nope - it looks like it's messing up the detection of python-config
vs. python3-config. I'm beginning to think it only worked before
because of the -lpython2.7 line you (quite rightly) removed. With the
attached version of the patch, I get this output:

Project MESSAGE: Building for QT5+...
Project MESSAGE: Configure pgAdmin4 to run in debug mode...
Project MESSAGE: Building for Linux/Mac...
Project MESSAGE: Using python3-config
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
Project MESSAGE: Python3 detected.


>> This second patch breaks builds for me:
>>
> This is strange because I just added a new option "--always-copy" to
> virtualenv. What is your path to virtualenv? Could you please try running
> 'virtualenv -v  --always-copy -p
> /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
> /tmp/venv'

(pgadmin4)piranha:pgAdmin4 dpage$ virtualenv -v  --always-copy -p
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
/tmp/venv
Running virtualenv with interpreter
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
Creating /tmp/venv/lib/python2.7
Symlinking Python bootstrap modules
  Copying to /tmp/venv/lib/python2.7/config
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 2311, in <module>
    main()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 703, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 916, in
create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1111,
in install_python
    copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 352, in copyfile
    copyfileordir(src, dest, symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 324, in
copyfileordir
    shutil.copytree(src, dest, symlink)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 208, in copytree
    raise Error, errors
shutil.Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c',
'/tmp/venv/lib/python2.7/config/config.c', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/config.c'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c.in',
'/tmp/venv/lib/python2.7/config/config.c.in', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/config.c.in'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/install-sh',
'/tmp/venv/lib/python2.7/config/install-sh', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/install-sh'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.a',
'/tmp/venv/lib/python2.7/config/libpython2.7.a', "[Errno 1] Operation
not permitted: '/tmp/venv/lib/python2.7/config/libpython2.7.a'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib',
'/tmp/venv/lib/python2.7/config/libpython2.7.dylib', "[Errno 1]
Operation not permitted:
'/tmp/venv/lib/python2.7/config/libpython2.7.dylib'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile',
'/tmp/venv/lib/python2.7/config/Makefile', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/Makefile'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/makesetup',
'/tmp/venv/lib/python2.7/config/makesetup', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/makesetup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/python.o',
'/tmp/venv/lib/python2.7/config/python.o', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/python.o'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup',
'/tmp/venv/lib/python2.7/config/Setup', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/Setup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.config',
'/tmp/venv/lib/python2.7/config/Setup.config', "[Errno 1] Operation
not permitted: '/tmp/venv/lib/python2.7/config/Setup.config'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.local',
'/tmp/venv/lib/python2.7/config/Setup.local', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/Setup.local'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config',
'/tmp/venv/lib/python2.7/config', "[Errno 1] Operation not permitted:
'/tmp/venv/lib/python2.7/config'")]

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

Re: Patches

From
Sandeep Thakkar
Date:


On Thu, Jun 16, 2016 at 7:04 PM, Dave Page <dpage@pgadmin.org> wrote:
On Thu, Jun 16, 2016 at 11:40 AM, Sandeep Thakkar
<sandeep.thakkar@enterprisedb.com> wrote:
>
>
>> > I have attached the patch (pgadminpro.patch) to fix this.
>>
>> Configuration and build fails for me with this:
>>
> yeah, the 'contains' function is trying to match the whole string. Replacing
> that line in the patch with "contains( LIBS, -lpython2.* )" should work
> fine.

Nope - it looks like it's messing up the detection of python-config
vs. python3-config. I'm beginning to think it only worked before
because of the -lpython2.7 line you (quite rightly) removed. With the
attached version of the patch, I get this output:

Project MESSAGE: Building for QT5+...
Project MESSAGE: Configure pgAdmin4 to run in debug mode...
Project MESSAGE: Building for Linux/Mac...
Project MESSAGE: Using python3-config
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
/bin/sh: python3-config: command not found
Project MESSAGE: Python3 detected.

Interesting. It seems the system command in the pro file "!system(which python3-config > /dev/null 2>&1) {" is itself not working at your end. As you mentioned earlier python3-config does not exist in your path and so `which python3-config` should not return anything. But as per the above output, it seems it is trying to execute python3-config and hence we can see command not found error. and therefore it goes in else and printing message(Using python3-config).. I'm not sure what is wrong.


>> This second patch breaks builds for me:
>>
> This is strange because I just added a new option "--always-copy" to
> virtualenv. What is your path to virtualenv? Could you please try running
> 'virtualenv -v  --always-copy -p
> /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
> /tmp/venv'

Hmm.. so, the virtualenv on your mac is not working with "--always-copy" option. I will check again if we still need it (for Python3).
 
(pgadmin4)piranha:pgAdmin4 dpage$ virtualenv -v  --always-copy -p
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
/tmp/venv
Running virtualenv with interpreter
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
Creating /tmp/venv/lib/python2.7
Symlinking Python bootstrap modules
  Copying to /tmp/venv/lib/python2.7/config
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 2311, in <module>
    main()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 703, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 916, in
create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1111,
in install_python
    copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 352, in copyfile
    copyfileordir(src, dest, symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 324, in
copyfileordir
    shutil.copytree(src, dest, symlink)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 208, in copytree
    raise Error, errors
shutil.Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c',
'/tmp/venv/lib/python2.7/config/config.c', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/config.c'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/config.c.in',
'/tmp/venv/lib/python2.7/config/config.c.in', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/config.c.in'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/install-sh',
'/tmp/venv/lib/python2.7/config/install-sh', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/install-sh'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.a',
'/tmp/venv/lib/python2.7/config/libpython2.7.a', "[Errno 1] Operation
not permitted: '/tmp/venv/lib/python2.7/config/libpython2.7.a'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib',
'/tmp/venv/lib/python2.7/config/libpython2.7.dylib', "[Errno 1]
Operation not permitted:
'/tmp/venv/lib/python2.7/config/libpython2.7.dylib'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile',
'/tmp/venv/lib/python2.7/config/Makefile', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/Makefile'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/makesetup',
'/tmp/venv/lib/python2.7/config/makesetup', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/makesetup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/python.o',
'/tmp/venv/lib/python2.7/config/python.o', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/python.o'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup',
'/tmp/venv/lib/python2.7/config/Setup', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/Setup'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.config',
'/tmp/venv/lib/python2.7/config/Setup.config', "[Errno 1] Operation
not permitted: '/tmp/venv/lib/python2.7/config/Setup.config'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Setup.local',
'/tmp/venv/lib/python2.7/config/Setup.local', "[Errno 1] Operation not
permitted: '/tmp/venv/lib/python2.7/config/Setup.local'"),
('/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config',
'/tmp/venv/lib/python2.7/config', "[Errno 1] Operation not permitted:
'/tmp/venv/lib/python2.7/config'")]

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Sandeep Thakkar