Tuesday, June 06, 2023

Re: NEW: devel/bazel

Or...set to MODJAVA_VERSION=17

--
Sent from a phone, apologies for poor formatting.

On 6 June 2023 09:05:40 Stuart Henderson <stu@spacehopper.org> wrote:

> On 2023/06/05 22:52, Matt Hildebrand wrote:
>> On Sun, Jun 4, 2023 at 11:22 AM Solène Rapenne <solene@perso.pw> wrote:
>>> I've been able to compile the port successfully, but if I run it by
>>> typing "bazel", I have the following error message:
>>>
>>> ERROR: couldn't find java at '/usr/local/bin/jdk-17/bin/java'
>>>
>>> I'm not sure why... I only have jdk-11 installed as a dependency.
>>
>> I think it's because of this limitation:
>> https://github.com/aldersondrive/bazel_openbsd_port/blob/ed6bf038b7c2a9a676ff88741f86cf431a653f18/bazel/pkg/DESCR#L14-L15
>>
>> It would probably be an improvement to search the PATH for `javac` if
>> JAVA_HOME is unset. Bazel does that on Linux. The FreeBSD port always
>> uses a fixed fallback path, though, and the OpenBSD port inherited
>> that behavior. If there's interest in the port I can probably send a
>> pull request to add the path-searching behavior upstream.
>
> Setting MODJAVA_VER = 11 in the port declares that it must work with
> 11 only, so if doing that it would be appropriate to patch to use the
> correct directory.
>
> I'd suggest instead setting it to 11+ and including a wrapper script
> that uses ports/java/javaPathHelper to set JAVA_HOME automatically based
> on the package dependency used when installing.

No comments:

Post a Comment