-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: maven rockcraft plugin #728
base: main
Are you sure you want to change the base?
Conversation
Add overrides for craft-part maven plugin to allow building Maven projects in rockcraft. Namely: - Do not link /bin/java as it conflicts with the base-files_base slice - Restrict PATH to /usr/bin in order to avoid picking up unwanted JVM. Use can override PATH in the plugin environment settings if /usr/bin is not sufficient.
Needs ci retry for lint task: |
- use -B to skip printing download logs
Log actual directory content and expected rock file name.
Maven plugin is overriden in rockcraft. Add rockcraft-specific instructions for the plugin.
- fix linter 'line too long' warnings
Note: linter exception in the logs is resolved by #732 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vpa1977 thanks for the PR. The main thing that's blocking me here is that the spread test project builds fine for me without the changes, which is weird because I've seen the issues that your code aims to fix in the past too.
Since you've worked with this plugin more recently, do you know of a project that would definitely not work without this rockcraft-custom plugin?
Co-authored-by: Tiago Nobrega <[email protected]>
Please refer to CI run https://github.com/canonical/rockcraft/actions/runs/11447589661/job/31850127130?pr=738 of #738. This draft PR adds only test and it fails building maven project second time. |
Do not touch path, just put /usr/bin as a priority
Ah I see, I missed the part where the second execution of |
Co-authored-by: Tiago Nobrega <[email protected]>
Co-authored-by: Tiago Nobrega <[email protected]>
This reverts commit bb08f27. Chisel slices do not install /usr/bin symlink as it will cause conflicts between different versions of jre slices.
As discussed during sprint, I am dropping part that restricts the path and will provide the fix as PR in for |
Maven plugin in rockcraft will work if we drop /bin/java symlink. The JAVA_HOME variable will be set by java plugin
build-packages: | ||
- maven | ||
- openjdk-21-jdk-headless | ||
# replace chiselled image modules with jlink output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain to me how this override-build is "replacing" the chiseled content with the jlink output? Wouldn't the cp
command just "add" the jlink files to the existing files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice:
stage-packages:
- openjdk-21-jre-headless_core
This adds ${CRAFT_PART_INSTALL}/usr/lib/jvm/java-21-openjdk-${CRAFT_ARCH_BUILD_FOR}
as far as I understand.
cp out/lib/modules ${CRAFT_PART_INSTALL}/usr/lib/jvm/java-21-openjdk-${CRAFT_ARCH_BUILD_FOR}/lib
replaces the module file with the one generated by jlink.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see, yes you're right
❯ ls -lah root/usr/lib/jvm/java-21-openjdk-amd64/lib/
total 135M
drwxr-xr-x 3 tiago tiago 4,0K nov 14 08:51 .
drwxr-xr-x 5 tiago tiago 4,0K nov 14 08:51 ..
-rwxr-xr-x 1 tiago tiago 15K nov 14 08:51 jexec
-rwxr-xr-x 1 tiago tiago 19K nov 14 08:51 jspawnhelper
lrwxrwxrwx 1 tiago tiago 34 nov 14 08:51 jvm.cfg -> /etc/java-21-openjdk/jvm-amd64.cfg
-rw-r--r-- 1 tiago tiago 17K nov 14 08:51 libextnet.so
-rw-r--r-- 1 tiago tiago 178K nov 14 08:51 libjava.so
-rw-r--r-- 1 tiago tiago 39K nov 14 08:51 libjimage.so
-rw-r--r-- 1 tiago tiago 77K nov 14 08:51 libjli.so
-rw-r--r-- 1 tiago tiago 17K nov 14 08:51 libjsig.so
-rw-r--r-- 1 tiago tiago 65K nov 14 08:51 libnet.so
-rw-r--r-- 1 tiago tiago 108K nov 14 08:51 libnio.so
-rw-r--r-- 1 tiago tiago 63K nov 14 08:51 libverify.so
-rw-r--r-- 1 tiago tiago 45K nov 14 08:51 libzip.so
-rw-r--r-- 1 tiago tiago 135M nov 14 08:51 modules
drwxr-xr-x 2 tiago tiago 4,0K nov 14 08:51 server
-rw-r--r-- 1 tiago tiago 102K nov 14 08:51 tzdb.dat
Moving this one to draft as it depends on JAVA_HOME PR in craft parts |
since this is going back to Draft, can you update the |
Add overrides for craft-part maven plugin to allow building Maven projects in rockcraft.
Namely:
The PR requires canonical/craft-parts#895