-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Always check gradle wrapper sha checksum and download if necessary #14608
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
Conversation
…se sha256sum on each invocation. Use standard sha256sum format for the .sha256 file.
@rem Read the expected hash from .sha256 file | ||
for /f "tokens=1" %%A in (%GRADLE_WRAPPER_CHECKSUM%) do ( | ||
set "EXPECTED=%%A" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the assumption here is that the sha file only contains the gradle-wrapper.jar checksum and it's sane. If anything doesn't match/ work here, we fall back to the Java version in WrapperDownloader anyway, where things are checked in depth.
for /f "tokens=* delims=" %%H in ('certutil -hashfile "%GRADLE_WRAPPER_JAR%" SHA256 ^| findstr /R /B /I /X "[0-9a-f]*"') do ( | ||
set "ACTUAL=%%H" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this computes sha256 using certutil, then tries to pick a line that looks like an sha256 checksum. Again - if something fails, we rely on the Java version to tell us what's wrong.
I've verified this works on Windows, Linux (ubuntu) and Mac. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I've got no idea, to be honest. Here is a list of shas for all releases - v8.14 is there and consistent with what we have. |
Thanks for fixing this! I ran into the same problem. My old % ./gradlew clean
no main manifest attribute, in /Users/vigyas/repos/lucene/gradle/wrapper/gradle-wrapper.jar My workaround till last night was to delete the % ./gradlew clean
Checksum mismatch, will attempt to re-download gradle-wrapper.jar
/Users/vigyas/repos/lucene/gradle/wrapper/gradle-wrapper.jar
Downloading gradle-wrapper.jar from https://raw.githubusercontent.com/gradle/gradle/v8.14.0/gradle/wrapper/gradle-wrapper.jar
Starting a Gradle Daemon (subsequent builds will be faster) |
There is a small problem in windows with whitespace in path (missing escapes):
Can you fix this? |
This also delayed nightly benchy a couple days ... thanks for fixing! |
As a (former) windows user... Uwe, you're asking for trouble if you have a whitespace in your home dir... I'll take a look. |
Should work now, @uschindler |
Works, thanks! |
That's why I am doing this! |
You know what I am doing? --> stay tuned, almost working!
|
* 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" ...
Fixes #14598