Bug 1110024 - noarch java packages differ between architectures
Summary: noarch java packages differ between architectures
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: Other openSUSE Factory
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Fridrich Strba
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 1109534
  Show dependency treegraph
 
Reported: 2018-09-27 14:48 UTC by Bernhard Wiedemann
Modified: 2023-04-10 15:45 UTC (History)
1 user (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
list of affected packages (1.85 KB, text/plain)
2018-09-27 14:48 UTC, Bernhard Wiedemann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Wiedemann 2018-09-27 14:48:49 UTC
Created attachment 784508 [details]
list of affected packages

see bug 1109534 for background

affects at least 156 Factory packages.

diff:
/usr/share/java/META-INF/MANIFEST.MF    2018-09-27 14:42:28.247417275 +0000
@@ -1,4 +1,4 @@
 Manifest-Version: 1.0^M
 Ant-Version: Apache Ant 1.9.13^M
-Created-By: 11+28-suse-3.6-x8664 (Oracle Corporation)^M
+Created-By: 11+28-suse-3.6-i386 (Oracle Corporation)^M
 ^M


The version parts of the same line also causes excessive rebuilds in OBS
whenever openjdk is rebuilt (not even updated).
Easiest solution would be if the string could be scrubbed, so instead of
Created-By: 11+28-suse-3.6-i386 (Oracle Corporation)
it could say
Created-By: 11+suse (Oracle Corporation)
Comment 1 Antoine Belvire 2018-10-21 15:17:08 UTC
It looks like only ant fills manifests like this, using System.getProperty("java.runtime.version").

Since Java 9, openSUSE puts architecture in the optional part of the version:

> bash ../configure \
>    --with-version-feature=%{featurever} \
>    --with-version-interim=%{interimver} \
>    --with-version-update=%{updatever} \
>    --with-version-patch=%{patchver} \
>    --with-version-date=%{datever} \
>    --with-version-build=%{buildver} \
>    --with-version-pre="" \
>    --with-version-opt="suse-%{release}-%{_arch}" \

So there are at least two possibilities:

1) Remove arch from the optional field of the Java's version so that ant won't put it in manifest.

For example: https://build.opensuse.org/package/rdiff/home:1Antoine1:branches:Java:Factory/java-11-openjdk?opackage=java-11-openjdk&oproject=Java%3AFactory&rev=4

2) Or patch ant so that it puts either a constant string or a refined string in manifest's "Created-by" instead of using Java's detailed version as is. This may also prevent the excessive rebuilds/publications due to "Created-by" change on Java minor update.

For example, using system property "java.version" (i.e. major version only), like the 'jar' command does: https://build.opensuse.org/package/rdiff/home:1Antoine1:branches:Java:packages/ant?opackage=ant&oproject=Java%3Apackages&rev=4
Comment 2 Bernhard Wiedemann 2018-10-22 13:46:16 UTC
I tested that your patched ant helps getting rid of arch-diffs (apart from the normal mtime variations in the jar).
There is now

Created-By: 11 (Oracle Corporation)

Reducing the --with-version-opt variance would still be a good thing for other reasons, though.
Comment 3 Antoine Belvire 2018-10-22 18:03:07 UTC
(In reply to Bernhard Wiedemann from comment #2)
> I tested that your patched ant helps getting rid of arch-diffs (apart from
> the normal mtime variations in the jar).
> There is now
> 
> Created-By: 11 (Oracle Corporation)

Yes, I copied the behavior of the 'jar' command.

I can put a fixed string instead, in order to be completely version agnostic. I don't think this field is relevant anyway for jars packaged as rpms…

Just let me know what you prefer.

If it's fine for you I can submit the patch to Java:packages.

> Reducing the --with-version-opt variance would still be a good thing for
> other reasons, though.

I've no opinion about this - no idea who actually is interested in such a version string.
Comment 4 Bernhard Wiedemann 2018-10-29 03:46:59 UTC
having a version 11 in there, is perfectly fine.

When comparing my local build of xmlgraphics-fop to the official Factory one, I also noticed another diff in the MANIFEST.MF:

-Build-Id: 20180405-120000-GMT (abuild [Linux 4.15.13-2-default amd64, ^M
- Java 10+46-suse-1.1-x8664, Target Java 1.6])^M
+Build-Id: 20180405-120000-GMT (abuild [Linux 4.18.5-1-default amd64, J^M
+ ava 10.0.2+13-suse-1.1-x8664, Target Java 1.6])^M

capturing the user, kernel version and again java version details.
I wonder if anyone ever needs that...
Comment 5 Antoine Belvire 2018-10-29 07:10:33 UTC
(In reply to Bernhard Wiedemann from comment #4)
> having a version 11 in there, is perfectly fine.

I've submitted the patch, it's in staging now.

> When comparing my local build of xmlgraphics-fop to the official Factory
> one, I also noticed another diff in the MANIFEST.MF:
> 
> -Build-Id: 20180405-120000-GMT (abuild [Linux 4.15.13-2-default amd64, ^M
> - Java 10+46-suse-1.1-x8664, Target Java 1.6])^M
> +Build-Id: 20180405-120000-GMT (abuild [Linux 4.18.5-1-default amd64, J^M
> + ava 10.0.2+13-suse-1.1-x8664, Target Java 1.6])^M
> 
> capturing the user, kernel version and again java version details.
> I wonder if anyone ever needs that...

https://build.opensuse.org/request/show/645175
Comment 6 Antoine Belvire 2018-11-08 21:38:05 UTC
All the patches mentioned have now reached Factory. Is there anything left to do here or can we close this bug report?
Comment 7 Bernhard Wiedemann 2018-11-08 23:49:55 UTC
I checked 2 packages from the list and build-compare finds them similar enough.

Minor things like varying mtimes in .jar files and date in javadoc .html
can be addressed later / long-term.
Comment 8 Swamp Workflow Management 2020-04-03 12:30:10 UTC
This is an autogenerated message for OBS integration:
This bug (1110024) was mentioned in
https://build.opensuse.org/request/show/791181 Factory / xmlgraphics-fop