<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 30, 2017 at 7:53 PM, Johannes Schauer <span dir="ltr"><<a href="mailto:josch@debian.org" target="_blank">josch@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Quoting Michael Stapelberg (2017-06-02 18:23:02)<br>
<span class="gmail-m_560762713180909503gmail-">> Thanks for the review. Answers inline:<br>
<br>
</span>sorry for the delay. I'm under a pile of work and this wasn't on the top of my<br>
todo list. But let me not stall your work:<br>
<span class="gmail-m_560762713180909503gmail-"><br>
> > > # Enable eatmydata: occasionally losing a test build is preferable over<br>
> > longer<br>
> > > # build times and disk wear.<br>
> > > echo "command-prefix=eatmydata" >> "${tmp}"<br>
> ><br>
> > I don't see sbuild-createchroot mangling with command-prefix at all. So<br>
> > why do<br>
> > you filter it out initially?<br>
> ><br>
> > Would it not be better to add a command line option to sbuild-createchroot<br>
> > which allows setting a custom command-prefix? Then you would not need to<br>
> > manually mangle the created config file at all and lots of the problems I<br>
> > mentioned above and other fragile things would go away.<br>
> Sure. Can you take care of this or do you want me to send a patch?<br>
<br>
</span>Please file a new bug with a patch.<br></blockquote><div><br></div><div>Done: <a href="https://bugs.debian.org/870260" target="_blank">https://bugs.debian.org/870260</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_560762713180909503gmail-"><br>
> > > chmod 644 "${tmp}"<br>
> > > mv "${tmp}" "${config}"<br>
> > ><br>
> > > # Copy a modified example sbuildrc config file<br>
> > > for homedir in $(getent passwd | perl -F: -nlE '$F[2] >= 1000 && $F[2]<br>
> > <= 59999 && say $F[5]')<br>
> > > do<br>
> > >     userconfig="${homedir}/.sbuil<wbr>drc"<br>
> > >     if [ ! -e "${userconfig}" ]<br>
> > >     then<br>
> > >         (grep -v -E "^(# don't remove this|1;\$)" /usr/share/doc/sbuild/examples<wbr>/example.sbuildrc<br>
> > && cat /usr/share/doc/sbuild-debian-s<wbr>etup/sbuildrc) > "${userconfig}"<br>
> > >     fi<br>
> > > done<br>
> ><br>
> > Instead of crafting a custom sbuildrc, we can also talk about changing the<br>
> > existing defaults.<br>
> ><br>
> > For example you set "$build_arch_all = 1;" I can certainly see how it makes<br>
> > sense to change this default for sbuild but keep it at 0 for buildd.<br>
> Sounds good. Same question: can you take care of this, or should I send a<br>
> patch?<br>
<br>
</span>For personal users of sbuild (users of sbuild and not buildd) they will<br>
probably always want to build arch:all packages. So lets change the default!<br>
<br>
Again, a short bug with patch is appreciated.<br></blockquote><div><br></div><div>Done: <a href="https://bugs.debian.org/870263">https://bugs.debian.org/870263</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_560762713180909503gmail-"><br>
> > Then you set "$build_source = 1;" but I don't know why you would need this.<br>
> > Sbuild is not there to build the source package. The source package is its<br>
> > input not its output. Why would you want sbuild to build it again?<br>
> The wiki page contained some confusing advice, which I now removed.<br>
<br>
</span>Thanks!<br>
<span class="gmail-m_560762713180909503gmail-"><br>
> > Lastly, you set "$run_lintian = 1;" which I also think would be a sensible<br>
> > thing to change in the defaults.<br>
> Sounds good, see above.<br>
<br>
</span>You can include that in the other bug.<br></blockquote><div><br></div><div>See above.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_560762713180909503gmail-"><br>
> > > if [ ! -e "/etc/schroot/setup.d/04tmpfs" ]<br>
> > > then<br>
> > >     echo ""<br>
> > >     echo "  If you can spare the RAM, you can enable building in tmpfs<br>
> > using:"<br>
> > >     echo ""<br>
> > >     echo "    sudo ln -s /etc/schroot/setup-available.d<wbr>/overlays-in-tmpfs<br>
> > /etc/schroot/setup.d/04tmpfs"<br>
> > >     echo ""<br>
> > > fi<br>
> ><br>
> > This will affect *all* schroot sessions and not just those used by sbuild.<br>
> > As such, this should rather go into documentation for schroot. But maybe<br>
> > there is a way to make this mounting specific to sbuild schroots?<br>
> I don’t know, you’re the expert :). I think users who know what schroot is<br>
> (to me it’s “the thing which sbuild uses”) and who use it for anything but<br>
> sbuild will realize what’s happening here. We could add some wording to<br>
> that extent.<br>
<br>
</span>More docs in this direction would be appreciated.<br>
<span class="gmail-m_560762713180909503gmail-"><br>
> > I think in summary much of what this script does can be achieved by:<br>
> ><br>
> >  - improving existing documentation<br>
> I updated the wiki page based on your review.<br>
<br>
</span>Thanks a lot!<br>
<span class="gmail-m_560762713180909503gmail-"><br>
> >  - changing configuration defaults to more sensible values<br>
> >  - adding more options to existing tools like sbuild-createchroot<br>
> >  - using existing tools instead of using creative ways to work around them<br>
> >    (apt-cacher-ng)<br>
> ><br>
> > If we do all that, what is left that a new script should take care of?<br>
> The following things are still left:<br>
><br>
> • Adding the user(s) to the sbuild group<br>
<br>
</span>That's just one call to sbuild-adduser<br>
<span class="gmail-m_560762713180909503gmail-"><br>
> • Creating the chroot with all the options we discussed<br>
<br>
</span>Yet another single call to sbuild-createchroot<br>
<span class="gmail-m_560762713180909503gmail-"><br>
> • Suggesting to build in tmpfs<br>
<br>
</span>I'd consider that an optional tip that can be listed in the docs somewhere.<br>
<span class="gmail-m_560762713180909503gmail-"><br>
> • Periodically updating the schroots (not strictly speaking part of the<br>
> script itself, but listing it here anyway)<br>
<br>
</span>This can be done using the cron script from<br>
/usr/share/doc/sbuild/examples<wbr>/sbuild-update-all<br>
<br>
Bug #870102 is about making this cron script more visible by adding better<br>
documentation.<br>
<br>
So all in all, we are down to running two scripts to setup sbuild. One of that<br>
is only required once after installation while the other can be run multiple<br>
times to setup multiple chroots. I don't think a wrapper script for these two<br>
scripts makes much sense. Lets rather better document which two commands one<br>
needs to run after installing sbuild for the first time.<br></blockquote><div><br></div><div>Unless I’m mistaken, the following is what we’d need to recommend to new users:</div><div><br></div><div><div>% sudo apt install sbuild apt-cacher-ng lintian</div><div><br></div><div>% sudo adduser --quiet -- "$USER" sbuild</div><div><br></div><div>% sudo sbuild-createchroot \</div><div>  --command-prefix=eatmydata \</div><div>  --include=eatmydata \</div><div>  --alias=UNRELEASED \</div><div>  --alias=sid \</div><div>  unstable \</div><div>  /srv/chroot/unstable-amd64-<wbr>sbuild \</div><div>  <a href="http://localhost:3142/deb.debian.org/debian" target="_blank">http://localhost:3142/deb.<wbr>debian.org/debian</a></div><div><br></div><div>% echo 15 */6 * * * root /usr/share/doc/sbuild/<wbr>examples/sbuild-update-all | sudo tee /etc/cron.d/sbuild-update-all</div></div><div><br></div><div>% newgrp sbuild</div><div><br></div><div>That seems quite involved over, say, “apt install sbuild-setup && sbuild-setup unstable”.</div><div><br></div><div>Hence, I’d definitely appreciate a script which does all the over having to refer to a wiki page and copy&paste long commands.</div><div><br></div><div>What do you think?</div></div><div><br></div>-- <br><div class="gmail-m_560762713180909503gmail_signature">Best regards,<br>Michael</div>
</div></div>