Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPackages.gyp: add Xcode 10 support #48737

Closed
wants to merge 1 commit into from

Conversation

uri-canva
Copy link
Contributor

@uri-canva uri-canva commented Oct 20, 2018

Motivation for this change

Attempting to use it with Xcode 10 installed results in this:

Traceback (most recent call last):
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/bin/.gyp-wrapped", line 12, in <module>
    sys.exit(script_main())
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/generator/make.py", line 2159, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/generator/make.py", line 795, in Write
creating build/bdist.macosx-10.10-x86_64/wheel/hypothesis-3.66.2.dist-info/WHEEL
    self.Pchify))
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/generator/make.py", line 1190, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/xcode_emulation.py", line 545, in GetCflags
    archs = self.GetActiveArchs(self.configname)
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/xcode_emulation.py", line 420, in GetActiveArchs
    xcode_archs_default = GetXcodeArchsDefault()
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File "/nix/store/kz342hyzg84cakgh2iraz85c2xv6wn8z-python2.7-gyp-2015-06-11/lib/python2.7/site-packages/gyp/xcode_emulation.py", line 1240, in XcodeVersion
    version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'

The fix is updating the regex to handle version numbers with multiple digits.

This is fixed in the nodejs fork of gyp (nodejs/node-gyp#1454) but it's not fixed upstream, even on latest master. Given that upstream gyp is pretty much abandoned since the chromium project switched to GN, it might be worth switching to use the nodejs fork.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@uri-canva
Copy link
Contributor Author

cc @codyopel

@uri-canva
Copy link
Contributor Author

ping @FRidh

@uri-canva uri-canva closed this Jun 24, 2019
@uri-canva uri-canva deleted the gyp-xcode-10-no-upgrade branch June 24, 2019 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants