Skip to content

Commit

Permalink
test new patch
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Apr 2, 2024
1 parent 030a099 commit 17f90db
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions patches/gyp-next-2.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 4c049a0a283951886636aedbcbe629ae6443286c Mon Sep 17 00:00:00 2001
From: toyobayashi <[email protected]>
Date: Tue, 2 Apr 2024 19:26:10 +0800
Subject: [PATCH 1/2] fix: failed to detect flavor if compiler path include
Subject: [PATCH 1/3] fix: failed to detect flavor if compiler path include
white spaces

---
Expand Down Expand Up @@ -89,7 +89,7 @@ index 43b2254..da78d39 100755
From b6b68d64d8c9e3e597f1b7022872d02a11cc0240 Mon Sep 17 00:00:00 2001
From: toyobayashi <[email protected]>
Date: Tue, 2 Apr 2024 20:38:41 +0800
Subject: [PATCH 2/2] raise error if exit code is not 0
Subject: [PATCH 2/3] raise error if exit code is not 0

---
pylib/gyp/common.py | 26 ++++++++++++++++--------
Expand Down Expand Up @@ -258,3 +258,45 @@ index da78d39..a0cb2ed 100755
+
if __name__ == "__main__":
unittest.main()

From 50fd4ca09eb34030adeffe5cdd53aa76294d5639 Mon Sep 17 00:00:00 2001
From: toyobayashi <[email protected]>
Date: Tue, 2 Apr 2024 20:49:04 +0800
Subject: [PATCH 3/3] fix ruff lint

---
pylib/gyp/common.py | 7 ++++---
pylib/gyp/common_test.py | 1 -
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pylib/gyp/common.py b/pylib/gyp/common.py
index 189f2a2..028387e 100644
--- a/pylib/gyp/common.py
+++ b/pylib/gyp/common.py
@@ -426,10 +426,11 @@ def EnsureDirExists(path):
def GetCrossCompilerPredefines(): # -> dict
cmd = []

- # shlex.split() will eat '\' in posix mode
- # but setting posix=False will preserve extra '"' cause CreateProcess fail on Windows
+ # shlex.split() will eat '\' in posix mode, but
+ # setting posix=False will preserve extra '"' cause CreateProcess fail on Windows
# this makes '\' in %CC_target% and %CFLAGS% work
- replace_sep = lambda s : s.replace("\\", "/") if sys.platform == "win32" else s
+ def replace_sep(s):
+ return s.replace("\\", "/") if sys.platform == "win32" else s

if CC := os.environ.get("CC_target") or os.environ.get("CC"):
cmd += shlex.split(replace_sep(CC))
diff --git a/pylib/gyp/common_test.py b/pylib/gyp/common_test.py
index a0cb2ed..30678e1 100755
--- a/pylib/gyp/common_test.py
+++ b/pylib/gyp/common_test.py
@@ -11,7 +11,6 @@
import sys
import os
import subprocess
-import shlex
from unittest.mock import patch, MagicMock

class TestTopologicallySorted(unittest.TestCase):

0 comments on commit 17f90db

Please sign in to comment.