Mailing List Archive

Lucene 9.2.0 build fails on Windows
Hello,
I am using gitbash to build lucene 9.2.0 on Windows. I checked out the
release/lucene/9.2.0 tag and tried running "./gradlew help". But it fails.
Running Java 11.0.4. Somehow building lucene 9x on Windows has never worked
for me. Had the same issue with 9.0.0 as well.

mypc@mypc MINGW64 /c/work/snap/git/Lucene_9_2/lucene (lucene_9.2_local)
$* ./gradlew help*
Downloading gradle-wrapper.jar from
https://github.com/gradle/gradle/raw/v7.3.3/gradle/wrapper/gradle-wrapper.jar
To honour the JVM settings for this build a single-use Daemon process will
be forked. See
https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon
.
Daemon will be stopped at the end of the build

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'lucene-root'.
> A problem occurred configuring project ':lucene:misc:native'.
> java.lang.NullPointerException (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
2 actionable tasks: 2 executed

mypc@mypc MINGW64 /c/work/snap/git/Lucene_9_2/lucene (lucene_9.2_local)
$ java -version
java version "11.0.4" 2019-07-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
It does work just fine. Use cmd or powershell though. I don't think
things are even tested with cygwin/msys.

Dawid

On Tue, Sep 13, 2022 at 4:55 AM Rahul Goswami <rahul196452@gmail.com> wrote:
>
> Hello,
> I am using gitbash to build lucene 9.2.0 on Windows. I checked out the
> release/lucene/9.2.0 tag and tried running "./gradlew help". But it fails.
> Running Java 11.0.4. Somehow building lucene 9x on Windows has never worked
> for me. Had the same issue with 9.0.0 as well.
>
> mypc@mypc MINGW64 /c/work/snap/git/Lucene_9_2/lucene (lucene_9.2_local)
> $* ./gradlew help*
> Downloading gradle-wrapper.jar from
> https://github.com/gradle/gradle/raw/v7.3.3/gradle/wrapper/gradle-wrapper.jar
> To honour the JVM settings for this build a single-use Daemon process will
> be forked. See
> https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon
> .
> Daemon will be stopped at the end of the build
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> A problem occurred configuring root project 'lucene-root'.
> > A problem occurred configuring project ':lucene:misc:native'.
> > java.lang.NullPointerException (no error message)
>
> * Try:
> > Run with --stacktrace option to get the stack trace.
> > Run with --info or --debug option to get more log output.
> > Run with --scan to get full insights.
>
> * Get more help at https://help.gradle.org
>
> BUILD FAILED in 13s
> 2 actionable tasks: 2 executed
>
> mypc@mypc MINGW64 /c/work/snap/git/Lucene_9_2/lucene (lucene_9.2_local)
> $ java -version
> java version "11.0.4" 2019-07-16 LTS
> Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
> Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
Hi Dawid,
I tried with Gitbash only after "gradlew help" failed on cmd. Just now
tried Powershell as well and get the exact same error message.
The steps I performed were, clone the repo -> create a branch from tag
"releases/lucene/9.2.0" -> Run "gradlew help"

If you need additional stacktrace or other diagnostics I am happy to
provide the same.

Thanks,
Rahul

On Tue, Sep 13, 2022 at 11:37 AM Dawid Weiss <dawid.weiss@gmail.com> wrote:

> It does work just fine. Use cmd or powershell though. I don't think
> things are even tested with cygwin/msys.
>
> Dawid
>
> On Tue, Sep 13, 2022 at 4:55 AM Rahul Goswami <rahul196452@gmail.com>
> wrote:
> >
> > Hello,
> > I am using gitbash to build lucene 9.2.0 on Windows. I checked out the
> > release/lucene/9.2.0 tag and tried running "./gradlew help". But it
> fails.
> > Running Java 11.0.4. Somehow building lucene 9x on Windows has never
> worked
> > for me. Had the same issue with 9.0.0 as well.
> >
> > mypc@mypc MINGW64 /c/work/snap/git/Lucene_9_2/lucene (lucene_9.2_local)
> > $* ./gradlew help*
> > Downloading gradle-wrapper.jar from
> >
> https://github.com/gradle/gradle/raw/v7.3.3/gradle/wrapper/gradle-wrapper.jar
> > To honour the JVM settings for this build a single-use Daemon process
> will
> > be forked. See
> >
> https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon
> > .
> > Daemon will be stopped at the end of the build
> >
> > FAILURE: Build failed with an exception.
> >
> > * What went wrong:
> > A problem occurred configuring root project 'lucene-root'.
> > > A problem occurred configuring project ':lucene:misc:native'.
> > > java.lang.NullPointerException (no error message)
> >
> > * Try:
> > > Run with --stacktrace option to get the stack trace.
> > > Run with --info or --debug option to get more log output.
> > > Run with --scan to get full insights.
> >
> > * Get more help at https://help.gradle.org
> >
> > BUILD FAILED in 13s
> > 2 actionable tasks: 2 executed
> >
> > mypc@mypc MINGW64 /c/work/snap/git/Lucene_9_2/lucene (lucene_9.2_local)
> > $ java -version
> > java version "11.0.4" 2019-07-16 LTS
> > Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
> > Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
Hi Rahul,

Well, that's weird.

> "releases/lucene/9.2.0" -> Run "gradlew help"
>
> If you need additional stacktrace or other diagnostics I am happy to
> provide the same.

Could you do the following:

1) run: git --version so that we're on the same page as to what the
git version is (I don't think this matters),
2) run: gradlew help --stacktrace

Step (2) should provide the exact place that fails. Something is
definitely wrong because I'm on Windows and it works for me like a
charm.

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
Hi Dawid,
I believe you. Just that for some reason I have never been able to get it
to work on Windows. Also, being a complete newbie to gradle doesn't help
much. So would appreciate some help on this while I find my footing. Here
is the link to the diagnostics that you requested (since attachments/images
won't make it through):

https://drive.google.com/file/d/15pt9Qt1H98gOvA5e0NrtY8YYHao0lgdM/view?usp=sharing


Thanks,
Rahul

On Tue, Sep 13, 2022 at 1:18 PM Dawid Weiss <dawid.weiss@gmail.com> wrote:

> Hi Rahul,
>
> Well, that's weird.
>
> > "releases/lucene/9.2.0" -> Run "gradlew help"
> >
> > If you need additional stacktrace or other diagnostics I am happy to
> > provide the same.
>
> Could you do the following:
>
> 1) run: git --version so that we're on the same page as to what the
> git version is (I don't think this matters),
> 2) run: gradlew help --stacktrace
>
> Step (2) should provide the exact place that fails. Something is
> definitely wrong because I'm on Windows and it works for me like a
> charm.
>
> Dawid
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
Looks to me like a gradle bug, detecting and trying to run some visual
studio command (vswhere.exe) elsewhere on your system, and it does the
wrong thing parsing its output.

On Tue, Sep 13, 2022 at 3:00 PM Rahul Goswami <rahul196452@gmail.com> wrote:
>
> Hi Dawid,
> I believe you. Just that for some reason I have never been able to get it
> to work on Windows. Also, being a complete newbie to gradle doesn't help
> much. So would appreciate some help on this while I find my footing. Here
> is the link to the diagnostics that you requested (since attachments/images
> won't make it through):
>
> https://drive.google.com/file/d/15pt9Qt1H98gOvA5e0NrtY8YYHao0lgdM/view?usp=sharing
>
>
> Thanks,
> Rahul
>
> On Tue, Sep 13, 2022 at 1:18 PM Dawid Weiss <dawid.weiss@gmail.com> wrote:
>
> > Hi Rahul,
> >
> > Well, that's weird.
> >
> > > "releases/lucene/9.2.0" -> Run "gradlew help"
> > >
> > > If you need additional stacktrace or other diagnostics I am happy to
> > > provide the same.
> >
> > Could you do the following:
> >
> > 1) run: git --version so that we're on the same page as to what the
> > git version is (I don't think this matters),
> > 2) run: gradlew help --stacktrace
> >
> > Step (2) should provide the exact place that fails. Something is
> > definitely wrong because I'm on Windows and it works for me like a
> > charm.
> >
> > Dawid
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
It is a bug in gradle. If you look at the stack trace, it's clearly
just happily logging a missing output and returns null:

https://github.com/gradle/gradle/blob/v7.3.3/subprojects/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/version/CommandLineToolVersionLocator.java#L86-L89

which then propagates up as NPE in parseJson:

https://github.com/gradle/gradle/blob/v7.3.3/subprojects/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/version/CommandLineToolVersionLocator.java#L59-L60

I filed an issue here - https://github.com/gradle/gradle/issues/21993
- but I really don't have high hopes - my other issues pointing at
clear bugs have been pretty much ignored.

What's worse, I'm not even sure how to help you... you need to figure
out why that 'vswhere' script is returning an error on your machine.

Dawid

On Tue, Sep 13, 2022 at 9:21 PM Robert Muir <rcmuir@gmail.com> wrote:
>
> Looks to me like a gradle bug, detecting and trying to run some visual
> studio command (vswhere.exe) elsewhere on your system, and it does the
> wrong thing parsing its output.
>
> On Tue, Sep 13, 2022 at 3:00 PM Rahul Goswami <rahul196452@gmail.com> wrote:
> >
> > Hi Dawid,
> > I believe you. Just that for some reason I have never been able to get it
> > to work on Windows. Also, being a complete newbie to gradle doesn't help
> > much. So would appreciate some help on this while I find my footing. Here
> > is the link to the diagnostics that you requested (since attachments/images
> > won't make it through):
> >
> > https://drive.google.com/file/d/15pt9Qt1H98gOvA5e0NrtY8YYHao0lgdM/view?usp=sharing
> >
> >
> > Thanks,
> > Rahul
> >
> > On Tue, Sep 13, 2022 at 1:18 PM Dawid Weiss <dawid.weiss@gmail.com> wrote:
> >
> > > Hi Rahul,
> > >
> > > Well, that's weird.
> > >
> > > > "releases/lucene/9.2.0" -> Run "gradlew help"
> > > >
> > > > If you need additional stacktrace or other diagnostics I am happy to
> > > > provide the same.
> > >
> > > Could you do the following:
> > >
> > > 1) run: git --version so that we're on the same page as to what the
> > > git version is (I don't think this matters),
> > > 2) run: gradlew help --stacktrace
> > >
> > > Step (2) should provide the exact place that fails. Something is
> > > definitely wrong because I'm on Windows and it works for me like a
> > > charm.
> > >
> > > Dawid
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
Hi,

do you have Microsoft Visual Studio installed? It looks like Gradle
tries to detect it and fails with some NullPointerException while
parsing a JSON file from its instalation.

The misc module contains some (optional) native code that will get
compiled (optionally) with Visual C++. It looks like thiat breaks.

I have no idea how to fix this. Dawid: Maybe we can also make the
configuration of that native stuff only opt-in? So only detect Visual
Studio when you actively activate native code compilation?

Uwe

Am 13.09.2022 um 21:00 schrieb Rahul Goswami:
> Hi Dawid,
> I believe you. Just that for some reason I have never been able to get it
> to work on Windows. Also, being a complete newbie to gradle doesn't help
> much. So would appreciate some help on this while I find my footing. Here
> is the link to the diagnostics that you requested (since attachments/images
> won't make it through):
>
> https://drive.google.com/file/d/15pt9Qt1H98gOvA5e0NrtY8YYHao0lgdM/view?usp=sharing
>
>
> Thanks,
> Rahul
>
> On Tue, Sep 13, 2022 at 1:18 PM Dawid Weiss <dawid.weiss@gmail.com> wrote:
>
>> Hi Rahul,
>>
>> Well, that's weird.
>>
>>> "releases/lucene/9.2.0" -> Run "gradlew help"
>>>
>>> If you need additional stacktrace or other diagnostics I am happy to
>>> provide the same.
>> Could you do the following:
>>
>> 1) run: git --version so that we're on the same page as to what the
>> git version is (I don't think this matters),
>> 2) run: gradlew help --stacktrace
>>
>> Step (2) should provide the exact place that fails. Something is
>> definitely wrong because I'm on Windows and it works for me like a
>> charm.
>>
>> Dawid
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
--
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: uwe@thetaphi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
I opened an issue with one idea of how we can fix this, for
discussion: https://github.com/apache/lucene/issues/11772

On Wed, Sep 14, 2022 at 11:27 AM Uwe Schindler <uwe@thetaphi.de> wrote:
>
> Hi,
>
> do you have Microsoft Visual Studio installed? It looks like Gradle
> tries to detect it and fails with some NullPointerException while
> parsing a JSON file from its instalation.
>
> The misc module contains some (optional) native code that will get
> compiled (optionally) with Visual C++. It looks like thiat breaks.
>
> I have no idea how to fix this. Dawid: Maybe we can also make the
> configuration of that native stuff only opt-in? So only detect Visual
> Studio when you actively activate native code compilation?
>
> Uwe
>
> Am 13.09.2022 um 21:00 schrieb Rahul Goswami:
> > Hi Dawid,
> > I believe you. Just that for some reason I have never been able to get it
> > to work on Windows. Also, being a complete newbie to gradle doesn't help
> > much. So would appreciate some help on this while I find my footing. Here
> > is the link to the diagnostics that you requested (since attachments/images
> > won't make it through):
> >
> > https://drive.google.com/file/d/15pt9Qt1H98gOvA5e0NrtY8YYHao0lgdM/view?usp=sharing
> >
> >
> > Thanks,
> > Rahul
> >
> > On Tue, Sep 13, 2022 at 1:18 PM Dawid Weiss <dawid.weiss@gmail.com> wrote:
> >
> >> Hi Rahul,
> >>
> >> Well, that's weird.
> >>
> >>> "releases/lucene/9.2.0" -> Run "gradlew help"
> >>>
> >>> If you need additional stacktrace or other diagnostics I am happy to
> >>> provide the same.
> >> Could you do the following:
> >>
> >> 1) run: git --version so that we're on the same page as to what the
> >> git version is (I don't think this matters),
> >> 2) run: gradlew help --stacktrace
> >>
> >> Step (2) should provide the exact place that fails. Something is
> >> definitely wrong because I'm on Windows and it works for me like a
> >> charm.
> >>
> >> Dawid
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> --
> Uwe Schindler
> Achterdiek 19, D-28357 Bremen
> https://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
> I have no idea how to fix this. Dawid: Maybe we can also make the
> configuration of that native stuff only opt-in? So only detect Visual
> Studio when you actively activate native code compilation?

It is an opt-in, actually. The problem is: gradle fails on applying the
plugin - even if the tasks are ignored.

I'm +1 to remove the native thing entirely if nobody is using it and
there are no benefits to keeping it maintained.

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
Uwe, Dawid, and Robert,
Thank you for the helpful pointers! I do have Visual Studio 2017 on my
machine which I don't use much lately.

https://github.com/microsoft/vswhere
*"vswhere* is included with the installer as of Visual Studio 2017 version
15.2 and later, and can be found at the following location:
%ProgramFiles(x86)%\Microsoft
Visual Studio\Installer\vswhere.exe."

From the Gradle github you shared, looks like it first tries to locate
vswhere on the machine and execute some command on it. If not found it just
returns an empty list. So I removed vxwhere.exe from the path and builds
are successful now! Although this is a stop gap measure, it will work for
me. Thanks a lot!

https://github.com/gradle/gradle/blob/v7.3.3/subprojects/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/version/CommandLineToolVersionLocator.java#L63

-Rahul

On Wed, Sep 14, 2022 at 11:51 AM Dawid Weiss <dawid.weiss@gmail.com> wrote:

> > I have no idea how to fix this. Dawid: Maybe we can also make the
> > configuration of that native stuff only opt-in? So only detect Visual
> > Studio when you actively activate native code compilation?
>
> It is an opt-in, actually. The problem is: gradle fails on applying the
> plugin - even if the tasks are ignored.
>
> I'm +1 to remove the native thing entirely if nobody is using it and
> there are no benefits to keeping it maintained.
>
> Dawid
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: Lucene 9.2.0 build fails on Windows [ In reply to ]
Yeah, no problem. It's dumb that this is needed - thanks for reporting
and sorry for not having more faith in what you were saying. I should
have known better than believing in computers being predictable.

Dawid

On Wed, Sep 14, 2022 at 6:40 PM Rahul Goswami <rahul196452@gmail.com> wrote:
>
> Uwe, Dawid, and Robert,
> Thank you for the helpful pointers! I do have Visual Studio 2017 on my
> machine which I don't use much lately.
>
> https://github.com/microsoft/vswhere
> *"vswhere* is included with the installer as of Visual Studio 2017 version
> 15.2 and later, and can be found at the following location:
> %ProgramFiles(x86)%\Microsoft
> Visual Studio\Installer\vswhere.exe."
>
> From the Gradle github you shared, looks like it first tries to locate
> vswhere on the machine and execute some command on it. If not found it just
> returns an empty list. So I removed vxwhere.exe from the path and builds
> are successful now! Although this is a stop gap measure, it will work for
> me. Thanks a lot!
>
> https://github.com/gradle/gradle/blob/v7.3.3/subprojects/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/version/CommandLineToolVersionLocator.java#L63
>
> -Rahul
>
> On Wed, Sep 14, 2022 at 11:51 AM Dawid Weiss <dawid.weiss@gmail.com> wrote:
>
> > > I have no idea how to fix this. Dawid: Maybe we can also make the
> > > configuration of that native stuff only opt-in? So only detect Visual
> > > Studio when you actively activate native code compilation?
> >
> > It is an opt-in, actually. The problem is: gradle fails on applying the
> > plugin - even if the tasks are ignored.
> >
> > I'm +1 to remove the native thing entirely if nobody is using it and
> > there are no benefits to keeping it maintained.
> >
> > Dawid
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >

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