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

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

    <bug>
          <bug_id>48863</bug_id>
          
          <creation_ts>2023-12-19 19:08:36 +0300</creation_ts>
          <short_desc>m-p: STDOUT=1 ломает раннюю диагностику ошибок</short_desc>
          <delta_ts>2024-01-08 18:58:52 +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>mkimage-profiles</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="Ivan A. Melnikov">iv</reporter>
          <assigned_to name="Антон Мидюков">antohami</assigned_to>
          <cc>antohami</cc>
    
    <cc>jqt4</cc>
    
    <cc>mike</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>239265</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2023-12-19 19:08:36 +0300</bug_when>
    <thetext>Возьмём m-p v1.5.15.2, и сломаем:

echo &apos;youcannotbuild&apos; &gt;&gt;  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 &apos;systemd-units&apos;
E: Couldn&apos;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 &apos;build-image&apos;.
make[2]: *** [/usr/share/mkimage/targets.mk:142: build-image] Error 1
[...]

Ещё интереснее собирать iso, в которых нехватает пакетов, например alt-workstation на loongarch64. Там среди ругани на отсутствие groups/workstation/*.directory даже понять, в чём дело, не очень получается.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239266</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2023-12-19 19:09:06 +0300</bug_when>
    <thetext>Как я понял, ключевое слово здесь pipefail, но тривиального исправления в голову не приходит.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239269</commentid>
    <comment_count>2</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2023-12-19 19:29:07 +0300</bug_when>
    <thetext>Вроде бы тривиальный патч проблему решает:

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&gt;&amp;1 | tee -a $(BUILDLOG)
-LOG_STDERR = $(LOG)
+LOG_STDERR = 2&gt; &gt;(tee -a $(BUILDLOG) &gt;&amp;2) 1&gt;&gt;$(BUILDLOG)
 else
 LOG = &gt;&gt;$(BUILDLOG) 2&gt;&amp;1
 LOG_STDERR = 2&gt; &gt;(tee -a $(BUILDLOG) &gt;&amp;2) 1&gt;&gt;$(BUILDLOG)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239439</commentid>
    <comment_count>3</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2023-12-22 19:03:36 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #2)
&gt; Вроде бы тривиальный патч проблему решает:
&gt; 
&gt; diff --git a/lib/log.mk b/lib/log.mk
&gt; index d33e8b31998..724844a1697 100644
&gt; --- a/lib/log.mk
&gt; +++ b/lib/log.mk
&gt; @@ -26,7 +26,7 @@ SHELL += -x
&gt;  endif
&gt;  ifeq (1,$(STDOUT))
&gt;  LOG = 2&gt;&amp;1 | tee -a $(BUILDLOG)
&gt; -LOG_STDERR = $(LOG)
&gt; +LOG_STDERR = 2&gt; &gt;(tee -a $(BUILDLOG) &gt;&amp;2) 1&gt;&gt;$(BUILDLOG)
&gt;  else
&gt;  LOG = &gt;&gt;$(BUILDLOG) 2&gt;&amp;1
&gt;  LOG_STDERR = 2&gt; &gt;(tee -a $(BUILDLOG) &gt;&amp;2) 1&gt;&gt;$(BUILDLOG)

Помогло?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239964</commentid>
    <comment_count>4</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2024-01-08 18:58:52 +0300</bug_when>
    <thetext>mkimage-profiles-1.5.16-alt1 -&gt; sisyphus:

 Mon Jan 08 2024 Anton Midyukov &lt;antohami@altlinux&gt; 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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>