Bug 559162 - SWT Automatic module names should be independent to architecture
Summary: SWT Automatic module names should be independent to architecture
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.15   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-14 10:08 EST by Antonio Petrelli CLA
Modified: 2020-01-14 10:09 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Petrelli CLA 2020-01-14 10:08:50 EST
Currently the automatic module name for SWT JARs, as published in the manifest, is:
org.eclipse.swt.gtk.linux.x86_64
So it is architecture and platform dependent. On the contrary, they should have the same name, because:
1. the compilation can be made on any variant of the SWT library,
2. the correct library must be used at runtime;
3. it is difficult to create a portable application that consists of a common jar and multiple jars different for every architecture.

For an example of point 3:
1. you have common code that uses SWT
2. you have specific code that uses something for Linux and uses the code at point 1;
3. you have specific code that uses Windows and uses the code at point 1

Now you may think that is unlikely to have problem at runtime, but if you think to use GraalVM native compilation, then you might notice that it is hard to compile a Windows binary with a Linux specific JAR.

If the automatic module names were the same, the Windows JAR can use SWT Windows variant and the Linux JAR can use the Linux variant, when doing native compilation.

Moreover, all basic Java code has the same module names for all platforms, despite having different JNI code.