On 2024.03.22 16:22, Neil Bothwick wrote:
On Fri, 22 Mar 2024 12:57:34 -0400, Jack wrote:
> In this case, the offending package is dev-lang/rust, but this has
> happened to me previously with other packages that require a lot of
> space and time to build.
>
> The build fails for any reason. Since it has already progressed
over
> half way through the build, I would like to continue the build
instead
> of starting from scratch. I fix whatever caused the issue. In this
> particular case, it failed for out of space, so I added another G to
> the ramdisk mounted at /var/tmp/portageg. I issue "ebuild
> path/to/package.ebuild compile" but it fails immediately because
there
> isn't enough free space. The problem is that it's checking for
enough
> free space to do the entire build, not just to continue from where
it
> left off.
Why not add more to the ramdisk, assuming it is a tmpfs. If it needs
more
than your physical memory, it will use swap, but that won't happen
because you only need the extra space.
I generally avoid this problem by having large packages use a
PORTAGE_TMPDIR on a spinning disk. It may be slightly slower, but that
doesn't really matter on a long compile, not nearly as much as having
to
restart it!
>
> I've done some searching, and found one old forum post which
suggests
> to just temporarily remove the space check from the ebuild.
>
> In this case, that seems to be line 236 of
> /usr/portage/dev-lang/rust/rust-1.75.0-r1.ebuild, which is
> "CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}" the last
> line withing pre_build_checks(). However, if I comment out that
line,
> and run "ebuild path/to/ebuild manifest" another attempt to compile
> still gives the same error about not enough space.
Have you tried setting M to a smaller value immediately before that
line?
It seems the problem is that the enviroment file in the temp dir of the
build area is sourced when you run ebuild/emerge. (It's among the
first output when you run ebuild.) Since that file was created based
on the state of the ebuild when the first emerge/ebuild was run,
editing the ebuild file doesn't affect it. I ended up finding a place
to unset CHECKREQS_FAILED, and the compile is now continuing.