You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "dweiss (via GitHub)" <gi...@apache.org> on 2025/04/30 17:49:07 UTC

[I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

dweiss opened a new issue, #14598:
URL: https://github.com/apache/lucene/issues/14598

   ### Description
   
   Uwe noticed this. After the update to gradle 8.14, I've updated the gradle-wrapper script's version and SHA. The new scripts launch it using -jar (previously it was launched using an explicit main method). This uncovered a potential problem that hasn't manifested itself so far - we only check if gradle-wrapper.jar exists; if it doesn't exist, we invoke WrapperDownloader but if gradle-wrapper.jar already exists, we take no action and use this file (which may be older/different).
   
   We could check the sha of the wrapper script on each invocation but this seems like an overkill. I don't have a fix for this one. I think we're just going to live with this oddity, hoping that it doesn't cause side effects often (what Uwe experienced).
   
   ### Version and environment details
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2858772211

   Thanks for also fixing linux spaces in pathname, Did you hit it on the s390x Jenkins node? There I added a whitespace in the workspace name!!!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2843482547

   > I also thought about sha256sum check in gradlew - this spawns a process but doesn't seem to be too bad... 
   
   Well i mean this is what shell scripts do. The current `gradlew` spawns plenty of processes and even spawns them in loops (e.g. runs `ls` in a loop). Doesn't look like anyone is trying too hard to restrict themselves to just shell builtins. so I don't know why running `sha256sum` would be an issue.
   
   @dweiss can `certutil` work in the windows case? Sorry, my windows knowledge is limited, but if this tool could do the job it'd be perfect.
   
   https://techdocs.akamai.com/download-ctr/docs/verify-checksum


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss closed issue #14598: gradle-wrapper.jar will not be updated when its sha/version changes
URL: https://github.com/apache/lucene/issues/14598


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2843104515

   I looked into this, there's a `gradle/wrapper/gradle-wrapper.jar.sha256` but it is not in the standard format. How is this currently being generated/used? I would propose:
   
   Generation:
   ```console
   $ sha256sum gradle-wrapper.jar > gradle-wrapper.jar.256
   ```
   
   Validation:
   ```console
   $ sha256sum -c gradle-wrapper.jar.sha256
   ```
   
   This will work with both GNU coreutils `sha256sum` and the BSD `sha256sum` present on the macs. command works exactly the same as it is "basic" and required for many purposes.
   ```console
   $ sha256sum -c gradle-wrapper.jar.sha256
   gradle-wrapper.jar: OK
   $ gsha256sum -c gradle-wrapper.jar.sha256
   gradle-wrapper.jar: OK
   ```
   
   I would happy to help make the changes to the `./gradlew`. It would prevent issues on both linux and macos operating systems. The `./gradlew.bat` might need a different solution, but it is its own file.
   
   Just would like to understand where this existing .sha256 file is coming from so that we can fix the output to be 'standard'. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2849293690

   This is actually a sort-of regression introduced in  #13404 (90e07f666422). Previously, we'd always check the checksum of the wrapper file. After this change - to speed up startup time - we only do it if the file isn't there already.
   
   I'll file a PR to revert to the old behavior but use sha256sum to verify the checksum on Linux/ Mac. On Windows, I'll revert back to calling the wrapper. Yes, it is slower (adds about a second to execution time) but scripting something similar with cmd is tough. Maybe we can follow-up to cater to the needs of Windows users.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2849301978

   https://github.com/apache/lucene/pull/14608
   
   This adds sha256 check on Windows and Linux. The Linux part is a redesigned version of what chatgpt came up with. I believe even chatgpt fried its ai brains when it had to deal with cmd syntax...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2844174816

   You're right - I'm paranoid.
   
   I no longer use Windows on a regular basis but I can check on a vm later today. Like I said - if nothing else works, we can still just make WrapperDownloader do the job.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2858176432

   I've noticed that Windows gradlew.bat had a subtle bug which resulted in always triggering java checksum validation. I've fixed the problem and will let chatgpt explain it in details based on the commit diff (this is quite astonishing).
   
   ![Image](https://github.com/user-attachments/assets/74788d84-5bb7-4f5e-bfe7-1e4b249e13ab)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2858914015

   :) No, I just checked if it works locally on Linux.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2843055994

   I had to remove a wrapper manually this morning (maybe it was 0 bytes or corrupt or outdated) and force it to be re-downloaded myself. I didn't raise any issue as you know, i do hacky stuff so it might have been my fault, but just as a data point.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2843324990

   I computed the current sha256 using command-line tools byte copy-pasted it directly into Lucene sources. No magic.
   
   I also thought about sha256sum check in gradlew - this spawns a process but doesn't seem to be too bad... but then we'd have an inconsistency with Windows (for which I see no solution). An alternative is to do this check in Java (WrapperDownloader) but this is a much more heavyweight process... Could be an alternative for Windows though.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2858764089

   Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] gradle-wrapper.jar will not be updated when its sha/version changes [lucene]

Posted by "ChrisHegarty (via GitHub)" <gi...@apache.org>.
ChrisHegarty commented on issue #14598:
URL: https://github.com/apache/lucene/issues/14598#issuecomment-2846847520

   I noticed problems with the gradle wrapper also, e.g.
   ```
   ./gradlew check
   no main manifest attribute, in /Users/chegar/git/lucene/gradle/wrapper/gradle-wrapper.jar
   ```
   
   I just deleted and re-cloned and all is fine now. It downloaded a new wrapper, e.g.
   ```
   Downloading gradle-wrapper.jar from https://raw.githubusercontent.com/gradle/gradle/v8.14.0/gradle/wrapper/gradle-wrapper.jar
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org