aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Revert "AsyncScheduler: cancel task after _task_coroutine CancelledError"Zac Medico2020-04-071-1/+0
| | | | | | | This reverts commit 27a6ee3d09ff79b6addb2696a10fcc3f46e5ca91. Bug: https://bugs.gentoo.org/716636 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Revert "EbuildBuildDir: cancel current tasks for CancelledError"Zac Medico2020-04-071-30/+16
| | | | | | | This reverts commit 899d5e61010a85702e7c83506d2214ede179c964. Bug: https://bugs.gentoo.org/716636 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Revert "Support PORTAGE_LOG_FILTER_FILE (bug 709746)"Zac Medico2020-04-077-213/+20
| | | | | | | This reverts commit 73f72f526a66b9953a46868cc1390fde2820997f. Bug: https://bugs.gentoo.org/716636 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Revert "_BinpkgFetcherProcess: fix async_lock event loop recursion (bug 711178)"Zac Medico2020-04-071-17/+15
| | | | | | | This reverts commit 1681309f252a4e91d7256b895a9af26ef82a9b30. Bug: https://bugs.gentoo.org/716636 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Revert "SpawnProcess: cancel _main_task in _unregister (bug 711174)"Zac Medico2020-04-071-2/+0
| | | | | | | This reverts commit 97587a47fcd00d070c081ad3933e4036cf0f8e81. Bug: https://bugs.gentoo.org/716636 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Revert "Rename PORTAGE_LOG_FILTER_FILE_CMD from PORTAGE_LOG_FILTER_FILE"Zac Medico2020-04-075-6/+6
| | | | | | | This reverts commit e24859eaa03ec86e10d842296f5570dd98bed4b7. Bug: https://bugs.gentoo.org/716636 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* process: Unshare UTS namespace, and set hostname to 'localhost'Michał Górny2020-03-281-1/+10
| | | | | | | | | | | | Use UTS namespace to override hostname when network-sandbox is enabled. Set it to 'localhost' as that has a better chance of being present in /etc/hosts. This fixes tests in some packages that try to connect to localhost via hostname obtained using gethostname(), e.g. docker-py, and suffer resolution problems due to the system hostname not being defined in /etc/hosts. Closes: https://github.com/gentoo/portage/pull/539 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* repoman: Update for a repoman-2.3.22 releaserepoman-2.3.22Zac Medico2020-03-252-1/+6
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman.modules.vcs.git.changes: reindex only for commit mode (bug 712106)Zac Medico2020-03-251-1/+6
| | | | | | | | | Automatically reindex for commit mode, but not for other modes were the user might not want changes to be staged in the index. Bug: https://bugs.gentoo.org/712106 Suggested-by: Jeroen Roovers <jer@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _lockfile_was_removed: always return tupleZac Medico2020-03-251-1/+1
| | | | | Fixes: 59e9452fda79 ("_lockfile_was_removed: return fstat result (bug 714480)") Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Updates for portage-2.3.96 releaseportage-2.3.96Zac Medico2020-03-252-1/+6
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lockfile: raise TryAgain if inode is already locked (bug 714480)Zac Medico2020-03-252-3/+25
| | | | | | | | | | Raise TryAgain if the current inode is already locked by the current process, since in this case the lock will not behave as intended with the default fcntl.lockf function. With the alternative fcntl.flock function, TryAgain is raised earlier. Bug: https://bugs.gentoo.org/714480 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _lockfile_iteration: index locked files by inode (bug 714480)Zac Medico2020-03-251-12/+23
| | | | | | | | | | Index each locked file by inode so that it's possible to detect when there's an attempt to lock the same inode twice, since in that case the lock will not behave as intended with the default fcntl.lockf function. Bug: https://bugs.gentoo.org/714480 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _lockfile_was_removed: return fstat result (bug 714480)Zac Medico2020-03-251-8/+8
| | | | | | | | | | Return a tuple that includes the fstat result, which can be used to detect when there's an attempt to lock the same inode more than once by the same process, since in that case the lock will not behave as intended with the default fcntl.lockf function. Bug: https://bugs.gentoo.org/714480 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman: fetch_metadata_xsd: use fetch functionZac Medico2020-03-231-41/+10
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Updates for portage-2.3.95 releaseportage-2.3.95Zac Medico2020-03-222-1/+8
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge --info: Filter variables for credentialsSam James (sam_c)2020-03-221-0/+4
| | | | | | | Bug: https://bugs.gentoo.org/713726 Closes: https://github.com/gentoo/portage/pull/536 Signed-off-by: Sam James (sam_c) <sam@cmpct.info> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _hide_url_passwd: replace all occurrences (bug 713726)Zac Medico2020-03-221-1/+1
| | | | | | | | | | Adjust the regular expression to avoid overly-greedy .+ groups, so that is will properly replace all occurrences, as necessary for the purposes of bug 713726 since PORTAGE_BINHOST may contain multiple values. Bug: https://bugs.gentoo.org/713726 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _post_phase_userpriv_perms: handle $HOME (bug 713100)Zac Medico2020-03-221-3/+4
| | | | | | | | | | | | Ensure that the userpriv UID has appropriate permission for files created in $HOME during privileged phases like pkg_setup, in the same way as for $T. This prevents potential permission issues for programs invoked during unprivileged phases, and it improves alignment with PMS which specifies identical behavior for both $HOME and $T. Bug: https://bugs.gentoo.org/713100 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* 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>