NightOwl888 commented on issue #851:
URL: https://github.com/apache/lucenenet/issues/851#issuecomment-1546627315

   This is basically a duplicate of 
[#460](https://github.com/apache/lucenenet/issues/460), except that issue 
provides more details about options we could consider and this is the option 
that we will probably ultimately go with.
   
   It is no longer recommend putting IKVM Maven-hosted libraries on NuGet. So 
we technically should no longer use 
[OpenNLP.NET](https://github.com/sergey-tihon/OpenNLP.NET).
   
   Instead, there is now a `<MavenReference>` that can be used like 
`<PackageReference>`. This option downloads the library from Maven and converts 
it on the fly to IL code. It also resolves the correct version of the Maven 
components to use based on any other Maven dependencies.
   
   ```xml
     <ItemGroup>
       <PackageReference Include="IKVM.Maven.Sdk" 
Version="8.5.0-prerelease0001" />
     </ItemGroup>
     
     <ItemGroup>
       <MavenReference Include="org.apache.opennlp:opennlp-tools" 
Version="1.9.4" />
     </ItemGroup>
   ```
   
   That being said, there have been some reports of some libraries not being 
able to be built on macOS with IKVM. Using the 
[OpenNLP.NET](https://github.com/sergey-tihon/OpenNLP.NET) library circumvents 
that problem because we are depending on a compiled library that doesn't need 
to be built when a macOS machine references us.
   
   There has been some work in https://github.com/ikvmnet/ikvm/pull/311 to get 
it building on macOS, but I am not sure how ready it is. I am also not sure if 
the problems even come into play for `opennlp-tools` or any of the other 
opennlp packages. I have done some testing, but haven't yet run into any issues 
on macOS.
   
   Of course, moving from 
[OpenNLP.NET](https://github.com/sergey-tihon/OpenNLP.NET) to 
`<MavenReference>` is a breaking change for anyone that depends on us. So, we 
should aim to migrate sooner rather than later, even if macOS support isn't yet 
ready.
   
   > NOTE: The [lucene-analyzers-opennlp 
package](https://mvnrepository.com/artifact/org.apache.lucene/lucene-analyzers-opennlp/8.2.0)
 references only 
[opennlp-tools](https://mvnrepository.com/artifact/org.apache.opennlp/opennlp-tools/1.9.1).
 However, [OpenNLP.NET](https://github.com/sergey-tihon/OpenNLP.NET) packs all 
OpenNLP packages into the same DLL. It is possible users may need to use other 
opennlp packages from Maven depending on their requirements. `<MavenReference>` 
helps to ensure all of these other packages and any opennlp dependencies are 
version and API compatible.
   
   > NOTE: We should probably aim to use the latest stable version of 
`IKVM.Maven.Sdk`. Releases happen fairly frequently, thanks to Jerome. I 
suspect it will be out of pre-release before we are ready to roll 
4.8.0-beta00017. The latest pre-release updates to a more recent version of 
Java SE 8, which probably contains lots of security patches the older one 
doesn't have.
   
   ### Testing macOS Builds
   
   We can test to ensure that builds will work on macOS. However, I would 
suggest making a temporary change to ensure that it works and then revert it 
once we have it confirmed.
   
   For Azure DevOps, we have it set up to always build on Windows, but that 
should be easy to change 
[here](https://github.com/apache/lucenenet/blob/33b40ab102aa28d47b4fce89c12e62b01e3f7439/azure-pipelines.yml#L102).
 This has never been tested AFAIK, so there is a chance that it won't work due 
to some other scripting issue.
   
   For GitHub Actions, the test projects are built on the fly on the same 
platform they are tested on. All that we would need to test an IKVM build on 
macOS is to run the generation script and pass in `@('windows-latest', 
'ubuntu-latest', 'macos-latest')` 
[here](https://github.com/apache/lucenenet/blob/33b40ab102aa28d47b4fce89c12e62b01e3f7439/.github/workflows/Generate-TestWorkflows.ps1#L73).
 This has already been tested, so it should "just work".
   
   ### Fallback Plan
   
   If we have a problem building on macOS, we can report the issue to 
[IKVM](https://github.com/ikvmnet/ikvm).
   
   If the build issue isn't fixed before the 4.8.0-beta00017 release, we can 
revert to using OpenNLP.NET for the time being using the changes from #852. 
Fortunately, this package doesn't have a lot of downloads, so the switch back 
to `<MavenReference>` later won't affect many users.
   
   Alternatively, we could just release with `<MavenReference>` and when IKVM 
is patched it will be possible to build on macOS by adding a direct 
`<PackageReference>` to a specific version of IKVM that has the patch.


-- 
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: dev-unsubscr...@lucenenet.apache.org

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

Reply via email to