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

fix: Making ninja output on windows to work #1121

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions 0005-ninja-make-ninja-work-on-windows-again.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 06cea25b3af096b7fe82c25cc06ecba808ba9765 Mon Sep 17 00:00:00 2001
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this file i believe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not doing that anymore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind, i thought this was added accidentally.

From: Refael Ackermann <me@refack.com>
Date: Wed, 15 Feb 2017 17:29:32 -0500
Subject: [PATCH] ninja: make ninja work on windows again

---
gyp/pylib/gyp/generator/ninja.py | 2 ++
gyp/pylib/gyp/msvs_emulation.py | 1 +
2 files changed, 3 insertions(+)

diff --git a/gyp/pylib/gyp/generator/ninja.py b/gyp/pylib/gyp/generator/ninja.py
index 841067e..fd8ae0f 100644
--- a/gyp/pylib/gyp/generator/ninja.py
+++ b/gyp/pylib/gyp/generator/ninja.py
@@ -333,6 +333,8 @@ class NinjaWriter(object):
obj += '.' + self.toolset

path_dir, path_basename = os.path.split(path)
+ if os.path.isabs(path_dir):
+ path_dir = os.path.relpath(path_dir, self.abs_build_dir)
assert not os.path.isabs(path_dir), (
"'%s' can not be absolute path (see crbug.com/462153)." % path_dir)

diff --git a/gyp/pylib/gyp/msvs_emulation.py b/gyp/pylib/gyp/msvs_emulation.py
index ca67b12..d6a910d 100644
--- a/gyp/pylib/gyp/msvs_emulation.py
+++ b/gyp/pylib/gyp/msvs_emulation.py
@@ -302,6 +302,7 @@ class MsvsSettings(object):
return {'Win32': 'x86', 'x64': 'x64'}.get(platform, 'x86')

def _TargetConfig(self, config):
+ return config
"""Returns the target-specific configuration."""
# There's two levels of architecture/platform specification in VS. The
# first level is globally for the configuration (this is what we consider
--
2.11.0.windows.1

2 changes: 1 addition & 1 deletion addon.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
'-luuid.lib',
'-lodbc32.lib',
'-lDelayImp.lib',
'-l"<(node_root_dir)/$(ConfigurationName)/<(node_lib_file)"'
'-l<(node_root_dir)/<(CONFIGURATION_NAME)/<(node_lib_file)'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this stop working for MSBuild ? Where is `(CONFIGURATION_NAME) defined ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<(XXXXX) is GYP variable resolution (i.e. GYP will resolve this)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, may be i was not clear. What i mean is for MsBuild, this variable is declared here which makes it available here as well as at other places. I am wondering, with this change if you build using MsBuild, what value will this variable resolve to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The process requires that GYP(CONFIGURATION_NAME) === MsBuild(ConfigurationName)
So now this resolution is a serpentius way, GYP sets it for MsBuild, and here MsBuild resolves it. And obviously it breaks for ninja/win32.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also #1118

],
'msvs_disabled_warnings': [
# warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
Expand Down
2 changes: 2 additions & 0 deletions gyp/pylib/gyp/generator/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def GypPathToUniqueOutput(self, path, qualified=True):
obj += '.' + self.toolset

path_dir, path_basename = os.path.split(path)
if os.path.isabs(path_dir):
path_dir = os.path.relpath(path_dir, self.abs_build_dir)
assert not os.path.isabs(path_dir), (
"'%s' can not be absolute path (see crbug.com/462153)." % path_dir)

Expand Down
1 change: 1 addition & 0 deletions gyp/pylib/gyp/msvs_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ def GetArch(self, config):
return {'Win32': 'x86', 'x64': 'x64'}.get(platform, 'x86')

def _TargetConfig(self, config):
return config
"""Returns the target-specific configuration."""
# There's two levels of architecture/platform specification in VS. The
# first level is globally for the configuration (this is what we consider
Expand Down