Fix forUtil.gradle to actually execute python script and also fix type error in script (#12411)

This commit is contained in:
Uwe Schindler 2023-07-03 16:22:03 +02:00 committed by GitHub
parent fde2e50d9e
commit f668cfd1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 10 deletions

View File

@ -34,7 +34,7 @@ configure(project(":lucene:core")) {
quietExec { quietExec {
workingDir genDir workingDir genDir
executable project.externalTool("python3") executable project.externalTool("python3")
args = [] args = [ '-B', genScript ]
} }
} }
} }
@ -59,7 +59,7 @@ configure(project(":lucene:backward-codecs")) {
quietExec { quietExec {
workingDir genDir workingDir genDir
executable project.externalTool("python3") executable project.externalTool("python3")
args = [] args = [ '-B', genScript ]
} }
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java": "e91aafa414018b34a39c8f0947ff58c1f1dde78d", "lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/ForUtil.java": "e91aafa414018b34a39c8f0947ff58c1f1dde78d",
"lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py": "285ed73b9763c541edaf40072667d68bd2537c56" "lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene84/gen_ForUtil.py": "7be3f1e17c9055d68a8ad6b0d6321481dcc4d711"
} }

View File

@ -414,7 +414,7 @@ def writeRemainder(bpv, next_primitive, remaining_bits_per_long, o, num_values,
i = 0 i = 0
remaining_bits = 0 remaining_bits = 0
tmp_idx = 0 tmp_idx = 0
for i in range(num_values): for i in range(int(num_values)):
b = bpv b = bpv
if remaining_bits == 0: if remaining_bits == 0:
b -= remaining_bits_per_long b -= remaining_bits_per_long

View File

@ -1,4 +1,4 @@
{ {
"lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java": "f2091e2b7284b70c740052a9b0ee389e67eb48a9", "lucene/core/src/java/org/apache/lucene/codecs/lucene90/ForUtil.java": "f2091e2b7284b70c740052a9b0ee389e67eb48a9",
"lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py": "69b6fcb95fc127a5cd29a40e4454048f56570a26" "lucene/core/src/java/org/apache/lucene/codecs/lucene90/gen_ForUtil.py": "7a137c58f88d68247be4368122780fa9cc8dce3e"
} }

View File

@ -227,10 +227,7 @@ final class ForUtil {
} }
for (int i = 0; i < numLongsPerShift; ++i) { for (int i = 0; i < numLongsPerShift; ++i) {
// Java longs are big endian and we want to read little endian longs, so we need to reverse out.writeLong(tmp[i]);
// bytes
long l = tmp[i];
out.writeLong(l);
} }
} }
@ -317,7 +314,7 @@ def writeRemainder(bpv, next_primitive, remaining_bits_per_long, o, num_values,
i = 0 i = 0
remaining_bits = 0 remaining_bits = 0
tmp_idx = 0 tmp_idx = 0
for i in range(num_values): for i in range(int(num_values)):
b = bpv b = bpv
if remaining_bits == 0: if remaining_bits == 0:
b -= remaining_bits_per_long b -= remaining_bits_per_long