Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936505 - Failed emerge removes work directory
Summary: Failed emerge removes work directory
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-22 20:44 UTC by Richard Ash
Modified: 2024-07-22 21:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log for package which failed as GPG key was locked. (dev-qt:qtwebengine-6.7.2:20240720-151339.log.xz,980.61 KB, application/x-xz)
2024-07-22 20:44 UTC, Richard Ash
Details
emerge --info output (emerge.info,8.59 KB, text/plain)
2024-07-22 21:00 UTC, Richard Ash
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Ash 2024-07-22 20:44:49 UTC
Created attachment 898146 [details]
Build log for package which failed as GPG key was locked.

I have been bitten by this a couple of times now, with different packages, so I don't think the ebuild is particularly important.
Historically, if emerging a package failed, all the files remained in place, and so it was possible to use `ebuild` to complete the build / package process, and then install the binary package quickly to get the emerge back on track.

Recently, each time emerging a package has failed (even if the failure is at the portage level, e.g. issues with the GPG key for package signing), the work directory has been left empty. This means that trying to use ebuild subsequently fails, and the package has to be recompiled from scratch, which is painful for large packages.

Specific case is qt-webengine, which I had to hibernate the PC in the middle of the build (overnight) and so the PGP key was locked by the time emerge got to package phase.

Trying to then package with ebuild fails like this:
```
ra@carrbrook ~ $ sudo ebuild /var/db/repos/gentoo/dev-qt/qtwebengine/qtwebengine-6.7.2.ebuild package
Password:
>>> Existing ${T}/environment for 'qtwebengine-6.7.2' will be sourced. Run
>>> 'clean' to start with a fresh environment.
 * qtwebengine-everywhere-src-6.7.2.tar.xz BLAKE2B SHA512 size ;-) ...                            [ ok ]
 * qtwebengine-6.7-patchset-9.tar.xz BLAKE2B SHA512 size ;-) ...                                  [ ok ]
 * checking ebuild checksums ;-) ...                                                              [ ok ]
 * checking auxfile checksums ;-) ...                                                             [ ok ]
 * checking miscfile checksums ;-) ...                                                            [ ok ]
 * Checking for at least 14 GiB RAM ...                                                           [ ok ]
 * Checking for at least 8 GiB disk space at "/var/tmp/portage/dev-qt/qtwebengine-6.7.2/temp" ... [ ok ]
 * Checking for at least 360 MiB disk space at "/usr" ...                                         [ ok ]
>>> It appears that 'setup' has already executed for 'qtwebengine-6.7.2'; skipping.
>>> Remove '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/.setuped' to force setup.
>>> It appears that 'unpack' has already executed for 'qtwebengine-6.7.2'; skipping.
>>> Remove '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/.unpacked' to force unpack.
>>> It appears that 'prepare' has already executed for 'qtwebengine-6.7.2'; skipping.
>>> Remove '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/.prepared' to force prepare.
>>> It appears that 'configure' has already executed for 'qtwebengine-6.7.2'; skipping.
>>> Remove '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/.configured' to force configure.
>>> It appears that 'compile' has already executed for 'qtwebengine-6.7.2'; skipping.
>>> Remove '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/.compiled' to force compile.
 * ERROR: dev-qt/qtwebengine-6.7.2::gentoo failed (test phase):
 *   The source directory '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/work/qtwebengine-everywhere-src-6.7.2' doesn't exist
 *
 * Call stack:
 *            ebuild.sh, line  784:  Called __ebuild_main 'test'
 *   phase-functions.sh, line 1073:  Called __dyn_test
 *   phase-functions.sh, line  502:  Called die
 * The specific snippet of code:
 *              die "The source directory '${S}' doesn't exist"
 *
 * If you need support, post the output of `emerge --info '=dev-qt/qtwebengine-6.7.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-qt/qtwebengine-6.7.2::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-qt:qtwebengine-6.7.2:20240720-151339.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/empty'
 * S: '/var/tmp/portage/dev-qt/qtwebengine-6.7.2/work/qtwebengine-everywhere-src-6.7.2'
ra@carrbrook ~ $ sudo ls /var/tmp/portage/dev-qt/qtwebengine-6.7.2/work/
ra@carrbrook ~ $ 
```
As can be seen at the end, the work directory is completely empty. This is doubly annoying because the package has actually been installed (I will attach the full emerge log) and so the work directory is not needed, only the image directory (which does still have content in it).
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-22 20:51:39 UTC
Please include emerge --info.

In this case, I suspect you got bitten by FEATURES="merge-wait" + 8ac72ee300c1e9a55f9c1ee96438e8f12d64dd20.
Comment 2 Richard Ash 2024-07-22 21:00:50 UTC
Created attachment 898147 [details]
emerge --info output

emerge --info output attached.

Executing
```
$ sudo touch /var/tmp/portage/dev-qt/qtwebengine-6.7.2/.tested
```
seems to work around this issue (but did not use to be necessary), `ebuild` then realises that the package has been installed, and gets through to the package phase as I wanted it to. Still rather odd that the work directory has been emptied out though.
Comment 3 Richard Ash 2024-07-22 21:23:53 UTC
(In reply to Sam James from comment #1)
> Please include emerge --info.
> 
> In this case, I suspect you got bitten by FEATURES="merge-wait" +
> 8ac72ee300c1e9a55f9c1ee96438e8f12d64dd20.

That does look plausible - merge-wait is on (by default) although I never use `--jobs` option to emerge (certainly not with qtwebengine!).

Is this expected with sys-apps/portage-3.0.65-r1 ? The release date for that seems to be well after the merge date of 8ac72ee300c1e9a55f9c1ee96438e8f12d64dd20 into master branch?