Skip to content

Commit 7682a9e

Browse files
authored
Merge pull request torvalds#552 from thehajime/fix-win10-build
fix win10 build
2 parents 269c243 + 1c2c85d commit 7682a9e

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- displayTargetName: windows-2019
2626
os: windows
2727
runs_on: windows-2019
28+
pip_option: --break-system-packages
2829
shell: msys2 {0}
2930
- displayTargetName: clang-build
3031
os: unix
@@ -58,7 +59,7 @@ jobs:
5859
echo "/usr/lib/ccache/bin:/usr/lib/ccache:/mingw64/bin:${{ github.workspace }}/bin" >> $GITHUB_PATH
5960
echo "export PATH=/usr/lib/ccache/bin:/usr/lib/ccache:/mingw64/bin:${{ github.workspace }}/bin:$PATH" >> $HOME/.bashrc
6061
61-
- uses: msys2/setup-msys2@v2
62+
- uses: msys2/setup-msys2@v2.26.0
6263
if: runner.os == 'Windows'
6364
with:
6465
msystem: MSYS
@@ -77,7 +78,7 @@ jobs:
7778
if: runner.os == 'Linux'
7879
uses: actions/checkout@v4
7980
- name: Install pip dependencies
80-
run: pip install yamlish junit-xml
81+
run: pip install ${{ matrix.pip_option }} yamlish junit-xml
8182
- name: Install openvpn
8283
if: runner.os == 'Windows'
8384
shell: pwsh

arch/lkl/scripts/headers_install.py

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ def find_ml_symbols(regexp, store):
6363
def find_enums(block_regexp, symbol_regexp, store):
6464
for h in headers:
6565
# remove comments
66-
content = re.sub(re.compile("(\/\*(\*(?!\/)|[^*])*\*\/)", re.S|re.M), " ", open(h).read())
66+
content = re.sub(re.compile(r"(\/\*(\*(?!\/)|[^*])*\*\/)", re.S|re.M), " ", open(h).read())
6767
# remove preprocesor lines
6868
clean_content = ""
6969
for l in content.split("\n"):
70-
if re.match("\s*#", l):
70+
if re.match(r"\s*#", l):
7171
continue
7272
clean_content += l + "\n"
7373
for i in block_regexp.finditer(clean_content):
@@ -103,11 +103,11 @@ def lkl_prefix(w):
103103
def replace(h):
104104
content = open(h).read()
105105
for i in includes:
106-
search_str = "(#[ \t]*include[ \t]*[<\"][ \t]*)" + i + "([ \t]*[>\"])"
106+
search_str = r"(#[ \t]*include[ \t]*[<\"][ \t]*)" + i + r"([ \t]*[>\"])"
107107
replace_str = "\\1" + "lkl/" + i + "\\2"
108108
content = re.sub(search_str, replace_str, content)
109109
tmp = ""
110-
for w in re.split("(\W+)", content):
110+
for w in re.split(r"(\W+)", content):
111111
if w in defines:
112112
w = lkl_prefix(w)
113113
tmp += w
@@ -116,11 +116,11 @@ def replace(h):
116116
# XXX: cleaner way?
117117
if s == 'TAG':
118118
continue
119-
search_str = "(\W?struct\s+)" + s + "(\W)"
119+
search_str = r"(\W?struct\s+)" + s + r"(\W)"
120120
replace_str = "\\1" + lkl_prefix(s) + "\\2"
121121
content = re.sub(search_str, replace_str, content, flags = re.MULTILINE)
122122
for s in unions:
123-
search_str = "(\W?union\s+)" + s + "(\W)"
123+
search_str = r"(\W?union\s+)" + s + r"(\W)"
124124
replace_str = "\\1" + lkl_prefix(s) + "\\2"
125125
content = re.sub(search_str, replace_str, content, flags = re.MULTILINE)
126126
open(h, 'w').write(content)
@@ -162,25 +162,25 @@ def replace(h):
162162
structs = set()
163163
unions = set()
164164

165-
p = re.compile("#[ \t]*define[ \t]*(\w+)")
165+
p = re.compile(r"#[ \t]*define[ \t]*(\w+)")
166166
find_symbols(p, defines)
167-
p = re.compile("typedef.*(\(\*(\w+)\)\(.*\)\s*|\W+(\w+)\s*|\s+(\w+)\(.*\)\s*);")
167+
p = re.compile(r"typedef.*(\(\*(\w+)\)\(.*\)\s*|\W+(\w+)\s*|\s+(\w+)\(.*\)\s*);")
168168
find_symbols(p, defines)
169-
p = re.compile("typedef\s+(struct|union)\s+\w*\s*{[^\\{\}]*}\W*(\w+)\s*;", re.M|re.S)
169+
p = re.compile(r"typedef\s+(struct|union)\s+\w*\s*{[^\\{\}]*}\W*(\w+)\s*;", re.M|re.S)
170170
find_ml_symbols(p, defines)
171171
defines.add("siginfo_t")
172172
defines.add("sigevent_t")
173-
p = re.compile("struct\s+(\w+)\s*\{")
173+
p = re.compile(r"struct\s+(\w+)\s*\{")
174174
find_symbols(p, structs)
175175
structs.add("iovec")
176-
p = re.compile("union\s+(\w+)\s*\{")
176+
p = re.compile(r"union\s+(\w+)\s*\{")
177177
find_symbols(p, unions)
178-
p = re.compile("static\s+__inline__(\s+\w+)+\s+(\w+)\([^)]*\)\s")
178+
p = re.compile(r"static\s+__inline__(\s+\w+)+\s+(\w+)\([^)]*\)\s")
179179
find_symbols(p, defines)
180-
p = re.compile("static\s+__always_inline(\s+\w+)+\s+(\w+)\([^)]*\)\s")
180+
p = re.compile(r"static\s+__always_inline(\s+\w+)+\s+(\w+)\([^)]*\)\s")
181181
find_symbols(p, defines)
182-
p = re.compile("enum\s+(\w*)\s*{([^}]*)}", re.M|re.S)
183-
q = re.compile("(\w+)\s*(,|=[^,]*|$)", re.M|re.S)
182+
p = re.compile(r"enum\s+(\w*)\s*{([^}]*)}", re.M|re.S)
183+
q = re.compile(r"(\w+)\s*(,|=[^,]*|$)", re.M|re.S)
184184
find_enums(p, q, defines)
185185

186186
# needed for i386
@@ -190,11 +190,13 @@ def process_header(h):
190190
print(" REPLACE\t%s" % (out_dir + "/" + os.path.basename(h)))
191191
replace(h)
192192

193-
p = multiprocessing.Pool(args.jobs)
194-
try:
195-
p.map_async(process_header, headers).wait(999999)
196-
p.close()
197-
except:
198-
p.terminate()
199-
finally:
200-
p.join()
193+
if __name__ == '__main__':
194+
multiprocessing.freeze_support()
195+
p = multiprocessing.Pool(args.jobs)
196+
try:
197+
p.map_async(process_header, headers).wait(999999)
198+
p.close()
199+
except:
200+
p.terminate()
201+
finally:
202+
p.join()

0 commit comments

Comments
 (0)