Page MenuHomeFreeBSD

Mk/**java.mk: Convert bsd.java.mk to USES
ClosedPublic

Authored by bofh on Dec 26 2024, 7:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 24, 5:04 PM
Unknown Object (File)
Wed, Jan 22, 1:31 AM
Unknown Object (File)
Tue, Jan 21, 3:37 AM
Unknown Object (File)
Sat, Jan 18, 2:52 PM
Unknown Object (File)
Fri, Jan 17, 6:40 PM
Unknown Object (File)
Fri, Jan 17, 4:47 PM
Unknown Object (File)
Fri, Jan 17, 4:47 PM
Unknown Object (File)
Fri, Jan 17, 4:46 PM
Subscribers

Details

Summary

The following features has been added or changed:

  • Instead of USE_JAVA use USES=java. This defaults to USES=java:build,run if NO_BUILD is undefined. Else it defaults to USES=java:run
  • Instead of USE_ANT=yes use USES=java:ant which also implies USES=java:build
  • Instead of JAVA_BUILD=yes use USES=java:build. Does not imply run or extract
  • Instead of JAVA_EXTRACT=yes use USES=java:extract does not imply build or run
  • Instead of JAVA_RUN=yes use USES=java:run does not imply extract or build
  • Instead of USE_JAVA=<version> use USES=java and JAVA_VERSION=<version>
  • If needed I can share the big patch which is additional changes in 532 files but it really does not make too much sense
Test Plan
  1. bulk -a -n works fine. https://pkg.bofh.network/build.html?mastername=141-java&build=2024-12-26_19h39m59s
  2. Ports with USE_JAVA is https://pkg.bofh.network/build.html?mastername=141-java&build=2024-12-26_19h39m59s

There are some ports which are failing to build but those are due to the case I am using bulk -t. There are also some ports which are BROKEN at the moment. After this change there is actually only one port which I cannot fix which is cad/digital and I think it is a trivial port to concentrate on at this point. I believe @yuri is competent enough to fix this once this lands. As my knowledge on maven is a bit rusty nowadays.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bofh requested review of this revision.Dec 26 2024, 7:20 PM
bofh created this revision.

Update diff after hooking openjdk22 into the system.

Good to see this change. I'm not all that familiar with the Make infrastructure, so my review perhaps isn't all that helpful, but this looks good to me. FWIW, the USES_JAVA=<version> stuff has been deprecated in favour of JAVA_VERSION=<version> for a long time, so hopefully there isn't much of that left.

This revision is now accepted and ready to land.Dec 27 2024, 5:42 PM

This looks promising.
Could you update the diff with either using arcanist or git diff -U9999 so we get context ?

This revision now requires review to proceed.Dec 27 2024, 7:42 PM
In D48201#1099460, @mat wrote:

This looks promising.
Could you update the diff with either using arcanist or git diff -U9999 so we get context ?

@mat Updated with full context.

It would be nice to really make use of the USES framework by using arguments, I think the JAVA_VERSION, JAVA_BUILD, JAVA_EXTRACT, JAVA_RUN and probably the USE_ANT variable should be turned into USES=java arguments, like USES=java:18+,build.

In D48201#1099478, @mat wrote:

It would be nice to really make use of the USES framework by using arguments, I think the JAVA_VERSION, JAVA_BUILD, JAVA_EXTRACT, JAVA_RUN and probably the USE_ANT variable should be turned into USES=java arguments, like USES=java:18+,build.

I do plan to implement those gradually as the patch is too big to be handled in one single go and possibilities of introducing mistakes.

Just to add to my comments we need to do the following:

  • The version handling needs to be rewritten from scratch as currently it also handles space separated lists which are not desirable for our USES framework. Plus there are lots of conditionals that we need to add. Like we have to check if it mentions JAVA_OS=linux and asks for JAVA_VERSION=11 it should be ignored.
  • The implementation of JAVA_BUILD and JAVA_RUN is confusing specially assigning JAVA_BUILD=jdk and assigning JAVA_RUN=jre which is being abused by port developers.
  • But at the moment I need to touch almost 530+ files and I want to push this before the quarterly split and gradually improve this as the rebase is a tedious process for so many files.

Just to add to my comments we need to do the following:

  • The version handling needs to be rewritten from scratch as currently it also handles space separated lists which are not desirable for our USES framework. Plus there are lots of conditionals that we need to add. Like we have to check if it mentions JAVA_OS=linux and asks for JAVA_VERSION=11 it should be ignored.
  • The implementation of JAVA_BUILD and JAVA_RUN is confusing specially assigning JAVA_BUILD=jdk and assigning JAVA_RUN=jre which is being abused by port developers.
  • But at the moment I need to touch almost 530+ files and I want to push this before the quarterly split and gradually improve this as the rebase is a tedious process for so many files.

I can hold off branching 2025Q1

I can hold off branching 2025Q1

I am nearly done converting some keywords specially ant, extract, build and run. Running a mini exp-run and plan to send the updated patch by tonight.

bofh edited the summary of this revision. (Show Details)

Converted some of the keywords to args. USE_ANT, JAVA_BUILD, JAVA_RUN and JAVA_EXTRACT has been converted to respected keywords ant, build, extract and run. The version scheme has not been handled in this case. The version handling needs some discussion with other developers as there are corner cases of using disperse versioning which requires space separated version number and does not really align with our USES framework versioning like <version>+ or -<version> or <min>-<max> scheme.

In D48201#1099478, @mat wrote:

It would be nice to really make use of the USES framework by using arguments, I think the JAVA_VERSION, JAVA_BUILD, JAVA_EXTRACT, JAVA_RUN and probably the USE_ANT variable should be turned into USES=java arguments, like USES=java:18+,build.

Except version everything has been converted to respective arguments.

mat accepted this revision as: portmgr.EditedMon, Dec 30, 8:17 PM
In D48201#1099478, @mat wrote:

It would be nice to really make use of the USES framework by using arguments, I think the JAVA_VERSION, JAVA_BUILD, JAVA_EXTRACT, JAVA_RUN and probably the USE_ANT variable should be turned into USES=java arguments, like USES=java:18+,build.

Except version everything has been converted to respective arguments.

Oh, thank you, I was perfectly happy with waiting for the other variables to be converted later.

For JAVA_VERSION, having USES=java:17,18,build would have java_ARGS=17 18 build, so it should be easy to convert. That being said, I'd rather have this now and the JAVA_VERSION later if it means having to delay 2025Q1.

Oh, please add a entry to the CHANGES file too.

Whatever is in the review description will do just fine for the CHANGES entry.

I do have the necessary CHANGES entry just not attached it here for keeping it clutter free. I will rerun one more mini exp tomorrow and commit.

Great, thank you for this work.

This revision was not accepted when it landed; it landed in state Needs Review.Wed, Jan 8, 7:04 PM
This revision was automatically updated to reflect the committed changes.