You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/10/06 17:50:21 UTC

[GitHub] [lucene] balmukundblr opened a new pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

balmukundblr opened a new pull request #358:
URL: https://github.com/apache/lucene/pull/358


   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Lucene:
   
   * https://issues.apache.org/jira/projects/LUCENE
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * LUCENE-####: <short description of problem or changes>
   
   LUCENE must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   Lucene uses a custom WrapperDownloader to download the gradle-wrapper jar file. The call is made via a script here: https://github.com/apache/lucene/blob/main/gradlew#L117. The problem is if we are behind proxy, the JVM will not be able to download the file.
   
   # Solution
   
   This simple PR fixes the issue by introducing a JAVA_OPTS variable in the downloader script. Users who are behind proxy may then use this variable to set their proxy settings.
   
   JAVA_OPTS="-DproxySet=true -Dhttps.proxyHost=&lt;host&gt; -Dhttps.proxyPort=&lt;port&gt;"
   
   # Tests
   
   We have run the ./gradlew check.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/lucene/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [ ] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I have given Lucene maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   


-- 
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


[GitHub] [lucene] dweiss commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-937056600


   Dealing with this in scripts is nightmarish... but if you do want it then you should:
   - provide the defaults (empty string) if the variable is not defined,
   - modify all scripts (Windows, Linux) so that they work in the same way.


-- 
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


[GitHub] [lucene] balmukundblr commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
balmukundblr commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-949747082


   > I looked it up. It does seem to be a widespread (and old) convention indeed. I think it'd be good to take it into account. Would it work for you to pass proxy settings via environment variables, @balmukundblr ?
   
   Yes, but -Djava.net.useSystemProxies=true also works.


-- 
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


[GitHub] [lucene] balmukundblr commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
balmukundblr commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-949745511


   > There are two things, it seems: if we always pass -Djava.net.useSystemProxies=true to the downloader, it should respect the system proxy settings (which is great). The http_proxy environment variable convention seems unrelated and it'd have to be implemented separately (in the downloader again?). The third issue - this patch - is also valuable since it allows the user to bypass whatever else is set up.
   > 
   > I don't have a proxy and don't intend to play with it so somebody with access to such infrastructure would have to test it.
   
   It seems, -Djava.net.useSystemProxies=true works for proxy.


-- 
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


[GitHub] [lucene] balmukundblr commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
balmukundblr commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-938795581


   > Thanks for this patch! Can you please also update gradlew.bat?
   
   Done required changes in gradlew.bat file.


-- 
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


[GitHub] [lucene] balmukundblr commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
balmukundblr commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-938790568


   > Dealing with this in scripts is nightmarish... but if you do want it then you should:
   > 
   > * provide the defaults (empty string) if the variable is not defined,
   > * modify all scripts (Windows, Linux) so that they work in the same way.
   
   Fixed. Done the required changes.
   


-- 
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


[GitHub] [lucene] dweiss commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-947955859


   I don't live behind a proxy so I have no way of verifying this. What are "other tools", Rob? Is this really a convention?


-- 
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


[GitHub] [lucene] janhoy commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
janhoy commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-949359383


   I have also seen other tools respecting `http_proxy` env, so that would be a nice solution.
   
   Is this something that should be fixed upstream (instead/as well)? 


-- 
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


[GitHub] [lucene] rmuir commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
rmuir commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-947767604


   Is this not instead a bug in the `WrapperDownloader.java`, that it doesn't respect the conventional environment variables for proxy support (e.g. `http_proxy=`) when downloading? Other tools all do this.
   
   I would consider setting `-Djava.net.useSystemProxies=true` to fix this, so that users environment vars are respected, and they don't need to mess with jvm arguments for things to work? just a thought.


-- 
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


[GitHub] [lucene] madrob commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
madrob commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-936805007


   Thanks for this patch! Can you please also update gradlew.bat?


-- 
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


[GitHub] [lucene] dweiss commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-950192204


   I added LUCENE-10198 and modified your patch slightly: JAVA_OPTS can be defined externally (to allow any JVM options you desire). The defaults are saner - use system proxies. I verified on Windows and Linux and it seems to work fine. See #405 


-- 
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


[GitHub] [lucene] dweiss commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-937056600


   Dealing with this in scripts is nightmarish... but if you do want it then you should:
   - provide the defaults (empty string) if the variable is not defined,
   - modify all scripts (Windows, Linux) so that they work in the same way.


-- 
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


[GitHub] [lucene] dweiss commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-949369176


   There are two things, it seems: if we always pass -Djava.net.useSystemProxies=true to the downloader, it should respect the system proxy settings (which is great). The http_proxy environment variable convention seems unrelated and it'd have to be implemented separately (in the downloader again?). The third issue - this patch - is also valuable since it allows the user to bypass whatever else is set up. 
   
   I don't have a proxy and don't intend to play with it so somebody with access to such infrastructure would have to test it.


-- 
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


[GitHub] [lucene] dweiss commented on pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #358:
URL: https://github.com/apache/lucene/pull/358#issuecomment-947960549


   I looked it up. It does seem to be a widespread (and old) convention indeed. I think it'd be good to take it into account. Would it work for you to pass proxy settings via environment variables, @balmukundblr ?


-- 
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


[GitHub] [lucene] dweiss closed pull request #358: Add JAVA_OPTS to download the gradle-wrapper jar behind proxy.

Posted by GitBox <gi...@apache.org>.
dweiss closed pull request #358:
URL: https://github.com/apache/lucene/pull/358


   


-- 
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