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

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

    <bug>
          <bug_id>35620</bug_id>
          
          <creation_ts>2018-11-19 21:36:48 +0300</creation_ts>
          <short_desc>rpm-build should NOT allow to change buildroot in %check section</short_desc>
          <delta_ts>2025-07-07 00:43:39 +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>rpm-build</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vladimir D. Seleznev">vseleznv</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>arseny</cc>
    
    <cc>evg</cc>
    
    <cc>glebfm</cc>
    
    <cc>imz</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>rider</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>175897</commentid>
    <comment_count>0</comment_count>
    <who name="Vladimir D. Seleznev">vseleznv</who>
    <bug_when>2018-11-19 21:36:48 +0300</bug_when>
    <thetext>$subj</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>175900</commentid>
    <comment_count>1</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2018-11-20 07:32:55 +0300</bug_when>
    <thetext>А должен ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>175914</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2018-11-20 13:22:26 +0300</bug_when>
    <thetext>Why?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>257294</commentid>
    <comment_count>3</comment_count>
    <who name="Arseny Maslennikov">arseny</who>
    <bug_when>2025-01-14 15:17:56 +0300</bug_when>
    <thetext>(In reply to Vladimir D. Seleznev from comment #0)
&gt; rpm-build should NOT allow to change buildroot in %check section
Я бы сказал, нужна инфраструктура, подвергающая тестированию то, что попадёт в %buildroot пакета. подвергается. Это может быть или не быть секция %check. Но, наверное, это другая бага.

В ряде пакетов задача уже решена индивидуально; например, к пакету systemd есть systemd-tests.

Я припоминаю частный разговор, где пришли к мысли, что это тест установки пакета в свежем чруте и работы того, что там упаковано.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>257297</commentid>
    <comment_count>4</comment_count>
    <who name="Arseny Maslennikov">arseny</who>
    <bug_when>2025-01-14 15:25:20 +0300</bug_when>
    <thetext>(In reply to Vladimir D. Seleznev from comment #0)
&gt; rpm-build should NOT allow to change buildroot in %check section
Сдаётся мне, что довольно малой кровью можно это обеспечить, применив какой-нибудь landlock. Но для этого может потребоваться изменить путь к buildroot, убрать[1] его из %_tmppath.

[1] https://lore.kernel.org/landlock/20240402.quaQuieyohd9@digikod.net/T/#t</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>257304</commentid>
    <comment_count>5</comment_count>
    <who name="Arseny Maslennikov">arseny</who>
    <bug_when>2025-01-14 15:45:51 +0300</bug_when>
    <thetext>BTW:

https://github.com/rpm-software-management/rpm/commit/9d35c8df497534e1fbd806a4dc78802bcf35d7cb
&gt; This also moves SPECPARTS and BUILDROOT into the new directory, bringing
&gt; both locations fully under rpm control. Remove the corresponding
&gt; %specpartsdir and %buildroot entries from the main macros file, these
&gt; are not user overridable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>257333</commentid>
    <comment_count>6</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2025-01-14 20:19:47 +0300</bug_when>
    <thetext>Если это про Landlock, то и так было ясно, что дыру в Landlock можно обойти убрав %buildroot из TMPDIR.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>268459</commentid>
    <comment_count>7</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2025-07-07 00:43:39 +0300</bug_when>
    <thetext>(In reply to Arseny Maslennikov from comment #4)
&gt; (In reply to Vladimir D. Seleznev from comment #0)
&gt; &gt; rpm-build should NOT allow to change buildroot in %check section
&gt; Сдаётся мне, что довольно малой кровью можно это обеспечить, применив
&gt; какой-нибудь landlock. Но для этого может потребоваться изменить путь к
&gt; buildroot, убрать[1] его из %_tmppath.
&gt; 
&gt; [1] https://lore.kernel.org/landlock/20240402.quaQuieyohd9@digikod.net/T/#t

&quot;малой кровью&quot; но для этого надо сделать невозможное.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>