[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-17 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17523433#comment-17523433
 ] 

Andi Vajda commented on PYLUCENE-62:


Thank you for having verified the changes again.
The 'import jcc' case, as you say, is not very useful but can be made to work 
by calling os.add_dll_directory(jvm_dll_path) manually first. If one is import 
the jcc package this way, they must know what they're up to.
I can't connect the %PREFIX%\lib\site-packages\jcc3\jcc3.lib issue to code in 
jcc other than the extra_link_args being set in python.py around line 1843. I 
don't see, at first glance, where %prefix% would be coming from.
I think this bug can now be marked fixed, please reopen if you think it needs 
more work.
Thank you again for all your work on this !

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, 
> fixes_with_inclusion _of_windows_module.patch, jvm_dll.diff, small_fixes.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-17 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17523325#comment-17523325
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Hi Andi,

 

Yes, I can confirm that HEAD is working with my wrapping test cases and main 
project (non-shared mode).

 

I am not using shared mode, did a quick test (windows) of adding --shared and 
it failed when wrapping in the test case with "LINK : fatal error LNK1181: 
cannot open input file '%PREFIX%\lib\site-packages\jcc3\jcc3.lib".  The file 
jcc3.lib is in the package. But I haven't looked more into it.

In my test case suite, I removed the test of "import jcc" on windows as this 
standalone does not work if server is used and py>3.8 (directly gives dll not 
found). This is a bit unexpected behavour from the user I would expect, but 
most acutal usage is likely from the command line. The solutions to this, if 
needed, is as I see either to introduce another environment variable or to 
search both server & client. But practically it works as is now.

 

Many thanks

/Petrus

 

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, 
> fixes_with_inclusion _of_windows_module.patch, jvm_dll.diff, small_fixes.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-16 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17523248#comment-17523248
 ] 

Andi Vajda commented on PYLUCENE-62:


Thank you for the fixes and explanations. I think I integrated your changes and 
even simplified things a bit more in python.py, now that we're including 
windows.py when --find-jvm-dll is set.
I committed the changes to HEAD. Please, try this out again by setting 
--find-jvm-dll server and let me know if it all works. Thank you !

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, 
> fixes_with_inclusion _of_windows_module.patch, jvm_dll.diff, small_fixes.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-16 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17523051#comment-17523051
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Hi Again,

If including the windows.py module in the target package it works, as JCC is 
then not imported and default settings activated. I would find this model good 
from the perspective that the target code will not have JCC as a requirement 
and can be installed stand-alone.

 

Attached [^fixes_with_inclusion _of_windows_module.patch] , to illustrate, you 
have seen this in a previous patch as well.

 

Regards

/Petrus

 

 

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, 
> fixes_with_inclusion _of_windows_module.patch, jvm_dll.diff, small_fixes.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-15 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17522949#comment-17522949
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Hi Andy,

I have done some testing and I do not get it to work as expected with 
--find-jvm-dll server yet.

Or simplest case is "python setup.py install" and then from python prompt 
"import jcc" that ends with a "ValueError: jvm.dll could not be found". Here 
there is no obvious possiblity to sett server/client and same applies for the 
library when wrapped as I understand. I probably haven't reflected much on the 
server/client duality, and just added path's in the environment that covered as 
much as possible..  As I don't know for sure the details of the jdk users use I 
would prefer if it searches both... with this I get it to work with my test 
scripts without problems.

There seems to be a missing section under the non-shared mode code generated, 
here I think also the add_jvm_dll_directory_to_path is needed.

I submit a patch with the stuff I have identified so far but it still has 
issues and will continue to work on it to see if I can get it to work without 
adding both server and client.

The thing now sems to be that when the jcc.windows is imported it goes through 
the __init__.py of jcc which does not have the argument of --find-jvm-dll and 
thus defaults to client and fails. I thought the windows.py could also be 
included in the wrapped code, avoiding the dependency on jcc there?

 

All the best,

/Petrus

 

 

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-14 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17522433#comment-17522433
 ] 

Andi Vajda commented on PYLUCENE-62:


Does it work as expected if you pass --find-jvm-dll server to your command line 
?

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-14 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17522078#comment-17522078
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Hi Andi,

Thanks for the ping, got involved in other stuff but was planning to revisit 
this one. Got some time now over easter and will work on it coming days. Let me 
revisit it before commenting more but, yes I think there is some modifications 
needed - the line: python -c "import jcc; print(jcc._{_}file{_}{_})"{_} did not 
work for me in the test cases as I think the default java I use is having the 
server jvm.dll and with the default on client in JCC this would fail as I 
remember.

Many Thanks,

/Petrus

 

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-04-13 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17521968#comment-17521968
 ] 

Andi Vajda commented on PYLUCENE-62:


Hi Petrus, this issue seems to have stalled. 
Is it actually solved by the latest jvm_dll.diff patch attached here ?
I'm preparing to release PyLucene 9.1.0 and it'd be nice to know if it still 
works on Windows !

(thanks)

Andi..

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-19 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17495042#comment-17495042
 ] 

Andi Vajda commented on PYLUCENE-62:


I'd like which kind of jvm.dll is used to not be random with regards to client 
or server kind. But if you prefer both to be searchable as well, we can add 
support for a "both" --find_jvm_dll value, that searches "client", then 
"server" (or the opposite, but again, not random)The default should remain 
"client" since that is what it's been doing for years. Also, it would be good 
to emit a log statement of some sort that says what jvm.dll (its full path) was 
found and added to the DLL path.
Bullet 2: I can't bet that people wouldn't copy source code around. It's also 
easier to debug if the same code is emitted everywhere, regardless of platform, 
using conditional code as necessary.
The stuff after SHARED is unchanged, your patch didn't touch it, nor did my 
changes. I'm wondering what to do about it, though, as it is also messing with 
PATH. Are you using --shared mode ?
About "it doesn't work": I can't debug this as I don't have access to Windows. 
Here, on mac, the following works fine, of course: python -c "import jcc; 
print(jcc.__file__)". Could you please take the current patch and "make it 
work" or, if you'd like my help with debugging it, tell me more details about 
what doesn't actually work ? In particular, please, add print statements in the 
__init__.py  and windows.py files as to what is going on until it eventually 
fails and send me the output. Thanks !

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-19 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17494930#comment-17494930
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Hi,

Thanks for the update - looks much cleaner!

I would however really prefer that it searches both client and server 
directories, maybe if there is a need to select one could have that one as the 
first search choice? As it is now it gives an error if just "import jcc" on the 
python prompt (which I partly use as a test and could be unintuitive to the 
user). Default in my installation I'm having jvm in the server path.

Just for my future understanding, on the bullet 2, to keep it unconditional on 
machine - as the target wrapped library is compiled I thought this was a safe 
bet that it wouldn't be moved around?

The stuff in the SHARED  must be an error when I made the patch, I initially 
modified each case but went for a joint thing in the start instead.

 

something like in windows.py
{color:#d4d4d4} {color}{color:#c586c0}for{color}{color:#d4d4d4} 
{color}{color:#9cdcfe}location{color}{color:#d4d4d4} 
{color}{color:#c586c0}in{color}{color:#d4d4d4} 
(({color}{color:#ce9178}'bin'{color}{color:#d4d4d4}, 
{color}{color:#9cdcfe}client_or_server{color}{color:#d4d4d4}),{color}
{color:#d4d4d4}                         
({color}{color:#ce9178}'jre'{color}{color:#d4d4d4}, 
{color}{color:#ce9178}'bin'{color}{color:#d4d4d4}, 
{color}{color:#9cdcfe}client_or_server{color}{color:#d4d4d4}),{color}
{color:#d4d4d4} ({color}{color:#ce9178}'bin'{color}{color:#d4d4d4}, 'server' if 
{color}{color:#9cdcfe}client_or_server=='client' else 
'client'{color}{color:#d4d4d4}),{color}
{color:#d4d4d4}                         
({color}{color:#ce9178}'jre'{color}{color:#d4d4d4}, 
{color}{color:#ce9178}'bin'{color}{color:#d4d4d4}, 
{color}{color:#d4d4d4}'server' if 
{color}{color:#9cdcfe}client_or_server=='client' else 
'client'{color}{color:#d4d4d4}),{color}
{color:#d4d4d4}){color}
 

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-14 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492230#comment-17492230
 ] 

Andi Vajda commented on PYLUCENE-62:


I also not sure what to about the code in __init__.py, after line 28, in the 
SHARED case ?
Should the eggpath be added via os.add_dll_directory() as well ?
Are you using shared mode ?


> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-14 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492229#comment-17492229
 ] 

Andi Vajda commented on PYLUCENE-62:


I took a look at your patch and attached a version that should be less 
intrusive and work, hopefully, too:
  - you do not need to add windows.py to modules, it is already included and 
installed
  - you do need to keep code conditional to windows, you can't assume people 
are not
going to carry code around between machines
  - in windows.py, I renamed get_jvm_dll_directory() to 
get_jvm_dll_directory_from_registry()
   and otherwise kept it unchanged
  - in windows.py, I added get_jvm_dll_directory_from_env() based on your code.
  - in windows.py, I also changed add_jvm_dll_directory_to_path() to do the 
right thing, like
you did
  - I changed the --find-jvm-dll command line flag from a boolean to a string 
that must be one
of "client" or "server" and made it default to "client" for python >= 3.8, 
None otherwise.
Please, try the attached patch out by passing it --find-jvm-dll client (or 
server), I have no access to Windows, so I could not try it out myself. I 
verified that it didn't break on Mac.
Thank you !


> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch, jvm_dll.diff
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-14 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17492096#comment-17492096
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Did an attempt to use the add_jvm_dll_directory_to_path() approach, seems to 
work fine in the test environments I have. I took the order of picking up java 
from: JCC_JDK, JAVA_HOME and then registry. As it is now, the python3.8+ on 
windows does not care about the PATH at all. It could be added to scrape around 
in PATH as well, but hesitant to have too many places for it? Also added 
windows.py to the modules to be embedded to avoid the need of also installing 
JCC on the target package.

 

 

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win-1.patch, add_dll_win.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-13 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17491669#comment-17491669
 ] 

Andi Vajda commented on PYLUCENE-62:


As is, --find-jvm-dll shouldn't solve the issue because it modifies PATH and 
doesn't use the new os.add_dll_directory() function. 
If, on the other hand, you modify windows.py's add_jvm_dll_directory_to_path() 
to call os.add_dll_directory() instead of messing with Path, does 
--find-jvm-dll then solve the problem ? 
I have no access to Windows so I can't test any fix myself.
Currently, windows.py's get_jvm_dll_directory() does not look on JAVA_HOME. I 
think that it's reasonable that it should do so, as well as looking in the 
Windows registry like it does already. Maybe it should look at JAVA_HOME first, 
then continue looking in the registry if nothing is found ? Your JAVA_HOME 
traversal code should be added to get_jvm_dll_directory() so that all this 
logic is in one place.

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-13 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17491608#comment-17491608
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Hi!

The current --find-jvm-dll does not solve the issue.

I need to look into what --find-jvm-dll would do if using same logic and not 
JAVA_HOME, I am running several environments (conda) and would like to be sure 
that it accesses the right jvm, JAVA_HOME would seem like a way to ensure that 
it does indeed use the specified jvm? But the location of jvm within JAVA_HOME 
seems to vary a bit.. :)

 

 

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-12 Thread Andi Vajda (Jira)


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17491471#comment-17491471
 ] 

Andi Vajda commented on PYLUCENE-62:


It looks like finding the jvm.dll is an old problem on Windows and python 3.8 
just made it a bit worse. If you look in jcc3/__init__.py, which you modified 
in this patch, you can see that something similar is done when the 
--find-jvm-dll command line flag is set.
The code in jcc3/windows.py has something a bit more involved than just relying 
on JAVA_HOME to locale this DLL. I think you should update the 
add_jvm_dll_directory_to_path() to use the new python 3.8 add_dll_directory() 
function instead of its current messing with the Path environment variable. If 
you think of making --find-jvm-dll the default on Windows/python3.8, then the 
add_jvm_dll_directory_to_path() function in windows.py should verify that 
jvm.dll isn't already findable, before adding a DLL path if necessary.
Same issue with the changes in jcc3/python.py: you should not depend on 
JAVA_HOME but share the same logic in jcc3/windows.py (assuming that logic is 
still correct, of course).
In other words, does --find-jvm-dll work for you ? (without your patch).

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (PYLUCENE-62) Not finding jvm.dll on windows

2022-02-12 Thread Jira


[ 
https://issues.apache.org/jira/browse/PYLUCENE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17491402#comment-17491402
 ] 

Petrus Hyvönen commented on PYLUCENE-62:


Updates patch as the location of the fix was incorrect.

> Not finding jvm.dll on windows
> --
>
> Key: PYLUCENE-62
> URL: https://issues.apache.org/jira/browse/PYLUCENE-62
> Project: PyLucene
>  Issue Type: Bug
>Reporter: Petrus Hyvönen
>Priority: Major
> Attachments: add_dll_win.patch
>
>
> On recent versions of Python, the dll's seems to require to be added via the 
> os.add_dll_directory() function.
>  
> Apparently something changed in Python 3.8 regarding this, "Python 3.8 
> changed the DLL resolution order 
> [https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew];
> Thanks to:
> [https://github.com/conda-forge/python-feedstock/issues/552]
>  
> Proposed fix in a patch below. It can likely be rewritten in some more neat 
> way. :)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)