Cygwin support

328 views
Skip to first unread message

David Dengg

unread,
Sep 23, 2015, 11:10:04 AM9/23/15
to gyp-developer
Hello,

I am trying to port our build infrastructure to windows and I am struggling to get gyp to work under cygwin:

$ GYP_DEFINES="OS=android" deps/gyp/gyp anycmd.gyp --depth=. -f ninja-android
Traceback (most recent call last):
  File "deps/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "deps/gyp/pylib/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "deps/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "deps/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "deps/gyp/pylib/gyp/generator/ninja.py", line 2386, in GenerateOutput
    pool.map(CallGenerateOutputForConfig, arglists)
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
AttributeError: 'module' object has no attribute 'windll'

It seems windll is not available in cygwin:

$ python -c "from ctypes import *; print cdll; print windll;"
<ctypes.LibraryLoader object at 0x7fdc57ac>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'windll' is not defined

I found a thread discussing leaving cygwin behind for chromium. Is cygwin not supported any more?

Thanks

Dirk Pranke

unread,
Sep 23, 2015, 1:13:58 PM9/23/15
to David Dengg, gyp-developer
I don't think we put any effort into making gyp work under cygwin these days,
but we'd accept patches if you wanted to work on it.

There's probably some bug somewhere that is treating cygwin like win32 and
trying to import the windows python libraries.

I suspect that multiprocessing doesn't work well under cygwin at all, so you'd
probably be better off trying to turn off the multiprocessing in gyp if you need 
to keep cygwin working.

-- Dirk

--

---
You received this message because you are subscribed to the Google Groups "gyp-developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gyp-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Dengg

unread,
Sep 24, 2015, 8:59:25 AM9/24/15
to gyp-developer, david...@gmail.com
The call to windll is based on this decision in GetDefaultConcurrentLinks:

if sys.platform in ('win32', 'cygwin'):

That looks like windll was supported at some time in the past. 

A simple if a few lines below fixes the problem.

    if sys.platform == 'cygwin':
    ctypes.cdll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
    else:
    ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))


My solution will be to use GYP_LINK_CONCURRENCY which shortcuts GetDefaultConcurrentLinks and thus prevents the call to windll. That will do for me.

Thanks
Reply all
Reply to author
Forward
0 new messages