Skip to content

Commit 3cb42c6

Browse files
committed
Merge branch 'main' into reduce-NeighborArray-memory
* main: (27 commits) deps(java): bump com.github.luben:zstd-jni from 1.5.7-2 to 1.5.7-3 (apache#14621) Improve user-facing docs for geo package (apache#14534) Enabling histogram collection for PointRangeQuery (apache#14560) Move sloppySin into SloppyMath from GeoUtils (apache#14516) Rewrite APIJAR extractor to use Java 24 classfile API and kill ASM dependency also for build system (apache#14613) CHANGES entry for apache#14226 (optimistic KNN Query) OptimisticKnnVectorQuery (apache#14226) Fix for Windows (spaces in paths) apache#14608 Update jdk requirements in README to OpenJDK 24 (apache#14610) Always check gradle wrapper sha checksum and download if necessary (apache#14608) Fix changelog verifier (apache#14606) MultiRange query for SortedNumeric DocValues (apache#14404) Remove RANDOM_PRELOAD read advice, which is not actually used (apache#14593) Remove duplicate test (apache#14602) Refactor the expressions compiler to use official ClassData BSM with indexed lookup (apache#14602) Disallow EA versions to run Gradle (apache#14601) Add back-compat indices for 10.2.1 Add Lucene 10.2.1 version constant DOAP changes for release 10.2.1 Revert "An attempt to make jenkins pass with the currently installed jdk24-ea. To be reverted later. apache#14600" ...
2 parents d2ad868 + 24d7323 commit 3cb42c6

File tree

73 files changed

+2260
-673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2260
-673
lines changed

.github/workflows/verify-changelog-and-set-milestone.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
env:
77
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88
ISSUE: ${{ github.event.issue.html_url }}
9+
BASE_REPO: ${{ github.repository }}
910
SKIP_CHANGELOG_CHECK_LABEL: ${{ '"skip-changelog-check"' }}
1011
CHANGE_LOG_FILE: ${{ 'lucene/CHANGES.txt' }}
1112

@@ -25,7 +26,8 @@ jobs:
2526
run: |
2627
echo "################## STEP 1 ##################"
2728
echo "Get all labels from PR #${{ github.event.number }}"
28-
mapfile -t labels < <(gh pr view ${{ github.event.number }} --json labels -q '.labels[].name')
29+
# Use the BASE_REPO variable to ensure it expands correctly
30+
mapfile -t labels < <(gh pr view ${{ github.event.number }} --repo "$BASE_REPO" --json labels -q '.labels[].name')
2931
IFS=','; echo "${labels[*]}"
3032
for label in "${labels[@]}"; do
3133
if [[ $label == ${{ env.SKIP_CHANGELOG_CHECK_LABEL }} ]]; then
@@ -38,10 +40,25 @@ jobs:
3840
echo -e "\n"
3941
echo "################## STEP 2 ##################"
4042
echo "Checking for change log entry in ${{ env.CHANGE_LOG_FILE }}"
41-
git fetch origin ${{ github.event.pull_request.base.ref }}
42-
git log --pretty=oneline | tail -n 2 | cat
43-
echo "merge base sha: ${{ github.event.pull_request.base.sha }}, merge head sha: ${{ github.event.pull_request.head.sha }}"
44-
if ! git diff ${{ github.event.pull_request.base.sha }} --name-only | grep -q "${{ env.CHANGE_LOG_FILE }}"; then
43+
git remote add upstream https://github.com/${{ github.repository }}.git
44+
45+
# Add and fetch full history of the base branch
46+
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
47+
# We need this to ensure we will be able to find the merge base
48+
git fetch --unshallow || true
49+
git fetch upstream $BASE_BRANCH
50+
51+
# Find merge base commit to diff against
52+
BASE_COMMIT=$(git merge-base HEAD upstream/$BASE_BRANCH)
53+
echo "Using merge base for comparison: $BASE_COMMIT"
54+
echo "Last 3 commits up to merge base:"
55+
git log --oneline -n 3 $BASE_COMMIT
56+
echo "Last 3 commits up to PR head:"
57+
git log --oneline -n 3 HEAD
58+
59+
echo "Diff:"
60+
git diff --name-only $BASE_COMMIT HEAD -- ${{ env.CHANGE_LOG_FILE }}
61+
if ! git diff --name-only $BASE_COMMIT HEAD -- ${{ env.CHANGE_LOG_FILE }}; then
4562
echo "Change log file:${{ env.CHANGE_LOG_FILE }} does not contains an entry corresponding to changes introduced in PR. Please add a changelog entry."
4663
exit 0
4764
else
@@ -54,7 +71,9 @@ jobs:
5471
echo "Extracting Lucene version from change log entry"
5572
# git diff header pattern -> "@@ -15,0 +16,4 @@"
5673
# try to extract the line number at which new entry is added, here it's line number 16
57-
diff=$(git diff ${{ github.event.pull_request.base.sha }} --unified=0 -- ${{ env.CHANGE_LOG_FILE }})
74+
echo "Diff:"
75+
git diff --unified=0 $BASE_COMMIT HEAD -- ${{ env.CHANGE_LOG_FILE }}
76+
diff=$(git diff --unified=0 $BASE_COMMIT HEAD -- ${{ env.CHANGE_LOG_FILE }})
5877
lucene_version=""
5978
diff_header_pattern="@@ -[0-9]+,?[0-9]* \+([0-9]*),?[0-9]* @@"
6079
if [[ $diff =~ $diff_header_pattern ]]; then

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ comprehensive documentation, visit:
4040

4141
### Basic steps:
4242

43-
1. Install OpenJDK 23.
43+
1. Install [OpenJDK 24](https://jdk.java.net/archive/).
4444
2. Clone Lucene's git repository (or download the source distribution).
4545
3. Run gradle launcher script (`gradlew`).
4646

build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
import java.security.MessageDigest;
3636
import java.security.NoSuchAlgorithmException;
3737
import java.util.Locale;
38+
import java.util.Objects;
3839
import java.util.concurrent.TimeUnit;
40+
import java.util.logging.Logger;
3941

4042
/**
4143
* Standalone class that can be used to download a gradle-wrapper.jar
@@ -66,12 +68,47 @@ public static void checkVersion() {
6668
}
6769

6870
public void run(Path destination) throws IOException, NoSuchAlgorithmException {
69-
Path checksumPath =
70-
destination.resolveSibling(destination.getFileName().toString() + ".sha256");
71+
var expectedFileName = destination.getFileName().toString();
72+
Path checksumPath = destination.resolveSibling(expectedFileName + ".sha256");
7173
if (!Files.exists(checksumPath)) {
7274
throw new IOException("Checksum file not found: " + checksumPath);
7375
}
74-
String expectedChecksum = Files.readString(checksumPath, StandardCharsets.UTF_8).trim();
76+
77+
String expectedChecksum;
78+
try (var lines = Files.lines(checksumPath, StandardCharsets.UTF_8)) {
79+
expectedChecksum =
80+
lines
81+
.map(
82+
line -> {
83+
// "The default mode is to print a line with: checksum, a space,
84+
// a character indicating input mode ('*' for binary, ' ' for text
85+
// or where binary is insignificant), and name for each FILE."
86+
var spaceIndex = line.indexOf(" ");
87+
if (spaceIndex != -1 && spaceIndex + 2 < line.length()) {
88+
var mode = line.charAt(spaceIndex + 1);
89+
String fileName = line.substring(spaceIndex + 2);
90+
if (mode == '*' && fileName.equals(expectedFileName)) {
91+
return line.substring(0, spaceIndex);
92+
}
93+
}
94+
95+
Logger.getLogger(WrapperDownloader.class.getName())
96+
.warning(
97+
"Something is wrong with the checksum file. Regenerate with "
98+
+ "'sha256sum -b gradle-wrapper.jar > gradle-wrapper.jar.sha256'");
99+
return null;
100+
})
101+
.filter(Objects::nonNull)
102+
.findFirst()
103+
.orElse(null);
104+
105+
if (expectedChecksum == null) {
106+
throw new IOException(
107+
"The checksum file did not contain the expected checksum for '"
108+
+ expectedFileName
109+
+ "'?");
110+
}
111+
}
75112

76113
Path versionPath =
77114
destination.resolveSibling(destination.getFileName().toString() + ".version");

dev-tools/doap/lucene.rdf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@
6767
</maintainer>
6868

6969
<!-- NOTE: please insert releases in numeric order, NOT chronologically. -->
70+
<release>
71+
<Version>
72+
<name>lucene-10.2.1</name>
73+
<created>2025-05-01</created>
74+
<revision>10.2.1</revision>
75+
</Version>
76+
</release>
7077
<release>
7178
<Version>
7279
<name>lucene-10.2.0</name>

dev-tools/scripts/requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
# jinja template processing of releaseWizard.yaml
12
Jinja2==3.1.6
3+
# parsing and processing of releaseWizard.yaml
24
PyYAML==6.0.2
5+
# international holidays in releaseWizard
36
holidays==0.71
7+
# calendar processing in releaseWizard
48
ics==0.7.2
9+
# terminal processing in releaseWizard
510
console-menu==0.8.0
11+
# pull request processing in githubPRs
612
PyGithub==2.6.1
13+
# JIRA processing in githubPRs
714
jira==3.8.0
15+
# type-checking in "make lint"
816
basedpyright==1.29.1
17+
# linting in "make lint"
918
ruff==0.11.7

gradle/generation/extract-jdk-apis.gradle

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,10 @@ configure(project(":lucene:core")) {
2323
mrjarJavaVersions = [ 24 ]
2424
}
2525

26-
configurations {
27-
apiextractor
28-
}
29-
30-
dependencies {
31-
apiextractor deps.asm.core
32-
}
33-
3426
plugins.withType(JavaPlugin) {
3527
mrjarJavaVersions.each { jdkVersion ->
3628
def task = tasks.create(name: "generateJdkApiJar${jdkVersion}", type: JavaExec) {
37-
description "Regenerate the API-only JAR file with public Panama Foreign & Vector API from JDK ${jdkVersion}"
29+
description "Regenerate the API-only JAR file with public Panama Vector API from JDK ${jdkVersion}"
3830
group "generation"
3931

4032
javaLauncher = javaToolchains.launcherFor {
@@ -46,20 +38,20 @@ configure(project(":lucene:core")) {
4638
javaLauncher.get()
4739
return true
4840
} catch (Exception e) {
49-
logger.warn('Launcher for Java {} is not available; skipping regeneration of Panama Foreign & Vector API JAR.', jdkVersion)
41+
logger.warn('Launcher for Java {} is not available; skipping regeneration of Panama Vector API JAR.', jdkVersion)
5042
logger.warn('Error: {}', e.cause?.message)
5143
logger.warn("Please make sure to point env 'JAVA{}_HOME' to exactly JDK version {} or enable Gradle toolchain auto-download.", jdkVersion, jdkVersion)
5244
return false
5345
}
5446
}
5547

56-
classpath = configurations.apiextractor
5748
mainClass = file("${resources}/ExtractJdkApis.java") as String
5849
systemProperties = [
5950
'user.timezone': 'UTC',
6051
'file.encoding': 'UTF-8',
6152
]
6253
args = [
54+
rootProject.minJavaVersion.toString(),
6355
jdkVersion,
6456
apijars.file("jdk${jdkVersion}.apijar"),
6557
]

0 commit comments

Comments
 (0)