aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* AsynchronousTask: in _async_wait, call self.wait() immediatelyZac Medico2020-03-221-6/+6
| | | | | | | | | | In _async_wait, call self.wait() immediately so that the stack trace for an InvalidStateError will contain useful debugging information. Since commit 46903f3e5622, exit listeners are invoked via call_soon, so it's no longer unecessary for _async_wait to invoke self.wait() via call_soon. Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AsynchronousTask: include self in InvalidStateError messageZac Medico2020-03-222-2/+2
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* DoebuildSpawnTestCase: add $HOME variableZac Medico2020-03-211-1/+3
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* eqawarn: output to build log regardless of --quiet (bug 713818)Zac Medico2020-03-211-2/+2
| | | | | | | | | | | Make eqwarn output to the build log regardless of --quiet, via echo to stderr instead of __vecho. This __vecho usage was originally introduced in commit c53f52941c88, which was during the time when build output went to the tty regardless of --quiet mode (that changed in commit 0398470e5029). Bug: https://bugs.gentoo.org/713818 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman: Update for a repoman-2.3.21 releaserepoman-2.3.21Zac Medico2020-03-142-1/+7
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman.modules.vcs.git.changes: reindex (bug 712106)Zac Medico2020-03-141-3/+14
| | | | | | | | | | | | For files returned by git diff-index, call git update-index in order to ensure that the index reflects the state on disk. This will prevent incorrect assumptions in cases where the index is missing or stale for some reason. Since repoman uses this information to decide when to update copyright header dates, this can prevent spurious copyright header updates. Signed-off-by: Zac Medico <zmedico@gentoo.org> Bug: https://bugs.gentoo.org/712106
* Updates for portage-2.3.94 releaseportage-2.3.94Zac Medico2020-03-142-1/+8
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _prepare_workdir: apply PORTAGE_WORKDIR_MODE to PORTAGE_BUILDDIR (bug 692492)Zac Medico2020-03-141-7/+14
| | | | | | | | | Apply secure PORTAGE_WORKDIR_MODE permissions to PORTAGE_BUILDDIR, since the child directory ${D} and its children may have vulnerable permissions as reported in bug 692492. Bug: https://bugs.gentoo.org/692492 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* compression_probe: omit zstd --long=31 on 32-bit arch (bug 710444)Zac Medico2020-03-141-2/+8
| | | | | | | | | | Omit the zstd --long=31 argument for decompression on 32-bit architectures, since the latest version of zstd will otherwise abort with an error on 32-bit architectures. Bug: https://bugs.gentoo.org/710444 Bug: https://bugs.gentoo.org/634980 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* depgraph: respect --deep=<depth> with --update (bug 712298)Zac Medico2020-03-142-4/+22
| | | | | | | | | | | Fix the _wrapped_select_pkg_highest_available_imp method to select an installed package when appropriate for the current --deep=<depth> setting, even with --update enabled. This prevents violation of the current --deep=<depth> setting in cases where an installed package which satisfies a dependency is masked for any reason. Bug: https://bugs.gentoo.org/712298 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* man/emerge.1: fix logrotate directory containing elog-save-summaryChris Mayo2020-03-141-1/+1
| | | | | Signed-off-by: Chris Mayo <aklhfex@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SimpleEmergeTestCase: test binhost supportZac Medico2020-03-081-3/+45
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SimpleEmergeTestCase: run tests in coroutine methodZac Medico2020-03-071-7/+18
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Updates for portage-2.3.93 releaseportage-2.3.93Zac Medico2020-03-072-1/+7
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SequentialTaskQueue: cancel unstarted tasks when appropriate (bug 711322)Zac Medico2020-03-072-0/+7
| | | | | | | | | | | | When the clear method is called, cancel any tasks which have not started yet, in order to ensure that their start/exit listeners are called. This fixes a case where emerge would hang after SIGINT. Also fix the CompositeTask _cancel method to react appropriately to the cancel event when the task has not started yet. Bug: https://bugs.gentoo.org/711322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AsynchronousTask: handle addStartListener after exit (bug 711322)Zac Medico2020-03-072-0/+12
| | | | | | | | | When addStartListener is called after the task has already exited with a returncode, immediately schedule the listener to be invoked via call_soon. This behavior is similar to the Future add_done_callback method (and addExitListener since commit 5d476c4e5002). Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AsynchronousTask: simplify isAlive (bug 711688)Zac Medico2020-03-074-14/+1
| | | | | | | | | | | | | | Simplify all AsynchronousTask subclasses to use the default isAlive implementation, which returns True if self.returncode is not None. This fixes cases where the method would erroneously return False, leading to issues like bug 711688, where the CompositeTask isAlive implementation returned False for a BinpkgPrefetcher instance that was still in the process of starting via its async_start method. Fixes: d66e9ec0b105 ("AsynchronousTask: add coroutine async_start method") Bug: https://bugs.gentoo.org/711688 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AsynchronousTask: handle addExistListener after exitZac Medico2020-03-062-0/+42
| | | | | | | | | When addExistListener is called after the task has already exited with a returncode, immediately schedule the listener to be invoked via call_soon. This behavior is similar to the Future add_done_callback method. Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Scheduler: replace add_done_callback with addExitListenerZac Medico2020-03-051-16/+11
| | | | | | | | | | | For simplicity, use addExitListener instead of add_done_callback, since addExitListener has been fixed to use call_soon in commit 46903f3e5622. Note that each addExitListener call occurs *after* a call to the SequentialTaskQueue add method, since the SequentialTaskQueue needs to be notified of task exit *first* (see commit 459b3535baa4). Bug: https://bugs.gentoo.org/711322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AsynchronousTask: schedule exit listeners via call_soon (bug 711322)Zac Medico2020-03-051-32/+21
| | | | | | | | | | | Schedule exit listeners via call_soon, in order to avoid callback races like the SequentialTaskQueue exit listener race that triggered bug 711322. Callbacks scheduled via call_soon are placed in a fifo queue, ensuring that they execute in an order that is unsurprising relative to other callbacks. Bug: https://bugs.gentoo.org/711322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman: remove check for addpredictMike Gilbert2020-03-054-15/+0
| | | | | | | | | | | This function has not been deprecated, and developers generally have a good reason for using it. A repoman warning for this is just noise. No reason was given when this check was added in 2010, and it was requested by a developer who has since retired. Signed-off-by: Mike Gilbert <floppym@gentoo.org> Reviewed-by: Zac Medico <zmedico@gentoo.org>
* AsynchronousTask: schedule start listeners via call_soon (bug 711322)Zac Medico2020-03-051-1/+1
| | | | | | | | | | | Schedule start listeners via call_soon, in order to avoid callback races like the SequentialTaskQueue exit listener race that triggered bug 711322. Callbacks scheduled via call_soon are placed in a fifo queue, ensuring that they execute in an order that is unsurprising relative to other callbacks. Bug: https://bugs.gentoo.org/711322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Scheduler: use add_done_callback (bug 711322)Zac Medico2020-03-051-14/+22
| | | | | | | | | | | | | Use add_done_callback instead of addExistListener, in order to avoid callback races like the SequentialTaskQueue exit listener race that triggered bug 711322. The addExistListener method is prone to races because its listeners are executed in quick succession. In contrast, callbacks scheduled via add_done_callback are placed in a fifo queue, ensuring that they execute in an order that is unsurprising relative to other callbacks. Bug: https://bugs.gentoo.org/711322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Updates for portage-2.3.92 releaseportage-2.3.92Zac Medico2020-03-042-1/+14
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SequentialTaskQueue: update bool(self) sooner (bug 711322)Zac Medico2020-03-041-7/+9
| | | | | | | | | | | | | | | | Use addExitListener to add a _task_exit callback that will be invoked as soon as the task exits (before the future's done callback is called). This is required in order for bool(self) to have an updated value for Scheduler._schedule to base assumptions upon. Delayed updates to bool(self) is what caused Scheduler to hang as in bug 711322. This reverts changes in SequentialTaskQueue task queue exit listener behavior from commit c7e52d046621, so that only the changes necessary to support async_start remain. Fixes: c7e52d046621 ("EbuildPhase: add _async_start coroutine") Bug: https://bugs.gentoo.org/711322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Rename PORTAGE_LOG_FILTER_FILE_CMD from PORTAGE_LOG_FILTER_FILEZac Medico2020-03-027-8/+8
| | | | | | Suggested-by: Michael 'veremitz' Everitt <gentoo@veremit.xyz> Bug: https://bugs.gentoo.org/709746 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* dep_zapdeps: skip want_update_pkg if parent is None (bug 711400)Zac Medico2020-03-021-1/+1
| | | | | | | | | | | | | | | Skip the want_update_pkg call when parent is None, since passing a None parent to want_update_pkg results in an error like this: File "libdep/dep_check.py", line 513, in dep_zapdeps if graph_interface.want_update_pkg(parent, avail_pkg): File "lib/_emerge/depgraph.py", line 5850, in _want_update_pkg depth = parent.depth or 0 AttributeError: 'NoneType' object has no attribute 'depth' Fixes: f7d83d75c6b0 ("dep_zapdeps: adjust || preference for slot upgrades (bug 706278)") Bug: https://bugs.gentoo.org/711400 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* EbuildMetadataPhase: make _unregister idempotent (bug 711362)Zac Medico2020-03-021-1/+2
| | | | | | | | | | Make the _unregister method check if self._files is None, as necessary for idempotency. This will prevent the AttributeError reported in bug 711362, which was triggered by recent changes in callback scheduling order. Closes: https://bugs.gentoo.org/711362 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* doebuild: avoid emerge --pretend --fetchonly event loop recursionZac Medico2020-03-021-2/+10
| | | | | | Fixes: ec654122c0eb ("fetch: drop privileges early for NFS root_squash (bug 601252)") Bug: https://bugs.gentoo.org/601252 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* bin/socks5-server.py: PEP 492 coroutines with async and await syntaxZac Medico2020-03-011-19/+17
| | | | | https://bugs.gentoo.org/709334 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Updates for portage-2.3.91 releaseportage-2.3.91Zac Medico2020-03-012-1/+8
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AsyncioEventLoop: always die with SIGTERM in exception handler (bug 705910)Zac Medico2020-03-011-22/+9
| | | | | | | | | Remove call to pdb.set_trace() in exception handler, since it's not very useful, and always die with a SIGTERM for unexpected exceptions here. Bug: https://bugs.gentoo.org/705910 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _check_build_log: convert zlib EOFError to eerror message (bug 711174)Zac Medico2020-03-011-1/+1
| | | | | | | | Display a non-fatal eerror message when EOFError is encountered, since this need not be fatal. Bug: https://bugs.gentoo.org/711174 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Subprocess: delay unregister in _async_wait (bug 711174)Zac Medico2020-03-011-1/+10
| | | | | | | | | | | | | Since the super class AbstractPollTask _async_wait method calls _unregister, it can trigger premature _unregister before pid status is available. Therefore, only call the super class _async_wait method after pid status is available. This should help prevent premature _unregister events that trigger reading of build logs before they're closed as in bug 658806 and bug 711174. Bug: https://bugs.gentoo.org/711174 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _GeneratorTask: throw CancelledError in cancelled coroutine (bug 711174)Zac Medico2020-03-013-11/+49
| | | | | | | | | | | | | | | | Throw asyncio.CancelledError in a cancelled coroutine, ensuring that the coroutine can handle this exception in order to perform any necessary cleanup (like close the log file for bug 711174). Note that the asyncio.CancelledError will only be thrown in the coroutine if there's an opportunity (yield) before the generator raises StopIteration. Also fix the AsynchronousTask exit listener handling for compatibility with this new behavior. Fixes: 8074127bbc21 ("SpawnProcess: add _main coroutine") Bug: https://bugs.gentoo.org/711174 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SpawnProcess: cancel _main_task in _unregister (bug 711174)Zac Medico2020-03-011-0/+2
| | | | | | | | | | | | | | | | Cancel _main_task in _unregister, in order to ensure that the build log is properly closed. Note that is analogous to the fix for bug 658806 in commit a9a62e57194c, but behavior related to coroutine cancellation now plays a role since the PipeLogger is now cancelled indirectly via _main_task. We still need to verify that coroutine cancellation will raise an appropriate exception in the coroutine (asyncio.CancelledError, GeneratorExit, or StopIteration) and also that the specific coroutine will react appropriately to the specific exception that will be raised. Fixes: 8074127bbc21 ("SpawnProcess: add _main coroutine") Bug: https://bugs.gentoo.org/711174 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Add python3.9 supportManuel RĂ¼ger2020-03-014-11/+12
| | | | | Closes: https://github.com/gentoo/portage/pull/515 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _BinpkgFetcherProcess: fix async_lock event loop recursion (bug 711178)Zac Medico2020-03-011-15/+17
| | | | | | | | | Make the async_lock method use the AsynchronousLock async_start method in order to avoid event loop recursion. Fixes: 5c40c3e7e ("SpawnProcess: use async_start method (bug 709746)") Bug: https://bugs.gentoo.org/711178 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Updates for portage-2.3.90 releaseportage-2.3.90Zac Medico2020-02-293-1/+16
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* fetch: drop privileges early for NFS root_squash (bug 601252)Zac Medico2020-02-293-6/+59
| | | | | | | | | Drop privileges prior to fetch function calls, so that all necessary operations can succeed when DISTDIR is on NFS with root_squash enabled. Bug: https://bugs.gentoo.org/601252 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Support PORTAGE_LOG_FILTER_FILE (bug 709746)Zac Medico2020-02-297-20/+213
| | | | | | | | | | | | | | This variable specifies a command that filters build log output to a log file. The plan is to extend this to support a separate filter for tty output in the future. In order to enable the EbuildPhase class to write elog messages to the build log with PORTAGE_LOG_FILTER_FILE support, convert its _elog method to a coroutine, and add a SchedulerInterface async_output method for it to use. Bug: https://bugs.gentoo.org/709746 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _PostPhaseCommands: avoid CancelledError in _soname_deps_qa done callbackZac Medico2020-02-291-1/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* EbuildBuildDir: cancel current tasks for CancelledErrorZac Medico2020-02-291-16/+30
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AsyncScheduler: cancel task after _task_coroutine CancelledErrorZac Medico2020-02-291-0/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* CompositeTask: call self.cancel() for _start_task CancelledErrorZac Medico2020-02-291-1/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SpawnProcess: cancel pipe_logger after async_start CancelledErrorZac Medico2020-02-291-1/+6
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SpawnProcess: make _main cancel pipe_logger when appropriateZac Medico2020-02-291-2/+7
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SpawnProcess: only cancel self._main_task if it's not doneZac Medico2020-02-291-1/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SpawnProcess: add _main coroutineZac Medico2020-02-291-11/+22
| | | | | | | Add a _main coroutine method and make the PipeLogger instance a local variable. Signed-off-by: Zac Medico <zmedico@gentoo.org>
* FileDigester: eliminate _pipe_logger_exit with _async_waitpidZac Medico2020-02-281-2/+3
| | | | | | | Eliminate the _pipe_logger_exit method by overriding the _async_waitpid method. Signed-off-by: Zac Medico <zmedico@gentoo.org>