Skip to content

Add arm 64 linux runner#13258

Merged
Siedlerchr merged 49 commits into
mainfrom
addArm64
Jun 15, 2025
Merged

Add arm 64 linux runner#13258
Siedlerchr merged 49 commits into
mainfrom
addArm64

Conversation

@Siedlerchr

@Siedlerchr Siedlerchr commented Jun 4, 2025

Copy link
Copy Markdown
Member

Fixes #10842

https://github.com/actions/partner-runner-images/blob/main/images/arm-ubuntu-22-image.md

In about one to three sentences, describe the changes you have made: what, where, why, ...

Steps to test

Describe how reviewers can test this fix/feature. Ideally, think of how you would guide a beginner user of Jabef to try out your change.
You can add screenshots or videos (using Loom or by just adding .mp4 files).

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • [/] Manually tested changed features in running JabRef (always required)
  • [/] Screenshots added in PR description (if change is visible to the user)
  • [/] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • [/] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr

Siedlerchr commented Jun 4, 2025

Copy link
Copy Markdown
Member Author

Still some issues with the module exporting:

The correct architecture should be picked because the architecture check print gives the right infomration

Using aarch66

The input changes require a full rebuild for incremental task ':jabgui:compileJava'.
Compilation mode: default, forking compiler
Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
Compiling with toolchain '/home/runner/.gradle/jdks/azul_systems__inc_-24-aarch64-linux.2'.
Compiling with JDK Java compiler API.

/home/runner/work/jabref/jabref/jabgui/src/main/java/org/jabref/gui/actions/ActionFactory.java:20: error: package com.sun.javafx.scene.control is not visible
import com.sun.javafx.scene.control.ContextMenuContent;
                           ^
  (package com.sun.javafx.scene.control is declared in module javafx.controls, which does not export it to module org.jabref)
/home/runner/work/jabref/jabref/jabgui/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorContextAction.java:19: error: package com.sun.javafx.scene.control is not visible
import com.sun.javafx.scene.control.Properties;
> Task :jabgui:compileJava FAILED
                           ^
gradle/actions: Writing build results to /home/runner/work/_temp/.gradle-actions/build-results/__run_3-1749064857597.json
  (package com.sun.javafx.scene.control is declared in module javafx.controls, which does not export it to module org.jabref)
2 errors


* What went wrong:
Execution failed for task ':jabgui:compileJava'.
> Compilation failed; see the compiler output below.
  /home/runner/work/jabref/jabref/jabgui/src/main/java/org/jabref/gui/actions/ActionFactory.java:20: error: package com.sun.javafx.scene.control is not visible
  import com.sun.javafx.scene.control.ContextMenuContent;
                             ^
    (package com.sun.javafx.scene.control is declared in module javafx.controls, which does not export it to module org.jabref)
  2 errors

@Siedlerchr

Copy link
Copy Markdown
Member Author

@jjohannes Sorry to bother you again, but do you have any idea why the arm build is failing. Am I missing something? I just added a new target for arm in the conventions gradle. Locally on my computer I see that the task is registered.

grafik

@jjohannes

Copy link
Copy Markdown
Collaborator

@Siedlerchr your change is correct. It should not lead to compile failing. If I test this locally – by manually switching to the new target – the compilation works with the linux-aarch64 Jar.

The error indicates that it uses the original Jar and not the transformed one (of javafx.controls). But it should use the transformed one ans it does in my local test.

One idea: There are sometimes timing problems with the transformation mechanisms if other plugins access things too eagerly. Maybe something like this is happening. Maybe it does not work 100% well together with org.beryx.jlink. But we would have to analyze this more closely. (When I find the time soonish, I will have a look).
For reference: gradlex-org/extra-java-module-info#106 (and other issues linked from there).

For now, maybe it helps just rerunning the build. The only thing that is different in the target is that it is completely new and the Jars have never been downloaded/cached before. Although I don't understand why the other things work well in the GH context where things may always be rebuilt...

A temporary remedy could also be to first run a ./gradlew assemble before running the :jabgui:prepareModulesDir in a second step afterwards (in which mosts tasks will be UP-TO-DATE).


// Source: https://github.com/jjohannes/java-module-system/blob/main/gradle/plugins/src/main/kotlin/targets.gradle.kts
// Configure variants for OS
// Configure variants for OS. target name can be any just must

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added sentence seems to be incomplete?

Comment thread build-logic/src/main/kotlin/buildlogic.java-common-conventions.gradle.kts Outdated
@koppor koppor added dev: binaries Binary builds should be uploaded to builds.jabref.org dev: build-system dev: ci-cd labels Jun 5, 2025
@koppor

koppor commented Jun 7, 2025

Copy link
Copy Markdown
Member
   (package com.sun.javafx.scene.control is declared in module javafx.controls, which does not export it to module org.jabref)
/home/runner/work/jabref/jabref/jabgui/src/main/java/org/jabref/gui/fieldeditors/contextmenu/EditorContextAction.java:19: error: package com.sun.javafx.scene.control is not visible
import com.sun.javafx.scene.control.Properties;

But we patch it in build-logic\bin\main\buildlogic.java-common-conventions.gradle.kts

Thus, it seems an issue with https://github.com/gradlex-org/extra-java-module-info, isn't it @jjohannes ?

@jjohannes

Copy link
Copy Markdown
Collaborator

@koppor it looks like the compiler is not using the transformed Jar. But I cannot reproduce the issue. If I manually set the target to ubuntu-22.04-arm on my machine here, ./gradlew assemble works.

Comment thread jablib/src/main/java/org/jabref/generators/JournalListMvGenerator.java Outdated
public class CitationStyleCatalogGenerator {
private static final String STYLES_ROOT = "/csl-styles";
private static final String CATALOG_PATH = "build/resources/main/citation-style-catalog.json";
private static final String CATALOG_PATH = "build/generated/resources/citation-style-catalog.json";

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is correct? This will break at runtime I think

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because this is part of the source sets - see the whole diff for build.gradle.kts

@Siedlerchr Siedlerchr reopened this Jun 12, 2025
Comment thread .github/workflows/binaries.yml Outdated
displayName: macOS (ARM64)
suffix: '_arm64'
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os == 'ubuntu-22.04-arm' && 'ubuntu-22.04' || matrix.os }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the wrong approach, it loads the wrong jdk
grafik

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the wrong approach, it loads the wrong jdk

If we stay on cross compiling:

  1. JDK does has to match runner OS (currently happening)
  2. JMODs of target OS have to be downloaded
  3. jpackage (jlink?) has to be taught to use the downloaded JMODs instead of the ones shipped with the JDK.

Reason: .class files are portable, JMODs are platform-specific. Exceptional behavior for javafx jars is handled by some gradlex plugin.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. is wrong. It download amd jdk for arm -> wrong

I did a PR here to test this with ubuntu arm and it seemed to work jjohannes/java-module-system#2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jpackage (jlink?) has to be taught to use the downloaded JMODs instead of the ones shipped with the JDK.

Is this possible? (If yes, do you have a link to documentation how to do this?)
My understanding it that it is not. That's why the packaging task has the validation that fails if you run it on the wrong os/arch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjohannes thank you so much for the effort taken!! We should have known it, because we switch back and forth JDKs and are "aware" of JavaFX being packed. Maybe we try with our good old friend LibericaJDK without (!) JavaFX. - Thank you again for your patience. We will pick up from here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took another look at the pipeline today and it seesm that gradle downloads the zulu java with javafx https://api.foojay.io/disco/v3.0/ids/796901cbf89fc850a3f3bb8ddfe4506c/redirect
That resolves to zulu24.30.13-ca-fx-jdk24.0.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gradle downloads zulu, because we use the foojay gradle toolchain plugin. You changed to amazon at 3a3097a (#13258).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Background: We try to keep the runtime for the build system (gradle) and the compiler used by gradle (JDK in toolchain) in version sync, but not necessarily always in JDK sync. Sometimes, we even update the JDK used by gradle (See gradle/gradle#33310).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the problem was that gradle downloads a zulu version which includes javafx through the foojay resolver plugin and thus we didn't use the openjfx from maven central

@koppor

koppor commented Jun 14, 2025

Copy link
Copy Markdown
Member

On maven central, only linux amd64 build should be published; reason: JabRef .class files are re-usable across different platforms; no need to publish for mac, linux, windows.

Therefore, I had the excact check for ubuntu-22.04 (and removed startsWith)

@Siedlerchr

Copy link
Copy Markdown
Member Author

On maven central, only linux amd64 build should be published; reason: JabRef .class files are re-usable across different platforms; no need to publish for mac, linux, windows.

I don't see any changes I did for this. Maybe I overlooked something?

@koppor

koppor commented Jun 14, 2025

Copy link
Copy Markdown
Member

On maven central, only linux amd64 build should be published; reason: JabRef .class files are re-usable across different platforms; no need to publish for mac, linux, windows.

I don't see any changes I did for this. Maybe I overlooked something?

d4b2ef7 (#13258)

image

publish...MavenCentral publishes to maven central. Should only run on ubuntu-22.04 - not ubuntu-22.04-arm.

@trag-bot

trag-bot Bot commented Jun 14, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@github-actions

Copy link
Copy Markdown
Contributor

The build of this PR is available at https://builds.jabref.org/pull/13258/merge.

@Siedlerchr

Copy link
Copy Markdown
Member Author

Argh:
Now we still have some duplicate stuff, that comes from the repack I think
grafik

@Siedlerchr

Copy link
Copy Markdown
Member Author

But it works now
grafik

@Siedlerchr

Copy link
Copy Markdown
Member Author

I merge now and we do a follow up

@Siedlerchr Siedlerchr enabled auto-merge June 15, 2025 13:51
@Siedlerchr Siedlerchr disabled auto-merge June 15, 2025 13:51
@Siedlerchr Siedlerchr merged commit 8e04a99 into main Jun 15, 2025
2 checks passed
@Siedlerchr Siedlerchr deleted the addArm64 branch June 15, 2025 13:51
Siedlerchr added a commit to FlyJoanne/jabref that referenced this pull request Jun 15, 2025
* upstream/main:
  New Crowdin updates (JabRef#13330)
  Add arm 64 linux runner (JabRef#13258)
  Rename strings and variables in New Entry (JabRef#13312)
  Let consistency checker yield a return code (JabRef#13329)
  Update LETTER fragment to resolve Windows parsing issue (JabRef#13327)
  Add support for "dev: no-bot-comments"
  Update dependency org.hibernate.validator:hibernate-validator to v9.0.1.Final (JabRef#13322)
  Endnote XML Exporter: Move factory initialization to constructor (JabRef#13321)
  Refine assignment reminder (JabRef#13315)
  Add welcome message to first time contributors (JabRef#13314)
  New Crowdin updates (JabRef#13311)
  Added a setting to show File annotations' tab only when the PDF actually contains highlights or comments (JabRef#13279)
  Update dependency org.postgresql:postgresql to v42.7.7 (JabRef#13306)
  Refine PULL_REQUEST_TEMPLATE.md (JabRef#13304)
  Move module tweaking of merged module to launcher (JabRef#13303)
  Speed up gradle update (JabRef#13300)
  testImplementation is enough (JabRef#13299)
@koppor koppor mentioned this pull request Jun 15, 2025
1 task
Siedlerchr added a commit to JustinHennis1/jabref that referenced this pull request Jun 16, 2025
* upstream/main:
  New Crowdin updates (JabRef#13330)
  Add arm 64 linux runner (JabRef#13258)
  Rename strings and variables in New Entry (JabRef#13312)
  Let consistency checker yield a return code (JabRef#13329)
  Update LETTER fragment to resolve Windows parsing issue (JabRef#13327)
  Add support for "dev: no-bot-comments"
  Update dependency org.hibernate.validator:hibernate-validator to v9.0.1.Final (JabRef#13322)
  Endnote XML Exporter: Move factory initialization to constructor (JabRef#13321)
  Refine assignment reminder (JabRef#13315)
  Add welcome message to first time contributors (JabRef#13314)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: binaries Binary builds should be uploaded to builds.jabref.org dev: build-system dev: ci-cd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package for Linux aarch64

3 participants