Bug 48863 - m-p: STDOUT=1 ломает раннюю диагностику ошибок
Summary: m-p: STDOUT=1 ломает раннюю диагностику ошибок
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: mkimage-profiles (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Антон Мидюков
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-19 19:08 MSK by Ivan A. Melnikov
Modified: 2024-01-08 18:58 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan A. Melnikov 2023-12-19 19:08:36 MSK
Возьмём m-p v1.5.15.2, и сломаем:

echo 'youcannotbuild' >>  pkg.in/lists/systemd 

Получим что-то ожидаемое:

$ make vm/regular-jeos-systemd.tar DEBUG=1
[...]
** error: Packages are not available in /tmp/.private/iv/mkimage-profiles.build.Mcj9R1R/pkg/lists/systemd:
youcannotbuild
check-pkg-list: Some lists contain unavailable packages


Добавим STDOUT=1. Сборка пройдёт дальше и упадёт сильно позже:

$ make vm/regular-jeos-systemd.tar DEBUG=1 STDOUT=1
[...]
Selecting systemd for 'systemd-units'
E: Couldn't find package youcannotbuild
hsh-install: Failed to calculate package file list.
hsh-install: Failed to generate package file list.
mki-invalidate-cache: has started executing for 'build-image'.
make[2]: *** [/usr/share/mkimage/targets.mk:142: build-image] Error 1
[...]

Ещё интереснее собирать iso, в которых нехватает пакетов, например alt-workstation на loongarch64. Там среди ругани на отсутствие groups/workstation/*.directory даже понять, в чём дело, не очень получается.
Comment 1 Ivan A. Melnikov 2023-12-19 19:09:06 MSK
Как я понял, ключевое слово здесь pipefail, но тривиального исправления в голову не приходит.
Comment 2 Антон Мидюков 2023-12-19 19:29:07 MSK
Вроде бы тривиальный патч проблему решает:

diff --git a/lib/log.mk b/lib/log.mk
index d33e8b31998..724844a1697 100644
--- a/lib/log.mk
+++ b/lib/log.mk
@@ -26,7 +26,7 @@ SHELL += -x
 endif
 ifeq (1,$(STDOUT))
 LOG = 2>&1 | tee -a $(BUILDLOG)
-LOG_STDERR = $(LOG)
+LOG_STDERR = 2> >(tee -a $(BUILDLOG) >&2) 1>>$(BUILDLOG)
 else
 LOG = >>$(BUILDLOG) 2>&1
 LOG_STDERR = 2> >(tee -a $(BUILDLOG) >&2) 1>>$(BUILDLOG)
Comment 3 Антон Мидюков 2023-12-22 19:03:36 MSK
(Ответ для Антон Мидюков на комментарий #2)
> Вроде бы тривиальный патч проблему решает:
> 
> diff --git a/lib/log.mk b/lib/log.mk
> index d33e8b31998..724844a1697 100644
> --- a/lib/log.mk
> +++ b/lib/log.mk
> @@ -26,7 +26,7 @@ SHELL += -x
>  endif
>  ifeq (1,$(STDOUT))
>  LOG = 2>&1 | tee -a $(BUILDLOG)
> -LOG_STDERR = $(LOG)
> +LOG_STDERR = 2> >(tee -a $(BUILDLOG) >&2) 1>>$(BUILDLOG)
>  else
>  LOG = >>$(BUILDLOG) 2>&1
>  LOG_STDERR = 2> >(tee -a $(BUILDLOG) >&2) 1>>$(BUILDLOG)

Помогло?
Comment 4 Repository Robot 2024-01-08 18:58:52 MSK
mkimage-profiles-1.5.16-alt1 -> sisyphus:

 Mon Jan 08 2024 Anton Midyukov <antohami@altlinux> 1.5.16-alt1
 - log.mk: fix abort on error when STDOUT=1 (ALT bug 48863)
 - datetime: set TIME ZONE, use alterator-datetime-functions,
   set TIME_ZONE, TIME_UTC via kernel cmdline for distro images
 - grub: add new langs: kk_KZ, ky_KG, uz_UZ
 - live: fix mistake in 90-live-cleanup-drivers
 - live, grub, isolinux: new target use/live/rescue
 - sound: Enable pipewire socket instead service