• Re: [gentoo-user] Question about compilation

    From Filip Kobierski@21:1/5 to Jacques Montier on Sat Feb 8 20:10:02 2025
    Hi Jacques,

    I think you are looking for SIGSTP or SIGSTOP but I think that's
    not exactly it. From what I know you cannot do that for emerge
    easily. For similar results you might want to set up ccache. https://wiki.gentoo.org/wiki/Ccache

    Regards
    Filip

    On Saturday, February 8th, 2025 at 15:47, Jacques Montier <jmontier@gmail.com> wrote:

    Hello everyone,
    Is it possible to stop a compilation midway in the case of a very long compilation and then resume it from the same point without having to start over from the beginning ?
    Thank you for your response.
    Best regards,

    --
    Jacques Montier.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to Filip Kobierski on Sun Feb 9 00:10:01 2025
    On 2025.02.08 14:00, Filip Kobierski wrote:
    Hi Jacques,

    I think you are looking for SIGSTP or SIGSTOP but I think that's
    not exactly it. From what I know you cannot do that for emerge
    easily. For similar results you might want to set up ccache. https://wiki.gentoo.org/wiki/Ccache

    Regards
    Filip

    On Saturday, February 8th, 2025 at 15:47, Jacques Montier <jmontier@gmail.com> wrote:

    Hello everyone,
    Is it possible to stop a compilation midway in the case of a very
    long compilation and then resume it from the same point without
    having to start over from the beginning ?
    Thank you for your response.
    Best regards,

    --
    Jacques Montier.

    If you really mean just interrupting a compile, then you should be able
    to stop with Ctl-C, and then start/continue by running make or ninja
    again, assuming that is what is used for whatever you are compiling.
    Ccache can help since most of the results of the previous compile
    attempt will have been cached, and so will be completed more quickly
    the next time, but it's not the same as continuing from where it was interrupted.

    If, as Filip implies, you are asking about interrupting emerge, it's
    easy enough to interrupt, but essentially impossible to continue from
    where it left off. "emerge --continue" will just try to emerge every
    package from the interrupted emerge which was not completed, but it
    will start each one from scratch. What has often, but not alwasy
    worked for me, is to use ebuild directly. "ebuild
    .../path/to/package.ebuild compile" will figure out that everything
    prior to the compile was completed, and then issue the make or ninja commands, which will just pick up where they left off. If that does
    work, then you need to repeat the ebuild, but with the install and then
    the qmerge commands. The only problem with that (for me, at least) is
    that ebuild does not leave exactly the same lines in emerge.log, so a
    package installed that way will not show up in "gentlop -t package"
    output.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matt Jolly@21:1/5 to Dale on Sun Feb 9 01:30:01 2025
    Hi Dale,

    On 9/2/25 10:20, Dale wrote:

    Would that survive a full reboot?  I'm asking about a regular desktop
    top system.  It's rare but sometimes I am doing updates and have a power failure and have to shutdown until power comes back. I've always just
    done a emerge --resume but that starts any unfinished emerges from
    scratch.  Just curious if this would work. If I can remember to do it if
    it does.  ;-)

    Provided that your /var/tmp/portage isn't a tmpfs this will survive
    reboots and enable you to use `sudo ebuild foo-1.2.3 ebuild merge`
    to continue for _that package only_.

    The rest of the emerge will need to be restarted and the depgraph
    recalculated to finish whatever upgrade you were doing.

    If it's something big like Chromium though, by all means use
    `ebuild` to save a bunch of time - it's a lot better than
    global `ccache`. :)

    Cheers,

    Matt

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sun Feb 9 00:11:56 2025
    On Saturday 8 February 2025 23:07:38 Greenwich Mean Time Jack wrote:
    On 2025.02.08 14:00, Filip Kobierski wrote:
    Hi Jacques,

    I think you are looking for SIGSTP or SIGSTOP but I think that's
    not exactly it. From what I know you cannot do that for emerge
    easily. For similar results you might want to set up ccache. https://wiki.gentoo.org/wiki/Ccache

    Regards
    Filip

    On Saturday, February 8th, 2025 at 15:47, Jacques Montier

    <jmontier@gmail.com> wrote:
    Hello everyone,
    Is it possible to stop a compilation midway in the case of a very

    long compilation and then resume it from the same point without
    having to start over from the beginning ?

    Thank you for your response.
    Best regards,

    --
    Jacques Montier.

    If you really mean just interrupting a compile, then you should be able
    to stop with Ctl-C, and then start/continue by running make or ninja
    again, assuming that is what is used for whatever you are compiling.
    Ccache can help since most of the results of the previous compile
    attempt will have been cached, and so will be completed more quickly
    the next time, but it's not the same as continuing from where it was interrupted.

    If, as Filip implies, you are asking about interrupting emerge, it's
    easy enough to interrupt, but essentially impossible to continue from
    where it left off. "emerge --continue" will just try to emerge every
    package from the interrupted emerge which was not completed, but it
    will start each one from scratch. What has often, but not alwasy
    worked for me, is to use ebuild directly. "ebuild
    .../path/to/package.ebuild compile" will figure out that everything
    prior to the compile was completed, and then issue the make or ninja commands, which will just pick up where they left off. If that does
    work, then you need to repeat the ebuild, but with the install and then
    the qmerge commands. The only problem with that (for me, at least) is
    that ebuild does not leave exactly the same lines in emerge.log, so a
    package installed that way will not show up in "gentlop -t package"
    output.

    You can run 'ebuild <package> merge', but this will only continue with the
    last package you were emerging when it was interrupted and it will continue from whatever stage the emerge was at the time it was interrupted.

    If your intention is to suspend/hibernate the OS halfway through an emerge and continue later on, then you can suspend the emerge job with job control:

    Ctrl+z

    After you wake up the system from suspend or reboot from hibernate you can bring the emerge job back into the foreground, so it can continue running from where you left it, by invoking:

    fg

    NOTE: Depending how many threads you were running before you suspended the emerge and how much swap was being used, you may need to wait for a few
    minutes for all the threads to pause. Keep an eye on top to confirm this has taken place and the CPU is now idle, before you suspend/hibernate the OS. If you don't you could discover the suspend/hibernate fails if you do not have enough RAM/space.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmen8swACgkQseqq9sKV ZxmXpw/+IddqmWc/L23JvGC/H/yrxsD4BSe381hYe9UZxZXHvLv79WhdDyhdicCy fyI7niFa8aHuW0Hyc8/6RLJOf7XBnOMPwHOhe7ArMi7KtOUEo9nNQHlKQCd1IPpd B0yvLGMqfLPtLkSrbe/n3dUMUBev2SKqPd8XYXKmhcfAgP1C/8adQ3F1DS5cwcS7 aMrMgttVEHHlt6ltaeoazvZ1BjjPy6r7ra6Sqz7Kg9HdtCIYPb+IKUc1cIi7Ro+p Niw61EPSfc6jTQ4FH4yT1/Pg/w/3+Vb1Kr3/hNObGV6g/mZBChNivzeq8I60njb7 zEHO18p8mLOOeukTncavpYFj+1PRPRGtehVG8OOJalw6aNWVqJEVfy1sS/J6Gbv7 JAq/iqbfwHmIIfBlipLMGQswE+tmX4WIGdpRQrAOJ3/Omm6vLmXHD/YqVUvc6JRH 2eTcy7IuvPcSTwOY9kAVr1JXTQuAuh4PCQVtIQP2YqIFFARwu5oiE0DvVqG4ygON aWhHqDaDt/cwlIk/zRhGmNNCkHQlcmKV7bNHb6Z9RzmjssMsmi5gwd87jpoyfn8a Ee3gbVZSVu3NQeq5rBc20QBDf92Kp8OfP40xjcOesmiLrQ0KsKeVGTju1S+whbQi dCMl9HtCcJt4M1NKiiEe7694LneoNGLEETUT7JIfv8UYd/R0rq4=
    =zm3E
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MLR@21:1/5 to Jacques Montier on Sun Feb 9 11:30:02 2025
    This is a multi-part message in MIME format.
    Hi,


    use a VM to build binpkgs, you can suspend the VM. Or build over chroot
    from the VM in the main computer (you can suspend the VM).

    Best regards


    On 08.02.25 15:47, Jacques Montier wrote:
     Hello everyone,

    Is it possible to stop a compilation midway in the case of a very long compilation and then resume it from the same point without having to
    start over from the beginning ?

    Thank you for your response.

    Best regards,

    --
    Jacques Montier.

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <p>Hi,</p>
    <p><br>
    </p>
    <p>use a VM to build binpkgs, you can suspend the VM. Or build over
    chroot from the VM in the main computer (you can suspend the VM).</p>
    <p>Best regards</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 08.02.25 15:47, Jacques Montier
    wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAHVEG0B76sAaYYTK7KLoaZZvXrX8of3aW0_4KsHYuHKQrVF+hg@mail.gmail.com">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <div dir="ltr"> Hello everyone,
    <div><br>
    Is it possible to stop a compilation midway in the case of a
    very long compilation and then resume it from the same point
    without having to start over from the beginning ?<br>
    <br>
    </div>
    <div>Thank you for your response.
    <div><br clear="all">
    </div>
    <div>Best regards,</div>
    <div><br>
    </div>
    <div>
    <div dir="ltr" class="gmail_signature"
    data-smartmail="gmail_signature">
    <div dir="ltr">
    <div>--</div>
    <div>Jacques Montier.</div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </blockquote>
    </body>
    </html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?H=C3=A5kon_Alstadheim?=@21:1/5 to All on Sun Feb 9 15:40:02 2025
    Den 08.02.2025 15:47, skrev Jacques Montier:
     Hello everyone,

    Is it possible to stop a compilation midway in the case of a very long compilation and then resume it from the same point without having to
    start over from the beginning ?

    Thank you for your response.

    For the big compiles I set PORTAGE_TMPDIR=/pt/ , which I have created
    and which is NOT a tmpfs, so it will survive a reboot (and I don't have
    enough ram anyway) . You might also want to check FEATURES, either
    globally or on a per-package basis, make sure you don't have fail-clean.
    Watch out so your newly permanent tmpdir does not fill up.

    Then, if it dies for some reason, I do for example:

    <code> ebuild `equery w www-client/firefox ` merge. </code>

    make  or cmake or whatever will do the best it can to pick up where it
    left off.

    P.S: Search the web to find out to set FEATURES and PORTAGE_TMPDIR in
    the environment on a per-package basis, or just prepend the settings to
    your command-line.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sun Feb 9 17:06:42 2025
    On Sunday 9 February 2025 16:44:55 Greenwich Mean Time Jacques Montier wrote:
    Le dim. 9 févr. 2025 à 15:36, Håkon Alstadheim <hakon@alstadheim.priv.no> a

    écrit :
    Den 08.02.2025 15:47, skrev Jacques Montier:
    Hello everyone,

    Is it possible to stop a compilation midway in the case of a very long compilation and then resume it from the same point without having to start over from the beginning ?

    Thank you for your response.

    For the big compiles I set PORTAGE_TMPDIR=/pt/ , which I have created
    and which is NOT a tmpfs, so it will survive a reboot (and I don't have enough ram anyway) . You might also want to check FEATURES, either
    globally or on a per-package basis, make sure you don't have fail-clean. Watch out so your newly permanent tmpdir does not fill up.

    Then, if it dies for some reason, I do for example:

    <code> ebuild `equery w www-client/firefox ` merge. </code>

    make or cmake or whatever will do the best it can to pick up where it
    left off.

    P.S: Search the web to find out to set FEATURES and PORTAGE_TMPDIR in
    the environment on a per-package basis, or just prepend the settings to your command-line.

    Thank you all for your feedback and advice.
    For testing,
    - emerge media-libs/opencv-4.10.0
    - some time later CTRL+C to stop compilation

    Then I followed Jack's advice
    - ebuild /var/db/repos/gentoo/media-libs/opencv/opencv-4.10.0.ebuild compile - ebuild /var/db/repos/gentoo/media-libs/opencv/opencv-4.10.0.ebuild
    install - ebuild
    /var/db/repos/gentoo/media-libs/opencv/opencv-4.10.0.ebuild qmerge

    Everything worked fine, thanks a lot.

    Good evening to all,

    Best regards,

    --
    Jacques

    Unless you have a good reason to run each emerge stage separately, you can just use 'merge' for all of them - you can check 'man ebuild' for an explanation.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmeo4KIACgkQseqq9sKV ZxkpPg//bSojlC3Z4eVZ+eD94TvwEpo9FOyfklloiWayrp8Uhf2z3LXfhLRdG/pt p17EQhpiLr7SfvEArpgrEiMUmEkKqUFVLzC3IeHgSiP4/Uofjvk9AclqhV4NL8iS 8iMW7d1E8k2T2JkHZr+S1tz/xFMmNCKlXbRlByQW0+zm7ofH3Me7JYFODqFw5hph TgJ/DJO6RIlnDYON1LaLqSmPsOTRcNQ0zfLRKpYMOY+G+F7HsIVJFjiw0xwu4FYC NW17EHAJwH0sTLaZ6KfA+3LCKaSc6v8maGUgSMM+xEBa6Uz9tXLePfab9aW0BQZi ODh6HM1slj+l2DG+lchK1X4X0C4h9u949IrYRoiLeOPABZfGh2gn0LptegaYSMo/ 2zltb4tffRAll1sxS0HXiMNoI6YmIrJ6t02MH6bz/0Y8QdQ5BA5yjBbi6oe2tqag KupaAIWwcPJHZDjd3DfX+N1BLd6FwOLKn85j0tImuoTLDpWlQkou24d/fxKwIj7j eXRUv84wS/bTTib4eYDQZldxNKztq9+kym3DrMTVVwv1PXK9FJaa4MFtOLe3ALjh 2t6cLq6jOPj0Wuiy9cRwn3IurVCY8vNPPeXbL3geUgqd9GzgTheI1SKV13UXa+fy CSLePi0sXwqbd3EJJdOkhYVCNEwlhqf9mQTkjjFums6J6OCizmA=
    =Nm4T
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Dale on Sun Feb 16 18:30:01 2025
    On 09/02/2025 05:28, Dale wrote:
    Oops.  I didn't think about it being on tmpfs.

    /var/tmp should not be on tmpfs. /tmp may or may not survive a reboot,
    /var/tmp is exlicitly where applications are supposed to store their
    crash recovery stuff, and so it is explicitly defined as surviving a reboot.

    Doesn't stop people who don't know this from setting their systems up
    wrong - I did that initially :-)

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)