Bug 40831 - %post scriptlet failed при установке пакета i586-java-11-openjdk-headless
Summary: %post scriptlet failed при установке пакета i586-java-11-openjdk-headless
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: java-11-openjdk-headless (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Andrey Cherepanov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-31 10:53 MSK by Alexander Makeenkov
Modified: 2021-11-02 14:20 MSK (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Makeenkov 2021-08-31 10:53:44 MSK
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
Comment 1 Антон Мидюков 2021-11-01 22:56:27 MSK
Предположительно не выполняется
%post headless
java=%{jrebindir}/java
if [ -f /proc/cpuinfo ] && ! [ -d /.ours ] ; then #real workstation; not a mkimage-profile, etc
$java -Xshare:dump >/dev/null 2>/dev/null
fi

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

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

Проблема наблюдается при сборке образов в mkimage-profiles с этим пакетом.
Comment 2 Anton Farygin 2021-11-01 22:59:03 MSK
судя по тому, что делает операция java  -Xshare:dump - в процессе подготовки livecd её нужно обязательно выполнить.
Comment 3 viy 2021-11-02 00:04:54 MSK
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 "shared archive". 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's metadata for these classes to be shared among multiple JVM processes.

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

Я последнее время не собираю java 11, со стороны могу посоветовать зайти в chroot, выполнить команду руками и посмотреть, почему java11  ругается.
В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить эту команду, или существенно изменить ее синтаксис, так, что старый вызов больше не работает.
Comment 4 AEN 2021-11-02 06:26:06 MSK
(Ответ для viy на комментарий #3)
> 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 "shared
> archive". 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's metadata for these classes to be shared among multiple JVM
> processes.
> 
> Т.е. создаем дамп, который будет ускорять запуск JVM.
> Стоит ли на этапе mkimage делать - не всегда понятно. Для live, наверное
> стоит.
> Для install - наверное, нет.
> 
> Я последнее время не собираю java 11, со стороны могу посоветовать зайти в
> chroot, выполнить команду руками и посмотреть, почему java11  ругается.
> В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить
> эту команду, или существенно изменить ее синтаксис, так, что старый вызов
> больше не работает.

Игорь, пожалуйста, помогите Андрею починить.
Comment 5 Антон Мидюков 2021-11-02 06:57:28 MSK
(Ответ для viy на комментарий #3)
> 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 "shared
> archive". 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's metadata for these classes to be shared among multiple JVM
> processes.
> 
> Т.е. создаем дамп, который будет ускорять запуск JVM.
> Стоит ли на этапе mkimage делать - не всегда понятно. Для live, наверное
> стоит.
> Для install - наверное, нет.
> 
> Я последнее время не собираю java 11, со стороны могу посоветовать зайти в
> chroot, выполнить команду руками и посмотреть, почему java11  ругается.
> В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить
> эту команду, или существенно изменить ее синтаксис, так, что старый вызов
> больше не работает.

Проблема на всех java. Проблема в том, что когда условие не выполняется, возникает ошибка. Нужно пустую команду выполнять после условия или в else этого условия что-то делать, ту же пустую команду.
Comment 6 Антон Мидюков 2021-11-02 12:10:09 MSK
(Ответ для Антон Мидюков на комментарий #5)
> 
> Проблема на всех java. Проблема в том, что когда условие не выполняется,
> возникает ошибка. Нужно пустую команду выполнять после условия или в else
> этого условия что-то делать, ту же пустую команду.

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

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

а не

if [ -f /proc/cpuinfo ] && ! [ -d /.ours ]
Comment 7 Антон Мидюков 2021-11-02 12:24:47 MSK
(Ответ для viy на комментарий #3)
> Я последнее время не собираю java 11, со стороны могу посоветовать зайти в
> chroot, выполнить команду руками и посмотреть, почему java11  ругается.
> В связи с распилом rt.jar в Jigsaw на части в новой версии могли и отменить
> эту команду, или существенно изменить ее синтаксис, так, что старый вызов
> больше не работает.

rpm -q --scripts java-11-openjdk-headless
postinstall scriptlet (using /bin/sh):
# java should be available ASAP
[ -x /usr/bin/alternatives-update ] && /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 ] && ! [ -d /.ours ] ; then #real workstation; not a mkimage-profile, etc
    $java -Xshare:dump >/dev/null 2>/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
Comment 8 Антон Мидюков 2021-11-02 12:48:58 MSK
Теперь, собственно, по этому багу:

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 ] && ! [ -d /.ours ] ; then #real workstation; not a mkimage-profile, etc
    $java -Xshare:dump >/dev/null 2>/dev/null
fi

/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-0.i586/bin/java в i586-java-11-openjdk-headless действительно нет.
Comment 9 viy 2021-11-02 14:17:46 MSK
(Ответ для AEN на комментарий #4)
> Игорь, пожалуйста, помогите Андрею починить.

Да, я на связи, готов помочь.
Comment 10 Repository Robot 2021-11-02 14:20:38 MSK
java-11-openjdk-0:11.0.13.8-alt2_1jpp11 -> sisyphus:

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