<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>40831</bug_id>
          
          <creation_ts>2021-08-31 10:53:44 +0300</creation_ts>
          <short_desc>%post scriptlet failed при установке пакета i586-java-11-openjdk-headless</short_desc>
          <delta_ts>2021-11-02 14:20:38 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>java-11-openjdk-headless</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=41264</see_also>
    
    <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=41138</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexander Makeenkov">amakeenk</reporter>
          <assigned_to name="Andrey Cherepanov">cas</assigned_to>
          <cc>aen</cc>
    
    <cc>antohami</cc>
    
    <cc>cas</cc>
    
    <cc>rider</cc>
    
    <cc>viy</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>202160</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2021-08-31 10:53:44 +0300</bug_when>
    <thetext>36: i586-java-11-openjdk-headless-0:11.0.12.7-alt1_0jpp10                                                                        #################################################################################################### [100%]
предупреждение: %post(i586-java-11-openjdk-headless-0:11.0.12.7-alt1_0jpp10.i586) scriptlet failed, exit status 127</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204332</commentid>
    <comment_count>1</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2021-11-01 22:56:27 +0300</bug_when>
    <thetext>Предположительно не выполняется
%post headless
java=%{jrebindir}/java
if [ -f /proc/cpuinfo ] &amp;&amp; ! [ -d /.ours ] ; then #real workstation; not a mkimage-profile, etc
$java -Xshare:dump &gt;/dev/null 2&gt;/dev/null
fi

Нужно, чтобы после условия была пустая операция. Невыполнение условия не должно приводить к ошибке.

Смотреть также:
https://lists.altlinux.org/pipermail/devel-distro/2021-November/002634.html

Проблема наблюдается при сборке образов в mkimage-profiles с этим пакетом.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204333</commentid>
    <comment_count>2</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2021-11-01 22:59:03 +0300</bug_when>
    <thetext>судя по тому, что делает операция java  -Xshare:dump - в процессе подготовки livecd её нужно обязательно выполнить.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204337</commentid>
    <comment_count>3</comment_count>
    <who name="viy">viy</who>
    <bug_when>2021-11-02 00:04:54 +0300</bug_when>
    <thetext>java -Xshare:dump

фича появилась во времена java 8:

https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.html

Class data sharing (CDS) helps reduce the startup time for Java programming language applications, in particular smaller applications, as well as reduce footprint. When the JRE is installed using the installer, the installer loads a set of classes from the system jar file into a private internal representation, and dumps that representation to a file, called a &quot;shared archive&quot;. If the JRE installer is not being used, this can be done manually, as explained below. During subsequent JVM invocations, the shared archive is memory-mapped in, saving the cost of loading those classes and allowing much of the JVM&apos;s metadata for these classes to be shared among multiple JVM processes.

Т.е. создаем дамп, который будет ускорять запуск JVM.
Стоит ли на этапе mkimage делать - не всегда понятно. Для live, наверное стоит.
Для install - наверное, нет.

Я последнее время не собираю java 11, со стороны могу посоветовать зайти в chroot, выполнить команду руками и посмотреть, почему java11  ругается.
В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить эту команду, или существенно изменить ее синтаксис, так, что старый вызов больше не работает.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204356</commentid>
    <comment_count>4</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2021-11-02 06:26:06 +0300</bug_when>
    <thetext>(Ответ для viy на комментарий #3)
&gt; java -Xshare:dump
&gt; 
&gt; фича появилась во времена java 8:
&gt; 
&gt; https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.
&gt; html
&gt; 
&gt; Class data sharing (CDS) helps reduce the startup time for Java programming
&gt; language applications, in particular smaller applications, as well as reduce
&gt; footprint. When the JRE is installed using the installer, the installer
&gt; loads a set of classes from the system jar file into a private internal
&gt; representation, and dumps that representation to a file, called a &quot;shared
&gt; archive&quot;. If the JRE installer is not being used, this can be done manually,
&gt; as explained below. During subsequent JVM invocations, the shared archive is
&gt; memory-mapped in, saving the cost of loading those classes and allowing much
&gt; of the JVM&apos;s metadata for these classes to be shared among multiple JVM
&gt; processes.
&gt; 
&gt; Т.е. создаем дамп, который будет ускорять запуск JVM.
&gt; Стоит ли на этапе mkimage делать - не всегда понятно. Для live, наверное
&gt; стоит.
&gt; Для install - наверное, нет.
&gt; 
&gt; Я последнее время не собираю java 11, со стороны могу посоветовать зайти в
&gt; chroot, выполнить команду руками и посмотреть, почему java11  ругается.
&gt; В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить
&gt; эту команду, или существенно изменить ее синтаксис, так, что старый вызов
&gt; больше не работает.

Игорь, пожалуйста, помогите Андрею починить.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204360</commentid>
    <comment_count>5</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2021-11-02 06:57:28 +0300</bug_when>
    <thetext>(Ответ для viy на комментарий #3)
&gt; java -Xshare:dump
&gt; 
&gt; фича появилась во времена java 8:
&gt; 
&gt; https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.
&gt; html
&gt; 
&gt; Class data sharing (CDS) helps reduce the startup time for Java programming
&gt; language applications, in particular smaller applications, as well as reduce
&gt; footprint. When the JRE is installed using the installer, the installer
&gt; loads a set of classes from the system jar file into a private internal
&gt; representation, and dumps that representation to a file, called a &quot;shared
&gt; archive&quot;. If the JRE installer is not being used, this can be done manually,
&gt; as explained below. During subsequent JVM invocations, the shared archive is
&gt; memory-mapped in, saving the cost of loading those classes and allowing much
&gt; of the JVM&apos;s metadata for these classes to be shared among multiple JVM
&gt; processes.
&gt; 
&gt; Т.е. создаем дамп, который будет ускорять запуск JVM.
&gt; Стоит ли на этапе mkimage делать - не всегда понятно. Для live, наверное
&gt; стоит.
&gt; Для install - наверное, нет.
&gt; 
&gt; Я последнее время не собираю java 11, со стороны могу посоветовать зайти в
&gt; chroot, выполнить команду руками и посмотреть, почему java11  ругается.
&gt; В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить
&gt; эту команду, или существенно изменить ее синтаксис, так, что старый вызов
&gt; больше не работает.

Проблема на всех java. Проблема в том, что когда условие не выполняется, возникает ошибка. Нужно пустую команду выполнять после условия или в else этого условия что-то делать, ту же пустую команду.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204375</commentid>
    <comment_count>6</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2021-11-02 12:10:09 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #5)
&gt; 
&gt; Проблема на всех java. Проблема в том, что когда условие не выполняется,
&gt; возникает ошибка. Нужно пустую команду выполнять после условия или в else
&gt; этого условия что-то делать, ту же пустую команду.

Проблема в mkimage-profiles о другом.
В условии ошибка. Должно быть:

if [ -f /proc/cpuinfo ] &amp;&amp; ! [ -d /.our ]

а не

if [ -f /proc/cpuinfo ] &amp;&amp; ! [ -d /.ours ]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204377</commentid>
    <comment_count>7</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2021-11-02 12:24:47 +0300</bug_when>
    <thetext>(Ответ для viy на комментарий #3)
&gt; Я последнее время не собираю java 11, со стороны могу посоветовать зайти в
&gt; chroot, выполнить команду руками и посмотреть, почему java11  ругается.
&gt; В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить
&gt; эту команду, или существенно изменить ее синтаксис, так, что старый вызов
&gt; больше не работает.

rpm -q --scripts java-11-openjdk-headless
postinstall scriptlet (using /bin/sh):
# java should be available ASAP
[ -x /usr/bin/alternatives-update ] &amp;&amp; /usr/bin/alternatives-update ||:

# MetaspaceShared::generate_vtable_methods not implemented for PPC JIT
#see https://bugzilla.redhat.com/show_bug.cgi?id=513605
java=/usr/lib/jvm/java-11-openjdk-11.0.9.11-0.3.ea.x86_64/bin/java
if [ -f /proc/cpuinfo ] &amp;&amp; ! [ -d /.ours ] ; then #real workstation; not a mkimage-profile, etc
    $java -Xshare:dump &gt;/dev/null 2&gt;/dev/null
fi


[root@comp-e2-1800-apu-2fb06e /]# java=/usr/lib/jvm/java-11-openjdk-11.0.9.11-0.3.ea.x86_64/bin/java

[root@comp-e2-1800-apu-2fb06e /]# $java -Xshare:dump
/usr/lib/jvm/java-11-openjdk-11.0.9.11-0.3.ea.x86_64/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

[root@comp-e2-1800-apu-2fb06e /]# rpm -ql java-11-openjdk-headless |grep libjli.so
/usr/lib/jvm/java-11-openjdk-11.0.9.11-0.3.ea.x86_64/lib/jli/libjli.so</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204380</commentid>
    <comment_count>8</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2021-11-02 12:48:58 +0300</bug_when>
    <thetext>Теперь, собственно, по этому багу:

rpm -q --scripts i586-java-11-openjdk-headless

java=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-0.i586/bin/java
if [ -f /proc/cpuinfo ] &amp;&amp; ! [ -d /.ours ] ; then #real workstation; not a mkimage-profile, etc
    $java -Xshare:dump &gt;/dev/null 2&gt;/dev/null
fi

/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-0.i586/bin/java в i586-java-11-openjdk-headless действительно нет.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204389</commentid>
    <comment_count>9</comment_count>
    <who name="viy">viy</who>
    <bug_when>2021-11-02 14:17:46 +0300</bug_when>
    <thetext>(Ответ для AEN на комментарий #4)
&gt; Игорь, пожалуйста, помогите Андрею починить.

Да, я на связи, готов помочь.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>204391</commentid>
    <comment_count>10</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2021-11-02 14:20:38 +0300</bug_when>
    <thetext>java-11-openjdk-0:11.0.13.8-alt2_1jpp11 -&gt; sisyphus:

 Tue Nov 02 2021 Andrey Cherepanov &lt;cas@altlinux&gt; 0:11.0.13.8-alt2_1jpp11
 - Ignore possible fail of %post scriptlet (ALT #40831).
 - Optionally disable %check by default.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>