aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* _validate_deps: Discard configdict["pkg"]["USE"]Zac Medico2024-03-031-0/+1
| | | | | | | | | | | | | Since configdict["pkg"]["USE"] may contain package.use settings from config.setcpv, it is inappropriate to use here (bug 675748), so discard it. This is only an issue because configdict["pkg"] is a sub-optimal place to extract metadata from. This issue does not necessarily indicate a flaw in the Package constructor, since passing in precalculated USE can be valid for things like autounmask USE changes. Bug: https://bugs.gentoo.org/675748 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* cnf: sets: Migrate @golang-rebuild to dev-lang/goZac Medico2024-02-261-1/+9
| | | | | Bug: https://bugs.gentoo.org/919751 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: Use egencache to create manifestsZac Medico2024-02-211-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the ResolverPlayground _create_ebuild_manifests method call egencache --jobs, which reliably triggers the KeyError from bug 924319 for multiple tests: lib/portage/tests/bin/test_doins.py::DoIns::testDoInsFallback Exception in callback EbuildMetadataPhase._async_start_done(<Task finishe...Error('EAPI')>) handle: <Handle EbuildMetadataPhase._async_start_done(<Task finishe...Error('EAPI')>)> Traceback (most recent call last): File "/usr/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "lib/_emerge/EbuildMetadataPhase.py", line 154, in _async_start_done future.cancelled() or future.result() ^^^^^^^^^^^^^^^ File "lib/_emerge/EbuildMetadataPhase.py", line 130, in _async_start retval = portage.doebuild( ^^^^^^^^^^^^^^^^^ File "lib/portage/package/ebuild/doebuild.py", line 1030, in doebuild doebuild_environment( File "lib/portage/package/ebuild/doebuild.py", line 519, in doebuild_environment eapi = mysettings.configdict["pkg"]["EAPI"] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ File "lib/portage/util/__init__.py", line 1684, in __getitem__ return UserDict.__getitem__(self, item_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "lib/portage/cache/mappings.py", line 175, in __getitem__ return self.data[key] ~~~~~~~~~^^^^^ KeyError: 'EAPI' Bug: https://bugs.gentoo.org/924319 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _calc_depclean: add dep_check actionZac Medico2024-01-081-6/+37
| | | | | | | | | | | | | | | | | | | | | Add a dep_check action which can be used to check the dependencies of all installed packages. The plan is for depgraph to use this action to check for broken dependencies prior to the merge order calculation. The new frozen_config parameter will allow depgraph to pass a shared frozen config to _calc_depclean. The result of the dep_check action becomes stale as soon as there is any change to the installed packages. So, in order to account for dependencies that may become broken or satisfied during the process of updating installed packages, the merge order calculation will need to refresh the dep_check calculation for every merge order choice that it makes. This refresh will need to be optimized to identify the portion of the graph that would become stale due to a given change, so that it can avoid unnecessary repetition of work. Bug: https://bugs.gentoo.org/921333 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: Create $EPREFIX/usr/bin/python symlinkZac Medico2023-12-181-2/+3
| | | | | | | | | This ensures that CrossDepPriorityTestCase uses the correct python implementation when it calls emerge, by overriding behavior of #!/usr/bin/env python shebangs. Fixes: 1d856747ada4 ("DepPriority{Normal,Satisfied}Range: weaken _ignore_runtime for cross root") Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Small pyupgrade fixesSam James2023-12-101-6/+6
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* Stop implicitly manipulating `NO_COLOR`/`NOCOLOR`Michał Górny2023-11-301-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop implicitly forcing `NO_COLOR` and `NOCOLOR` in ebuild environment. This is undesired for several reasons: 1. It makes it impossible to control color for emerge output independently of command output, e.g. when one goes to a pty while the other goes to logs. 2. It makes it impossible to get color output in logs when running `emerge --jobs ...`. 3. Forcing `NO_COLOR=1` turns out to cause random test failures, and while fixing them is commendable, it is a pain for arch testing and it is currently blocking stabilization requests. With the new approach, the color output in programs is consistent between using ``--jobs`` or ``--quiet-build``, and not. Therefore, both cases generate uniform logs. In order to obtain logs free of color codes, one can either filter them via `ansifilter(1)` (as the manpages already recommend) or explicitly set `NO_COLOR`. Furthermore, one can combine color-free build output (for clean logs) with colorful emerge output by using: NO_COLOR=true emerge --color y ... Bug: https://bugs.gentoo.org/918515 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1188 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* portage: tests: fix typosSam James2023-11-111-1/+1
| | | | | | Thanks to codespell. Signed-off-by: Sam James <sam@gentoo.org>
* Support Python UTF-8 Mode via portage.utf8_mode (bug 914722)Zac Medico2023-10-111-2/+2
| | | | | | | | | | | | | | | | | | | | When a UTF-8 locale, or UTF-8 mode is detected, set portage.utf8_mode to True, and do not wrap file access with _unicode_func_wrapper. This is intended to mitgate issues with byte string handling in python libraries like shutil, as reported in bug 914722. This patch is intended to be a simple and minimal implementation that can be optimized later through the elimination of unecessary encoding/decoding. The str() wrapping in the unit tests is for lazily evaluated instances of lazy_value, which is used to account for mock portage.const.EPREFIX values that exist during unit tests. Bug: https://bugs.gentoo.org/914722 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: produce pkgdir indexesJohn Helmert III2023-09-191-0/+4
| | | | | | | | Tests expect the index to be generated anyway, so let's not rely on implicit FEATURES=-pkgdir-index-trusted. Signed-off-by: John Helmert III <ajak@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* emerge: respect NO_COLORSiddhanth Rathod2023-03-211-2/+2
| | | | | | | Bug: https://bugs.gentoo.org/898224 Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com> Closes: https://github.com/gentoo/portage/pull/1003 Signed-off-by: Sam James <sam@gentoo.org>
* */*: rerun black w/ 23.1.0Sam James2023-02-031-5/+0
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* */*: run pyupgrade --py37-plus againSam James2023-01-101-1/+1
| | | | | | After running flynt, it finds a few more bits. Signed-off-by: Sam James <sam@gentoo.org>
* */*: run Black post-flyntSam James2023-01-101-6/+4
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* */*: convert to f-strings (run flynt)Sam James2023-01-101-24/+24
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* ResolverPlayground: include PATH in env passed to portage.create_trees()Mike Gilbert2023-01-021-1/+2
| | | | | | Fixes failing tests after previous change to _doebuild_path. Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* pyupgrade everythingJohn Helmert III2022-12-031-13/+15
| | | | | Signed-off-by: John Helmert III <ajak@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* ResolverPlayground: unconditionally setup essential_binariesZac Medico2022-07-251-4/+5
| | | | | Closes: https://bugs.gentoo.org/861077 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: add "bash" to essential_binariesMike Gilbert2022-07-251-0/+1
| | | | Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* repoman: RemoveMatt Turner2022-05-021-10/+0
| | | | | | | | RepoMan sez: So long and thanks for all the fish! I'll be enjoying my retirement now. Haven't I done enough to deserve that? Bug: https://bugs.gentoo.org/835013 Signed-off-by: Matt Turner <mattst88@gentoo.org>
* Eliminate USE aliasesMatt Turner2022-04-021-2/+0
| | | | | | | These were part of the 4-python and 5-progress EAPIs and were a branch of the code deep enough to warrant its removal in its own patch. Signed-off-by: Matt Turner <mattst88@gentoo.org>
* Eliminate now-dead code from EAPIs 4-python and 5-progressMatt Turner2022-04-011-1/+0
| | | | Signed-off-by: Matt Turner <mattst88@gentoo.org>
* Ignore all XPAK when "binpkg-request-signature" enabled.Sheng Yu2022-02-091-2/+5
| | | | | | | | | XPAK format does not support signature and should be avoided when mandatory signature is expected. Signed-off-by: Sheng Yu <syu.os@protonmail.com> Closes: https://github.com/gentoo/portage/pull/785 Signed-off-by: Sam James <sam@gentoo.org>
* */*: GPKG (new binpkg format) Support (GLEP 78, provisionally)Rin Cat (鈴猫)2022-01-241-7/+48
| | | | | | | | | | | Bug: https://bugs.gentoo.org/500630 Bug: https://bugs.gentoo.org/659864 Bug: https://bugs.gentoo.org/672672 Bug: https://bugs.gentoo.org/773259 Bug: https://bugs.gentoo.org/820578 Signed-off-by: Rin Cat (鈴猫) <dev@rincat.ch> Closes: https://github.com/gentoo/portage/pull/562 Signed-off-by: Sam James <sam@gentoo.org>
* Reformat to use spaces instead of tabs. Also, use blackWolfgang E. Sanyer2021-09-191-913/+1034
| | | | | | | | | | | The following command was used to reformat: autopep8 --in-place --select=E101,E11,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E20,E211,E22,E224,E224,E226,E227,E228,E231,E241,E242,E251,E252,E26,E265,E266,E27,E301,E302,E303,E304,E305,E306,W291,W293,W391 -r . black was run as `black .`, using the default configurations Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* tests: lazily evaluate cnf_* vars (bug 783957)Zac Medico2021-04-181-1/+38
| | | | | | | | | | Lazily evaluate cnf_* variables, allowing for mock portage.const settings created by ResolverPlayground. In ResolverPlayground, create symlinks for PORTAGE_BIN_PATH scripts inside the mock EPREFIX, and restore portage.const.EPREFIX in the cleanup method. Bug: https://bugs.gentoo.org/783957 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: enable package.use.{force,mask}Zac Medico2021-03-271-2/+8
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/*: fix superfluous-parens and enable checkAaron Bauman2020-08-051-1/+1
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/portage/tests/resolver/ResolverPlayground.py: drop unused-importAaron Bauman2020-08-031-3/+3
| | | | | | | | * Drop unused-import * Slight refactor on imports Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Fix 'unused-import' for stdlib imports.Alec Warner2020-07-221-1/+0
| | | | | | | | | | | This is part of a cleanup to enable pylint. This is only stdlib modules; there are hundreds of unused imports of other modules but its less clear how safe those are to remove due to side effects. Signed-off-by: Alec Warner <antarus@gentoo.org> Change-Id: If9bee83bbbe1620b34a0f8d153637909af2b8512 Closes: https://github.com/gentoo/portage/pull/585 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Fix pylint R0205.Alec Warner2020-07-221-4/+4
| | | | | | | | In python3 inheriting from object is no longer required. Signed-off-by: Alec Warner <antarus@gentoo.org> Change-Id: Id489d4103d975a751be148205694cb6a20d33b31 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Eliminate basestring/long/_unicode py3 compatMichał Górny2020-07-161-6/+3
| | | | | | | | Replace basestring and _unicode hacks with str, and long with int. Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/570 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* ecompress: optimize docompress -x precompressed comparisonZac Medico2020-07-021-0/+1
| | | | | | | | | | | Use sort and comm with temporary files in order to compare lists of docompress -x and precompressed files, since the file lists can be extremely large. Also strip ${D%/} from paths in order to reduce length. Bug: https://bugs.gentoo.org/721516 Suggested-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Default BINPKG_COMPRESSION to zstd (bug 715108)Zac Medico2020-05-241-0/+1
| | | | | | | | | | | This includes a _compat_upgrade.binpkg_compression script that the ebuild can call in pkg_preinst in order to maintain a backward-compatible bzip2 default when appropriate, ensuring that binary package consumers are not caught off guard. Bug: https://bugs.gentoo.org/715108 Reviewed-by: Brian Dolbec <dolsen@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* AuxdbTestCase: test eclass inheritanceZac Medico2020-05-021-4/+12
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* depclean: ensure consistency with update actions (bug 649622)Zac Medico2020-02-141-29/+48
| | | | | | | | | | | | | | Make depclean traverse dependencies in the same order as update actions, in order to ensure consistency in decisions which are dependent on the order of dependency evaluation due to inconsistent use of || preferences in different packages. In unit tests, update test_virtual_w3m_realistic to assert that the order of graph traversal is deterministic and consistent between update and removal (depclean) actions. Bug: https://bugs.gentoo.org/649622 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: set PORTAGE_DEBUG=1 for debug modeZac Medico2020-02-091-0/+3
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Test /etc/portage/modules portdbapi.auxdbmodule settingsZac Medico2020-01-211-1/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* helper-functions.sh: __multijob_init: handle errorsZac Medico2019-11-171-0/+1
| | | | | | | Also add mkfifo to ResolverPlayground essential_binaries, since it's required by __multijob_init. Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: create installed ebuild + environment.bz2Zac Medico2019-11-161-0/+12
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Update /usr/portage references (bug 378603)Zac Medico2019-04-181-2/+2
| | | | | | | | | | Update all relevant references in docs, messages, and comments to refer to /var/db/repos/gentoo instead of /usr/portage. Also update DISTDIR and PKGDIR references to refer to the new /var/cache/{distfiles,binpkgs} locations. Bug: https://bugs.gentoo.org/378603 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: add chgrp to essential_binariesZac Medico2019-01-201-0/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* misc-functions.sh: restore canonicalize func (bug 675284)Zac Medico2019-01-131-0/+1
| | | | | | | | The canonicalize function is required by install-qa-check.d/05prefix. Fixes: aa0a94198794 ("ecompress: Replace with implementation from portage[mgorny]") Bug: https://bugs.gentoo.org/670484 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ResolverPlayground: exclude internal wrappers from essential_binaries PATHZac Medico2018-12-291-2/+15
| | | | | | | | | | Ensure that essential_binaries symlinks do not refer to internal wrapper scripts, in order to avoid infinite recursion. Use the same ebuild-helpers pattern as the portageq wrapper script since daeb75b345c4433218ab9e7a5319e8914092f048. Fixes: 1b5edbb5ec70 ("_doebuild_path: do not use host PATH by default and prepend EPREFIX PATH") Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _doebuild_path: do not use host PATH by default and prepend EPREFIX PATH.Benda Xu2018-12-131-0/+34
| | | | | | | | | | | EPREFIX could be overridden in cross-eprefix, in that case tools inside EPREFIX should be prioritized. Link necessary binary tools to the test environment. Bug: https://bugs.gentoo.org/585986 Closes: https://github.com/gentoo/portage/pull/387 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Rename pym→lib, for better distutils-r1 interoperabilityMichał Górny2018-07-181-0/+842
Closes: https://github.com/gentoo/portage/pull/343