Solution: How to make the python pgxnclient work on Windows

811 views
Skip to first unread message

Andre Mikulec

unread,
Oct 30, 2016, 4:22:43 PM10/30/16
to PGXN Users
To make it work on Windows, do the following.

Prepare to make changes to the source code of the python client pgxnclient-1.2.1.

In the file
pgxnclient-1.2.1\pgxnclient-1.2.1\pgxnclient\cli.py
change this line

from ( line 114 )

    os.execv(argv[0], argv)

to ( new lines at 114+ )

    import platform
    if platform.system() == 'Windows':
        #
        # On Windows, the [Popen] class uses the Windows CreateProcess() function.
        #
        # If env is not None, it must be a mapping that defines the environment variables 
        # for the new process; these are used instead of the default behavior of 
        # inheriting the current process’ environment.
        # 
        # 
        # os.exec on Windows
        #
        # sys.executable: get current /path/to/python.exe that is being used
        # 
        import subprocess
        all_argv = [sys.executable] + argv
        subprocess.call(all_argv) 
    else:
        os.execv(argv[0], argv)

In this file
pgxnclient-1.2.1\pgxnclient-1.2.1\pgxnclient\commands\__init__.py
change

from

        subp.add_argument('--pg_config', metavar="PROG", default='pg_config',
            help = _("the pg_config executable to find the database"
                " [default: %(default)s]"))


to
        import platform
        if platform.system() == 'Windows':
          subp.add_argument('--pg_config', metavar="PROG", default='pg_config.exe',
              help = _("the pg_config executable to find the database"
                  " [default: %(default)s]"))
        else:
          subp.add_argument('--pg_config', metavar="PROG", default='pg_config',
              help = _("the pg_config executable to find the database"
                  " [default: %(default)s]"))


Also, In this same file
pgxnclient-1.2.1\pgxnclient-1.2.1\pgxnclient\commands\__init__.py
change

from

    def _find_default_make(self):
        
        for make in ('gmake', 'make'):
            path = find_executable(make)
            if path:
                return make

to

    def _find_default_make(self):
        
        import platform
        if platform.system() == 'Windows':
          for make in ('gmake.exe', 'make.exe'):
              path = find_executable(make)
              if path:
                  return make
        else:
          for make in ('gmake', 'make'):
              path = find_executable(make)
              if path:
                  return make

That works with the following caveats.

This is my working environment.

1. Only working in MSYS ( not the windows command shell. )

2. Only working with a path that looks like this.

$  echo $PATH
/c/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3:/c/EnterpriseDB/LanguagePack/9.5/x64/Python-3.3/Scripts:/c/MinGW/msys/1.0/local/pgsql_0ab9c56_debug/bin:.:/usr/local/bin:/mingw/bin:/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/Sys
tem32/WindowsPowerShell/v1.0/

3. Fulling testing that my pg_config produces the correct output 
 a. right facing slashes n MSYS
 b. correct paths

before starting.  For example mine looks like. 

$  pg_config
BINDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/bin
DOCDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/share/doc
HTMLDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/share/doc
INCLUDEDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/include
PKGINCLUDEDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/include
INCLUDEDIR-SERVER = c:/MinGW/msys/1.0/local/PGSQL_~4/include/server
LIBDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/lib
PKGLIBDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/lib
LOCALEDIR = c:/MinGW/msys/1.0/local/pgsql_0ab9c56_debug/share/locale
MANDIR = c:/MinGW/msys/1.0/local/pgsql_0ab9c56_debug/share/man
SHAREDIR = c:/MinGW/msys/1.0/local/PGSQL_~4/share
SYSCONFDIR = c:/MinGW/msys/1.0/local/pgsql_0ab9c56_debug/etc
PGXS = c:/MinGW/msys/1.0/local/PGSQL_~4/lib/pgxs/src/MAKEFI~1/pgxs.mk
CONFIGURE = '--with-tcl' '--with-python' '--with-perl' '--with-includes=/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/include' '--with-libraries=/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/lib' '--host=x86_64-w64-mingw32' '--prefix
=/usr/local/pgsql_0ab9c56_debug' '--disable-rpath' '--enable-depend' '--enable-cassert' '--enable-debug' '--with-extra-version=_CFLAGS_O_0ab9c56' 'CFLAGS=-O -fno-omit-frame-pointer' 'host_alias=x86_64-w64-mingw32'
CC = x86_64-w64-mingw32-gcc
CPPFLAGS = -DFRONTEND -I./src/include/port/win32 -DEXEC_BACKEND -I/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/include -I../../src/include/port/win32 -DBUILDING_DLL
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O -fno-omit-frame-pointer
CFLAGS_SL =
LDFLAGS = -L../../src/common -Wl,--allow-multiple-definition -Wl,--disable-auto-import -L/c/Users/TargetUser/Documents/zlib-1.2.8-win32-x86_64/lib -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lz -lws2_32 -lm  -lws2_32
VERSION = PostgreSQL 10devel_CFLAGS_O_0ab9c56

4. if the source Makefile contains the word: $(PG_CONFIG),
and upon each run of the make on the Makefile that goes through that region,
the case seem that the following error is produced.

/bin/sh: c:MinGWmsys1.0localpgsql_0ab9c56_debugbinpg_config.exe: command not found

The working solution is protect $(PG_CONFIG) by putting double quotes around it.

So this  $(PG_CONFIG)
becomes "$(PG_CONFIG)"

For example

change

PG91         = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no || echo yes)
and
PGXS := $(shell "$(PG_CONFIG)" --pgxs)

to

PG91         = $(shell "$(PG_CONFIG)" --version | grep -qE " 8\.| 9\.0" && echo no || echo yes)
and
PGXS := $(shell "$(PG_CONFIG)" --pgxs)


The way to do this is to intercept the Makefile before it gets 'read and ran' by make.

In the code, place a python breakpoint, perhaps, just before 
the runtime call to Popen.
The information below shows how to do that.

In the file
pgxnclient-1.2.1\pgxnclient\commands\__init__.py
in the implementation of
   
def popen(self, cmd, *args, **kwargs):

and just before the 'return Popen(cmd, *args, **kwargs)

Change from

return Popen(cmd, *args, **kwargs)

to

import pdb; pdb.set_trace()
Popen(cmd, *args, **kwargs)

Now all code changes are now done.

Now install ( or re-install ) the python client pgxnclient-1.2.1

python setup.py install

To see the path to the Makefile run in verbose mode

$ pgxn install pair --verbose

The python program will pause at the breakpoint

(Pdb)

Look at the screen for the output of the line that has the path to the Makefile.

It looks something like this.

c:\users\target~1\appdata\local\temp\tmp6d0lpe\pair-0.1.5\Makefile

In Notpad++ or a similar editor, open the Makefile, and prepare to edit it. 

For example, open the pair extension 'temporory' Makefile

c:\users\target~1\appdata\local\temp\tmp6d0lpe\pair-0.1.5\Makefile

then make the changes in the Makefile.

Change these

PG91         = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no || echo yes)
and
PGXS := $(shell "$(PG_CONFIG)" --pgxs)

to these

PG91         = $(shell "$(PG_CONFIG)" --version | grep -qE " 8\.| 9\.0" && echo no || echo yes)
and
PGXS := $(shell "$(PG_CONFIG)" --pgxs)

In Notepad++, press Save.

Press 'c' to continue
(Pdb) c

Everytime the program pauses, press 'c' again until the install finishes.
(Pdb) c

Note, not 'all' pgxn Makefiles contain $(PG_CONFIG),
for example 'quantile' does not.


Here is my quantile pgxn extension installation on windows.
(Note, this is  much more than --verbose and python breakpoints will show.
I have much extra debugging print statements and many more python breakpoints)



Targetuser@TARGETMACH /c/Users/Targetuser/Downloads/pgxnclient-1.2.1
$
$ pgxn install quantile --verbose

ArgumentParser(prog='pgxn', usage=None, description='Interact with the PostgreSQL Extension Network (PGXN).', version=None, formatter_class=<class 'pgxnclient.utils.argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
Namespace(cmd=<class 'pgxnclient.commands.install.Install'>, make='make.exe', mirror='http://api.pgxn.org/', pg_config='pg_config.exe', spec='quantile', status=2, sudo=None, verbose=True, yes=False)
> c:\enterprisedb\languagepack\9.5\x64\python-3.3\lib\site-packages\pgxnclient-1.2.1-py3.3.egg\pgxnclient\commands\__init__.py(95)run_command()
-> logging.getLogger().setLevel(
(Pdb) c
DEBUG: running pg_config --libdir
> c:\enterprisedb\languagepack\9.5\x64\python-3.3\lib\site-packages\pgxnclient-1.2.1-py3.3.egg\pgxnclient\commands\__init__.py(219)popen()
-> logger.debug("running command: %s", cmd)
(Pdb) c
DEBUG: running command: ['c:\\MinGW\\msys\\1.0\\local\\pgsql_0ab9c56_debug\\bin\\pg_config.exe', '--libdir']
()
{'stdout': -1}
<subprocess.Popen object at 0x0000000002E2EDD8>
DEBUG: testing if c:/MinGW/msys/1.0/local/PGSQL_~4/lib is writable
DEBUG: opening url: http://api.pgxn.org/index.json
INFO: best version: quantile 1.1.5
INFO: saving c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5.zip
DEBUG: checking sha1 of 'c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5.zip'
INFO: unpacking: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5.zip
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\.gitignore
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\LICENSE
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\META.json
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\Makefile
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\README.md
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\quantile.control
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\sql\quantile--1.1.4--1.1.5.sql
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\sql\quantile--1.1.5.sql
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\src\quantile.c
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\test\expected\base.out
DEBUG: saving: c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\test\sql\base.sql
Namespace(cmd=<class 'pgxnclient.commands.install.Install'>, make='make.exe', mirror='http://api.pgxn.org/', pg_config='pg_config.exe', spec='quantile', status=2, sudo=None, target='c:\\users\\target~1\\appdata\\local\\temp\\tmpnb776o', verbose=True, yes=
False)
> c:\enterprisedb\languagepack\9.5\x64\python-3.3\lib\site-packages\pgxnclient-1.2.1-py3.3.egg\pgxnclient\commands\install.py(125)maybe_run_configure()
-> fn = os.path.join(dir, 'configure')
(Pdb) c
DEBUG: checking 'c:\users\target~1\appdata\local\temp\tmpnb776o\quantile-1.1.5\configure'
INFO: building extension
DEBUG: running: ['make.exe', 'PG_CONFIG=c:\\MinGW\\msys\\1.0\\local\\pgsql_0ab9c56_debug\\bin\\pg_config.exe', 'all']
> c:\enterprisedb\languagepack\9.5\x64\python-3.3\lib\site-packages\pgxnclient-1.2.1-py3.3.egg\pgxnclient\commands\__init__.py(219)popen()
-> logger.debug("running command: %s", cmd)
(Pdb) c
DEBUG: running command: ['make.exe', 'PG_CONFIG=c:\\MinGW\\msys\\1.0\\local\\pgsql_0ab9c56_debug\\bin\\pg_config.exe', 'all']
()
{'close_fds': True, 'env': None, 'cwd': 'c:\\users\\target~1\\appdata\\local\\temp\\tmpnb776o\\quantile-1.1.5', 'shell': False}
<subprocess.Popen object at 0x0000000002D8BF28>
x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O -fno-omit-frame-pointer   -I. -I./ -
IC:/MinGW/msys/1.0/local/PGSQL_~4/include/server -IC:/MinGW/msys/1.0/local/PGSQL_~4/include/internal -I./src/include/port/win32 -DEXEC_BACKEND  -I/c/Users/Targetuser/Documents/zlib-1.2.8-win32-x86_64/include -IC:/MinGW/msys/1.0/local/PGSQL_~4/include/s
erver/port/win32  -c -o src/quantile.o src/quantile.c -MMD -MP -MF .deps/quantile.Po
x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O -fno-omit-frame-pointer    -shared -
static-libgcc -o quantile.dll  src/quantile.o -LC:/MinGW/msys/1.0/local/PGSQL_~4/lib -Wl,--allow-multiple-definition -Wl,--disable-auto-import  -L/c/Users/Targetuser/Documents/zlib-1.2.8-win32-x86_64/lib -Wl,--as-needed  -LC:/MinGW/msys/1.0/local/PGSQL
_~4/lib -lpostgres -lpgcommon -lpgport -lz -lws2_32 -lm  -lws2_32 -Wl,--export-all-symbols -Wl,--out-implib=libquantile.a
INFO: installing extension
DEBUG: testing if c:/MinGW/msys/1.0/local/PGSQL_~4/lib is writable
DEBUG: running: ['make.exe', 'PG_CONFIG=c:\\MinGW\\msys\\1.0\\local\\pgsql_0ab9c56_debug\\bin\\pg_config.exe', 'install']
 c:\enterprisedb\languagepack\9.5\x64\python-3.3\lib\site-packages\pgxnclient-1.2.1-py3.3.egg\pgxnclient\commands\__init__.py(219)popen()
> logger.debug("running command: %s", cmd)
Pdb) c
EBUG: running command: ['make.exe', 'PG_CONFIG=c:\\MinGW\\msys\\1.0\\local\\pgsql_0ab9c56_debug\\bin\\pg_config.exe', 'install']
)
'close_fds': True, 'env': None, 'cwd': 'c:\\users\\target~1\\appdata\\local\\temp\\tmpnb776o\\quantile-1.1.5', 'shell': False}<subprocess.Popen object at 0x0000000002EC9160>
/bin/mkdir -p 'C:/MinGW/msys/1.0/local/PGSQL_~4/lib'
/bin/mkdir -p 'C:/MinGW/msys/1.0/local/PGSQL_~4/share/extension'
/bin/mkdir -p 'C:/MinGW/msys/1.0/local/PGSQL_~4/share/extension'
/bin/mkdir -p 'C:/MinGW/msys/1.0/local/PGSQL_~4/lib'
/bin/install -c -m 755  quantile.dll 'C:/MinGW/msys/1.0/local/PGSQL_~4/lib/quantile.dll'
/bin/install -c -m 644 .//quantile.control 'C:/MinGW/msys/1.0/local/PGSQL_~4/share/extension/'
/bin/install -c -m 644 .//sql/quantile--1.1.5.sql .//sql/quantile--1.1.4--1.1.5.sql  'C:/MinGW/msys/1.0/local/PGSQL_~4/share/extension/'
/bin/install -c -m 755  quantile.dll 'C:/MinGW/msys/1.0/local/PGSQL_~4/lib/'

Targetuser@TARGETMACH /c/Users/Targetuser/Downloads/pgxnclient-1.2.1
$


Andre Mikulec
Andre_...@Hotmail.com

Jim Nasby

unread,
Oct 30, 2016, 5:25:39 PM10/30/16
to pgxn-...@googlegroups.com, Tomas Vondra
On 10/30/16 3:22 PM, Andre Mikulec wrote:
...

Wow, great work on all of this!

> 4. if the source Makefile contains the word: $(PG_CONFIG),
> and upon each run of the make on the Makefile that goes through that region,
> the case seem that the following error is produced.

There's actually a lot more that could fail, besides just $(PG_CONFIG).
I'm pretty sure that anything based on my pgxntool framework would fail
spectacularly.

The big problem (IHMO) is that almost no one who's developing extensions
is even thinking about Windows, and even fewer have read access to a
windows environment. If there was some kind of resource available for
testing on windows (like if Travis-CI had windows support) we'd be in a
much better position. Do you by chance have a windows machine where you
could give extension developers user accounts for testing?

Another possibility would be to add Windows to http://pgxn-tester.org/,
but I don't think that would help much because (currently) the only way
to get tests run there is to publish your distribution, which doesn't
really work for speculative testing (not to mention it's a bit of a
painful process to do so, at least compared to the simple `git push` you
need for Travis-CI). I'm not sure if there's a good way to fix that...
pgxn-tester could be modified to also pick up github changes (like
Travis does), but I'd wager that'd be a pretty significant change.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461

Andre Mikulec

unread,
Oct 30, 2016, 6:26:48 PM10/30/16
to PGXN Users
Jim,

I do not have a Windows machine available.  I wish that I did.  

I am currently, putting some of those 'changes for Windows' in a github pull request meant for https://github.com/dvarrazzo/pgxnclient.

Hopefully some Windows users will come by and find the python pgxn client to be useful.

Andre Mikulec

unread,
Oct 30, 2016, 7:07:13 PM10/30/16
to PGXN Users

I created a Pull request.

Solution: How to make the python pgxnclient work on Windows #27


Also, I mean to say (below)

Change from

return Popen(cmd, *args, **kwargs)

to

import pdb; pdb.set_trace()
return Popen(cmd, *args, **kwargs)   # Returns ...


On Sunday, October 30, 2016 at 3:22:43 PM UTC-5, Andre Mikulec wrote:

Jim Nasby

unread,
Oct 31, 2016, 8:51:03 AM10/31/16
to pgxn-...@googlegroups.com
On 10/30/16 3:22 PM, Andre Mikulec wrote:
>
> In the code, place a python breakpoint, perhaps, just before
> the runtime call to Popen.
> The information below shows how to do that.

Instead of forcing the user to do that by hand, why not just have python
process the Makefile? Something like

old = line from Makefile...

new=re.subn('(?<!")(\$\(PG_CONFIG\)(?!"))', lambda m: '"' + m.group(0) +
'"', old )
if (new[1] > 0):
out += '# Replaced %s occurance%s of $(PG_CONFIG) with
"$(PG_CONFIG)"\n' % (new[1], '' if new[1] == 1 else 's')
out += '# original line:\n' + old + '\n'
out += new[0] + '\n'

There's probably more elegant ways to handle this than line-by-line...

Anyway, I'd have that replacement run in all cases, and also spit out
warnings to the console so that people can fix their Makefiles.

Andre Mikulec

unread,
Oct 31, 2016, 10:09:07 PM10/31/16
to PGXN Users
O.K., 

Yes, 

Jim, I integrated your code.

I barely know python, so please bear with me.

The below code does the following.

As soon as a makefile is found and the OS is Windows, copy the original file for safekeeping.
Next, replace the original file contents with 'better' PG_CONFIG contents.

Here is what I have so far.
I am not a Python guy, so if you see something then shout it out.

I have not yet integrated it into the 'real' code, nor tested it yet.

IN
C:\MinGW\msys\1.0\local\pgxnclient-1.2.1\pgxnclient\commands\__init__.py

REPLACE THIS (in 'def run_make') ( CaSe IN-SeNsiTive )

            if os.path.exists(os.path.join(dir, fn)):

WITH THIS ( CaSe SeNsiTive )

            if fn in in os.listdir(dir):          # CaSe SeNsiTive
                if platform.system() == 'Windows':
                    path = os.path.join(dir, fn)
                    import shutil
                    shutil.copyfile(path, path + '.ORIG') # save 
                    new_all = [] # all lines
                    with open(path + '.ORIG') as f:       # read the copy
                        lines = f.read().splitlines()
                        for line in lines:
                            old = line # old line
                            new=re.subn('(?<!")(\$\(PG_CONFIG\)(?!"))', lambda m: '"' + m.group(0) + '"', old ) 
                            if (new[1] > 0): 
                                out += '# Replaced %s occurance%s of $(PG_CONFIG) with "$(PG_CONFIG)"\n' % (new[1], '' if new[1] == 1 else 's') 
                                out += '# original line:\n' + old + '\n' 
                                out += new[0] + '\n' 
                                print(out)
                                new_all.extend(new)
                            else:
                                new_all.extend(old)
                    with open(path,'w+') as f:           # overwrite the original
                        f.writelines(new_all)
                        f.flush()
                    os.fsync()



On Sunday, October 30, 2016 at 3:22:43 PM UTC-5, Andre Mikulec wrote:

Jim Nasby

unread,
Nov 2, 2016, 2:59:36 PM11/2/16
to pgxn-...@googlegroups.com
On 10/31/16 9:09 PM, Andre Mikulec wrote:
> out += '# Replaced %s occurance%s of
> $(PG_CONFIG) with "$(PG_CONFIG)"\n' % (new[1], '' if new[1] == 1 else 's')

^ That should be just out =
> out += '# original line:\n' + old + '\n'
> out += new[0] + '\n'
> print(out)
> new_all.extend(new)

should be extend(out). new is a two-element tuple of (new text, number
of replacements made).

Andre Mikulec

unread,
Nov 4, 2016, 6:53:12 AM11/4/16
to PGXN Users

Jim,

I ended up doing the following.

C:\MinGW\msys\1.0\local\pgxnclient-1.2.1\pgxnclient\commands\__init__.py
IN THIS
    def run_make(self, cmd, dir, env=None, sudo=None):

REPLACED THIS
        cmdline.extend([self.get_make(), 'PG_CONFIG=%s' % self.get_pg_config()])
 
WITH THIS

        import platform
        if platform.system() == 'Windows':
            # remove colons ':'
            # if a character exists at the beginning and if it is upper case, then make it lowercase
            # append a backslash '/' to the beginning of the line
            # replace occurances of '\\' with '/' 
            import re
            new_pg_config = ('/' + re.sub("^[A-Z]", lambda m: m.group(0).lower(),self.get_pg_config().replace(":",""))).replace("\\","/")
            cmdline.extend([self.get_make(), 'PG_CONFIG=%s' % new_pg_config])
        else:
            cmdline.extend([self.get_make(), 'PG_CONFIG=%s' % self.get_pg_config()])

I ALSO DID THIS

C:\MinGW\msys\1.0\local\pgxnclient-1.2.1\pgxnclient\commands\__init__.py
IN THIS
    def popen(self, cmd, *args, **kwargs):

REPLACED THIS

            return Popen(cmd, *args, **kwargs)

WITH THIS

            import platform
            if platform.system() == 'Windows':
                import re
                if isinstance(cmd, (list, tuple)):
                    if re.search('configure$', cmd[0]):
                        cmd[0] = 'sh ./configure'
                if isinstance(cmd, str):
                    if re.search('configure$', cmd):
                        cmd = 'sh ./configure'
            else:
                cmd = cmd

            return Popen(cmd, *args, **kwargs)

            
I updated the pull request. I wrote an expanation.




On Sunday, October 30, 2016 at 3:22:43 PM UTC-5, Andre Mikulec wrote:
Reply all
Reply to author
Forward
0 new messages