Summary: | sys-apps/portage: sys-devel/gcc installation fails with ansifilter: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory PORTAGE_LOG_FILTER_FILE_CMD="ansifilter --ignore-clear" | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Thomas Deutschmann (RETIRED) <whissi> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | sam, toolchain, toralf |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 785484 | ||
Attachments: | bash script to supervise PORTAGE_LOG_FILTER_FILE_CMD with fallback to cat |
Description
Thomas Deutschmann (RETIRED)
![]() (In reply to Thomas Deutschmann from comment #0) > During my testing I once somehow spotted > > > ansifilter: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory > > as last output from emerge after merging. Maybe there's really nothing portage can do about this except recommend that you use a static executable for PORTAGE_LOG_FILTER_FILE_CMD. You can rule out portage as the culprit if the installation succeeds with PORTAGE_LOG_FILTER_FILE_CMD="cat". There's a fallback if exec fails here: https://gitweb.gentoo.org/proj/portage.git/tree/lib/portage/util/_async/BuildLogger.py?h=portage-3.0.18#n55 However, if it fails after exec, then you're in trouble. (In reply to Zac Medico from comment #2) > There's a fallback if exec fails here: > > https://gitweb.gentoo.org/proj/portage.git/tree/lib/portage/util/_async/ > BuildLogger.py?h=portage-3.0.18#n55 > > However, if it fails after exec, then you're in trouble. I suppose portage could wrap PORTAGE_LOG_FILTER_FILE_CMD with some kind of supervisor that behaves like cat after the subprocess has died and stdin shows that there's something to read. Portage can use an instance of ForkProcess to supervise PORTAGE_LOG_FILTER_FILE_CMD. We can make the supervisor optional, in case anyone wants to avoid the overhead. Since ForkProcess is generally reserved for processes that require a fork, I'll probably use a standalone executable for this. It could be a general purpose program that has nothing to do with portage. It's just a program like cat that can supervise and take over if PORTAGE_LOG_FILTER_FILE_CMD dies while stdin has remaining input. We should be able to use a bash script as the supervisor, and make it exec cat if PORTAGE_LOG_FILTER_FILE_CMD fails. Created attachment 698853 [details]
bash script to supervise PORTAGE_LOG_FILTER_FILE_CMD with fallback to cat
For example, save the attached scrpt as /usr/local/bin/filter-command-supervisor, and then use this setting:
PORTAGE_LOG_FILTER_FILE_CMD="filter-command-supervisor ansifilter --ignore-clear"
We can inline the supervisor in portage code as this command: bash -c '"$@"; exec cat' This does the trick: PORTAGE_LOG_FILTER_FILE_CMD="bash -c \"ansifilter --ignore-clear; exec cat\"" (In reply to Zac Medico from comment #10) > This does the trick: > > PORTAGE_LOG_FILTER_FILE_CMD="bash -c \"ansifilter --ignore-clear; exec cat\"" Maybe we can just update the make.conf man page to suggest this kind of supervisor usage with ansifilter. Comment on attachment 698853 [details] bash script to supervise PORTAGE_LOG_FILTER_FILE_CMD with fallback to cat make.conf.5 patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/637b6d8e19a8221bccfa7d82141d300c https://github.com/gentoo/portage/pull/695 *** Bug 781713 has been marked as a duplicate of this bug. *** (In reply to Zac Medico from comment #11) > (In reply to Zac Medico from comment #10) > > This does the trick: > > > > PORTAGE_LOG_FILTER_FILE_CMD="bash -c \"ansifilter --ignore-clear; exec cat\"" > I tried that but for some reason here at the tinderbox I got empty log files and non-exit code - might investigate it further .... (In reply to Toralf Förster from comment #14) > I tried that but for some reason here at the tinderbox I got empty log > files and non-exit code - might investigate it further .... sry - PEBKAC The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=1f3bfcb357c3f262730175f4d59c11e1ed4f8dc3 commit 1f3bfcb357c3f262730175f4d59c11e1ed4f8dc3 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2021-04-09 18:26:49 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-05-24 06:44:57 +0000 make.conf.5: Suggest PORTAGE_LOG_FILTER_FILE_CMD supervisor for cat fallback (bug 781854) If PORTAGE_LOG_FILTER_FILE_CMD fails after exec, then output will be lost. Therefore, suggest to use bash as a supervisor, with fallback to cat. Bug: https://bugs.gentoo.org/781854 Signed-off-by: Zac Medico <zmedico@gentoo.org> man/make.conf.5 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cba21902d9a8d1ac07d2ff5b0d932e71fc1fac67 commit cba21902d9a8d1ac07d2ff5b0d932e71fc1fac67 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2021-05-24 07:47:11 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-05-24 09:05:08 +0000 sys-apps/portage: Bump to version 3.0.19 #520378: allow emerge --fetchonly to log to emerge-fetch.log #698244: portage(5) document user patch / eapply_user #781854: Suggest PORTAGE_LOG_FILTER_FILE_CMD cat fallback #782724: sort emerge --unmerge order for determinism #783957: lazily evaluate cnf_* variables in tests #784566: make emerge insensitive to relative order of optional and positional arguments #787545: emerge CTRL C may be ignored when running pkg_pretend #787563: ebuild-ipc could handle KeyboardInterrupt #788967: emerge --jobs= triggers TypeError Bug: https://bugs.gentoo.org/785484 Bug: https://bugs.gentoo.org/788967 Bug: https://bugs.gentoo.org/787563 Bug: https://bugs.gentoo.org/787545 Bug: https://bugs.gentoo.org/784566 Bug: https://bugs.gentoo.org/783957 Bug: https://bugs.gentoo.org/782724 Bug: https://bugs.gentoo.org/781854 Bug: https://bugs.gentoo.org/698244 Bug: https://bugs.gentoo.org/520378 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.19.ebuild | 266 +++++++++++++++++++++++++++++++++ 2 files changed, 267 insertions(+) |