aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Revert "emerge-webrsync: actually honour the sync-webrsync-verify-signature ↵HEADmasterSam James9 days2-10/+8
| | | | | | | | | | | | | attribute" This reverts commit f99eb91227918d5bf0cc531e78bd597c73b7ce1f. Revert for now as we understand the status quo better, and this breaks syncing w/ emerge-webrsync. I'll come back to this but I'd rather work with a known quantity for now than rush a fix. Bug: https://bugs.gentoo.org/940120 Signed-off-by: Sam James <sam@gentoo.org>
* SpawnProcess: Remove unused _CGROUP_CLEANUP_RETRY_MAXZac Medico11 days1-4/+0
| | | | | | | | Left over from FEATURES="cgroup". Fixes: f8e3b11496bd6d602a690535c4a3bb32bb8e9744 Bug: https://bugs.gentoo.org/894398 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Remove obsolete pylint optionsMike Gilbert2024-09-232-9/+0
| | | | Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* NEWS, meson.build: prepare for portage-3.0.66.1portage-3.0.66.1Sam James2024-09-182-1/+10
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* install-qa-check.d/90config-impl-decl: Skip pthread_get_name_np on LinuxMatt Turner2024-09-121-0/+1
| | | | | | | | Seen in dev-util/lttng-tools and dev-util/lttng-ust. The function seems to be available on at least Darwin, FreeBSD, and OpenBSD. Signed-off-by: Matt Turner <mattst88@gentoo.org>
* install-qa-check.d/90config-impl-decl: Skip pthread_set_name_np on LinuxMatt Turner2024-09-121-0/+1
| | | | | | | | | Seen in dev-lang/erlang, dev-util/lttng-tools, and dev-util/lttng-ust. The function seems to be available on at least Darwin, FreeBSD, and OpenBSD. Bug: https://bugs.gentoo.org/898762 Signed-off-by: Matt Turner <mattst88@gentoo.org>
* install-qa-check.d/90config-impl-decl: Skip pthread_threadid_np on LinuxMatt Turner2024-09-121-0/+1
| | | | | | | Seen in dev-db/mariadb. The function seems to be available on Darwin. Bug: https://bugs.gentoo.org/899772 Signed-off-by: Matt Turner <mattst88@gentoo.org>
* install-qa-check.d/90config-impl-decl: Skip ↵Matt Turner2024-09-121-0/+1
| | | | | | | | | | | pthread_cond_timedwait_monotonic_np on Linux Seen in mail-client/thunderbird, www-client/seamonkey, and www-client/firefox. It seems to be an Android/bionic function. Bug: https://bugs.gentoo.org/905825 Closes: https://bugs.gentoo.org/932360 Signed-off-by: Matt Turner <mattst88@gentoo.org>
* NEWS: fix typoSam James2024-09-111-1/+1
| | | | | | Reported by Eli. Signed-off-by: Sam James <sam@gentoo.org>
* JobStatusDisplay: introduce max_display_width variableFlorian Schmaus2024-09-111-3/+6
| | | | | | | | | Values that belong together and may only be changed at the same time should be combined in a common constant. So let's do this. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1377 Signed-off-by: Sam James <sam@gentoo.org>
* JobStatusDisplay: fix setting the default width to 100Florian Schmaus2024-09-111-2/+2
| | | | | | | | | | | This fixes a28a0fd66002 ("JobStatusDisplay: increase the default width to 100") which attempted to set the default width to 100. However, the out of bounds check in _set_width() was not adjusted. Therefore, the default width was effectively still 80. Fixes: a28a0fd6600242a2e062a0fd2d7d5be95296b7ae Signed-off-by: Florian Schmaus <flow@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* NEWS, meson.build: prepare for portage-3.0.66portage-3.0.66Sam James2024-09-112-2/+2
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* NEWS: updateSam James2024-09-111-1/+40
| | | | | Bug: https://bugs.gentoo.org/933499 Signed-off-by: Sam James <sam@gentoo.org>
* unpack: Update a commentUlrich Müller2024-09-101-1/+1
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* NEWS: Announce unpack changesUlrich Müller2024-09-101-0/+3
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* unpack: Match file extensions case-sensitively in old EAPIsUlrich Müller2024-09-101-88/+9
| | | | | | This fixes PMS compliance and at the same time simplifies the code. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* unpack: Don't display "Unpacking ..." for skipped filesUlrich Müller2024-09-101-21/+28
| | | | | | | | | | | | | | | | PMS says that "Any unrecognised file format shall be skipped silently." This wording was added with the draft of what later became EAPI 4: https://gitweb.gentoo.org/proj/pms.git/commit/?id=634c32f231e1bc94d64588e2b2edf0ad1ca60f1f The commit message doesn't give any rationale for "silently". It may well be that the wording is a remnant of the rejected "unpack --if-compressed" item. See the discussion in the 2009-04-23 council meeting: https://projects.gentoo.org/council/meeting-logs/20090423.txt (starting at 21:35). Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* install-qa-check.d: try to detect gcc warnings past colorEli Schwartz2024-09-101-1/+1
| | | | | | | | | | | | | | | | We have some code we use for config-impl-decl which can strip color codes out via sed. This is always necessary for config.log because if color exists it will still be there. The assumption was, likely, that build.log as managed by portage will also be ansifilter'd by portage, and therefore stripping color is unnecessary. But in fact, some people do like color and intentionally avoid stripping it. This rendered the QA check effectively broken. Instead we should make no assumptions, and explicitly strip this too. Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1375 Signed-off-by: Sam James <sam@gentoo.org>
* eapi.py: Use attrs instead of hardcoding EAPIs in functionsUlrich Müller2024-09-091-6/+24
| | | | | | | Adding new attrs as needed. Their name is the same as the corresponding PMS feature label (if one exists). Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* eapi.py: Sort _eapi_attrs alphabeticallyUlrich Müller2024-09-091-2/+2
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* asyncio: Avoid _wrap_loop prior to create_subprocess_execZac Medico2024-08-311-2/+1
| | | | | Bug: https://bugs.gentoo.org/761538 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* asyncio: Use default ensure_future implementation when possibleZac Medico2024-08-311-0/+3
| | | | | | | | | When a loop argument is not given, use the default asyncio ensure_future implementation and avoid unnecessary _wrap_loop usage. Bug: https://bugs.gentoo.org/761538 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* asyncio: Use default sleep implementation when possibleZac Medico2024-08-311-2/+5
| | | | | | | | When a loop argument is not given, use the default asyncio sleep implementation and avoid unnecessary _wrap_loop usage. Bug: https://bugs.gentoo.org/761538 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _safe_loop: Discard wrapped asyncio.run loop that was closedZac Medico2024-08-311-0/+7
| | | | | | | | | | | Since commit cb0c09d8cecb, _get_running_loop can wrap loops from asyncio.run, so these loops need to be discarded if they've been closed. Fixes: cb0c09d8cecb ("Support coroutine exitfuncs for non-main loops") Bug: https://bugs.gentoo.org/938761 Bug: https://bugs.gentoo.org/761538 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* man/emerge.1: Fixed a typoAllen-Kristjan Päll2024-08-201-1/+1
| | | | | | Signed-off-by: Allen-Kristjan Päll <akpall+gentoo@fst.ee> Closes: https://github.com/gentoo/portage/pull/1373 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Remove unused and unimplemented asyncio.Task classZac Medico2024-08-181-11/+0
| | | | | | | | This class originated from commit 142d08c0636b and it is unused since _PortageEventLoop was removed in commit 20204fd8c29. Fixes: 20204fd8c29 ("Remove unused _PortageEventLoop and _PortageChildWatcher") Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _wrap_loop: Prevent redundant AsyncioEventLoop instancesZac Medico2024-08-181-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | Ultimately the loop arguments that necessitate the _wrap_loop function can be removed, because our aim since bug 761538 should be to eliminate them. Meanwhile, we don't want _wrap_loop to return redundant AsyncioEventLoop instances if we can easily prevent it. Therefore, use _safe_loop(create=False) to look up the AsyncioEventLoop instance associated with the current thread, and avoid creating redundant instances. This serves to guard against garbage collection of AsyncioEventLoop instances which may have _coroutine_exithandlers added by the atexit_register function since commit cb0c09d8cecb from bug 937740. If _safe_loop(create=False) fails to associate a loop with the current thread, raise an AssertionError for portage internal API consumers. It's not known whether external API consumers will trigger this case, so if it happens then emit a UserWarning and return a temporary AsyncioEventLoop instance. Fixes: cb0c09d8cecb ("Support coroutine exitfuncs for non-main loops") Bug: https://bugs.gentoo.org/938127 Bug: https://bugs.gentoo.org/937740 Bug: https://bugs.gentoo.org/761538 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Make portage.util.compression_probe work when ctypes is unavailablemid-kid2024-08-151-2/+2
| | | | | | | | This is useful for bootstrapping purposes, as _ctypes requires a dynamic linker. Closes: https://github.com/gentoo/portage/pull/1363 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* ebuild.5: update QA variables affected by QA_PREBUILTLucio Sauer2024-08-151-22/+22
| | | | | | Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Closes: https://github.com/gentoo/portage/pull/1367 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* phase-functions: extend QA_PREBUILT handling to QA_SONAME_NO_SYMLINKLucio Sauer2024-08-151-1/+2
| | | | | | | | | | This behavior is implied by the ordering of QA variables in the man page since the introduction of QA_SONAME_NO_SYMLINK. Bug: https://bugs.gentoo.org/924953 Fixes: dcb42a417355510284a35c08a4bf849047122a5c Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* _EbuildFetcherProcess: Suppress asyncio.CancelledErrorZac Medico2024-08-141-1/+1
| | | | | | Fixes: 74e29110d86a ("_EbuildFetcherProcess: Suppress CancelledError") Bug: https://bugs.gentoo.org/937888 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* run_exitfuncs: Drop hooks inherited via forkZac Medico2024-08-141-2/+7
| | | | | | | | | Drop hooks inherited via fork because they can trigger redundant actions as shown in bug 937891. Note that atexit hooks only work after fork since issue 83856 was fixed in Python 3.13. Bug: https://bugs.gentoo.org/937891 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _EbuildFetcherProcess: Suppress CancelledErrorZac Medico2024-08-141-1/+1
| | | | | | | | | Suppress CancelledError when attempting to cache the result in the _async_uri_map method. The cancelled result is returned for the caller to handle. Bug: https://bugs.gentoo.org/937888 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* dispatch-conf: ignore SHELL in spawn_shellMike Gilbert2024-08-141-19/+11
| | | | | | | | | | There is no need to use SHELL here, and this can actually cause problems when SHELL is set to "nologin" or "false". Look for sh in PATH instead. Bug: https://bugs.gentoo.org/910560 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* Support coroutine exitfuncs for non-main loopsZac Medico2024-08-114-29/+76
| | | | | | | | | | | | | | | | | | | | Since an API consumer can cause loops to be instantiated for non-main threads, support coroutine exitfuncs for each loop. The included Socks5ServerAtExitThreadedTestCase calls get_socks5_proxy from a non-main thread, and demonstrates that coroutine exitfuncs for the resulting non-main loop will reliably stop the socks5 proxy via atexit hook. The _thread_weakrefs_atexit function will now make a temporary adjustment to _thread_weakrefs.loops so that a loop is associated with the current thread when it is closing. Also, the _get_running_loop function will now store weak references to all _AsyncioEventLoop instances it creates, since each has a _coroutine_exithandlers attribute that can be modified by atexit_register calls. Bug: https://bugs.gentoo.org/937740 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* run_exitfuncs: Support loop close via hookZac Medico2024-08-085-21/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle the case where the loop has not been explicitly closed before exit. In this case, run_exitfuncs previously tried to call coroutine functions as though they were normal functions, which obvously would not behave correctly. Solve this problem by storing the coroutine functions in a separate _coroutine_exithandlers list that belongs exclusively to the run_coroutine_exitfuncs function, so that it is safe to close the loop and call run_coroutine_exitfuncs from inside a run_exitfuncs hook. A _thread_weakrefs_atexit hook already exists that will close weakly referenced loops. The _thread_weakrefs_atexit hook is now fixed to release its lock when it closes a loop, since the same lock may need to be re-acquired when run_coroutine_exitfuncs runs. The included test case demonstrates that run_exitfuncs will run via an atexit hook and correctly terminate the socks5 proxy in a standalone program using the portage API (like eclean). Due to a deadlock that will occur if an _exit_function atexit hook from the multiprocessing module executes before run_exitfuncs, a portage.process._atexit_register_run_exitfuncs() function needs to be called in order to re-order the hooks after the first process has been started via the multiprocessing module. The natural place to call this is in the ForkProcess class, using a global variable to trigger the call just once. Fixes: c3ebdbb42e72 ("elog/mod_custom: Spawn processes in background") Bug: https://bugs.gentoo.org/937384 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* doebuild.spawn: Skip socks5 proxy for "depend" phaseZac Medico2024-08-071-1/+1
| | | | | | | | | | | | Skip the socks5 proxy for the "depend" phase. It should not be needed because we only allow bash builtin commands during this phase. Since the socks5 proxy requires portage's event loop to be explictly closed before exit, skipping it will allow programs like eclean-dist to avoid the need to explicitly close portage's event loop before exit. Bug: https://bugs.gentoo.org/937384 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ELF: add entries for BPFSam James2024-08-072-2/+5
| | | | | Bug: https://bugs.gentoo.org/937485 Signed-off-by: Sam James <sam@gentoo.org>
* NEWS: Fix FETCHCOMMAND spellingZac Medico2024-08-031-1/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _EbuildFetcherProcess: Handle SIGTERMZac Medico2024-08-035-32/+257
| | | | | | | | | | | | | | | | | | | | | Fix _EbuildFetcherProcess to handle SIGTERM, so that FETCHCOMMAND processes will not be left running in the background: * Convert the fetch function to an async_fetch coroutine function so that it can use asyncio.CancelledError handlers to terminate running processes. * Use multiprocessing.active_children() to detect and terminate any processes that asyncio.CancelledError handlers did not have an opportunity to terminate because the exception arrived too soon after fork/spawn. * Add unit test to verify that a child process is correctly killed when EbuildFetcher is cancelled, with short timeout in case it takes some time for the process to disappear. Bug: https://bugs.gentoo.org/936273 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* JobStatusDisplay: increase the default width to 100Florian Schmaus2024-08-021-1/+1
| | | | | | | | | | | | | | | | Conservatively modernize the default width value from 80 to 100. Usually, I do not care much about the width, but the job status display holds more information these days, compared to the times where this value was set. Plus, self._isatty has the tendency to return false, even though portage is actually run within a tty. The prime examples causing this are systemd-run (and run0). Therefore, a conservatively increasing the value is sensible. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1348 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* JobStatusDisplay: show length of merge-wait queueFlorian Schmaus2024-08-023-1/+13
| | | | | | | | | | Since FEATURES=merge-wait is now the default, the length of the merge-wait queue becomes more relevant. Hence show it as part of portage's job status display. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1347 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* emerge-webrsync: actually honour the sync-webrsync-verify-signature attributeKerin Millar2024-07-262-8/+10
| | | | | | | | | | | | | | | The repo_has_webrsync_verify variable was always being set as the empty string, despite later being compared to 1 in the arithmetic context. Have it work in the way that was originally intended. This also eliminates a superfluous use of the has() function, which was the reason for my inspecting the code in the first place. Also, apply the exact same fix to emerge-delta-webrsync. Fixes: b5cd549e07f3d835cbe04e5b718cdd47d7ee69f5 Fixes: 0347637fe5033d3d8eb4fdafa1e86de171934819 Signed-off-by: Kerin Millar <kfm@plushkava.net> Signed-off-by: Sam James <sam@gentoo.org>
* Check whether xtrace is enabled sensiblyKerin Millar2024-07-264-7/+7
| | | | | | | | To write [[ ${-/x/} != $- ]] is horribly backwards and comparatively expensive. Implement the test - and its inverse - in a sensible fashion. Signed-off-by: Kerin Millar <kfm@plushkava.net> Signed-off-by: Sam James <sam@gentoo.org>
* make.globals: add bcachefs_effective.* and bcachefs.* to PORTAGE_XATTR_EXCLUDEFlorian Schmaus2024-07-212-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Just like btrfs the bcachefs filesystem makes heaviy use of xattrs. In my case emerge --config gentoo-kernel failed with install-xattr: setxattr() failed: Operation not supported A strace revealed setxattr("/boot/efi/8410476acd4b1e12c678fc815c18f551/6.9.5-gentoo-dist/linux", "bcachefs_effective.background_co"..., "zstd", 4, 0) = -1 EOPNOTSUPP (Operation not supported) and indeed, the source file to the install operation was under /usr/src which had background compression enabled. As a result, install-xattr tried to copy the attribute over to the destination file and failed. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1346 Signed-off-by: Sam James <sam@gentoo.org>
* convert f-strings to normal stringsMarkus Meier2024-07-195-7/+7
| | | | | | | | | that do not contain any {}. detected with ruff Signed-off-by: Markus Meier <maekke@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1355 Signed-off-by: Sam James <sam@gentoo.org>
* ebuild: try to make maintainer mode checks a bit less prone to FPEli Schwartz2024-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We sometimes get weird results. For example, in binutils/gdb, we get: ``` * QA Notice: Automake "maintainer mode" detected: * * checking for aclocal... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing aclocal-1.15 * checking for autoconf... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoconf * checking for autoheader... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoheader * checking for aclocal... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing aclocal-1.15 * checking for autoconf... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoconf * checking for autoheader... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoheader ``` The current pattern looks for the definition of the "missing" script followed by known autotools commands. With a bit more effort, we can hopefully match the actual `make` commands that get produced as maintainer targets. As far as I can tell, they always include an attempt to cd to the project root and then run the maintainer target. Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1359 Signed-off-by: Sam James <sam@gentoo.org>
* binrepos.conf: Support custom download locationZac Medico2024-07-169-12/+106
| | | | | | | | | | | | | | | | | | | | | | | Download packages to a custom location if it is configured in binrepos.conf, instead of PKGDIR. If a custom download location is not configured then inject downloaded packages into PKGDIR as usual. The binarytree download_required method should now be used instead of the isremote method to check if download is required, since a remote package may or may not be cached in the custom location. The get_local_repo_location method should be used to check if there is a custom download location, and if there is then downloaded packages must not be injected into PKGDIR. If any packages from a repo with a custom download location were injected into PKGDIR in the past, their identity will be recognized and will not be re-downloaded to the custom location. Bug: https://bugs.gentoo.org/934784 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* config: Allow a repository to be configured using one of its aliasesJames Le Cuirot2024-07-102-4/+9
| | | | | | | | | | | | | | | | | | | Currently, the `[name]` in repos.conf can only match the primary name. This is inconvenient if a repository wants to change its name without breaking existing configurations. This raises the question of whether to then use the primary name or the alias in the UI and in the vardb. I went with the primary name because this is presumably the name that the repository actually wants you to use. If the configured name matches neither the primary name nor an alias, then emaint sync will simply claim that it is not found, but that behaviour is unchanged from before. Bug: https://bugs.gentoo.org/935830 Closes: https://github.com/gentoo/portage/pull/1358 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* Allow GIL to be disabled in whirlpool C extensionZac Medico2024-06-281-17/+29
| | | | | | | | | | | | | | | In 3.13 python extensions need to declare support for GIL features, for example if they don't declare Py_MOD_GIL_NOT_USED then it will cause the GIL to be enabled even when python was launched in free-threaded mode. This requires "multi-phase initialization" because Py_mod_create is incompatible with m_slots. There's a PyUnstable_Module_SetGIL() function that can be used with single-phase init, but it's an unstable API, so it's better to use multi-phase init. There's no need to use PyModule_GetState() because the whirlpool module has no mutable state. Bug: https://bugs.gentoo.org/934220 Signed-off-by: Zac Medico <zmedico@gentoo.org>