diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-09-01 09:21:25 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-02 15:58:25 +0100 |
commit | 84146661b58e35ea80eb0bf8d8e149e3e74d2ebd (patch) | |
tree | 7e5a46f8aec5a337e0208182c667b7509f062b84 /meta/recipes-devtools/python/python3-pip | |
parent | 598f3dfd4967d735b3056c8077a7942c4ba72984 (diff) | |
download | poky-84146661b58e35ea80eb0bf8d8e149e3e74d2ebd.tar.gz |
python3-pip: remove unneeded reproducible.patch
Since "python_pep517: use installer instead of pip" pip is no longer
used in builds, and therefore doesn't need to behave reproducibly.
I have submitted the patch upstream; upstream have suggested that the
way it had been used previously is non-reproducible by design, and
if pip is again brought into builds in the future, we should use
specific options for reproducibility:
https://github.com/pypa/pip/issues/11424
(From OE-Core rev: 654f9d5088d00ee27b4d2f7b3bb371195de52247)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3-pip')
-rw-r--r-- | meta/recipes-devtools/python/python3-pip/reproducible.patch | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/meta/recipes-devtools/python/python3-pip/reproducible.patch b/meta/recipes-devtools/python/python3-pip/reproducible.patch deleted file mode 100644 index 4742a8352b..0000000000 --- a/meta/recipes-devtools/python/python3-pip/reproducible.patch +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | Pip installed wheels are not reproducible currently. The direct_url | ||
2 | files encode an installation path and the installed wheels compile | ||
3 | the python files at their location, not their final install location | ||
4 | which is incorrect. | ||
5 | |||
6 | To fix this, simply disable the direct_urls and pass the "root" to | ||
7 | the python compile function to strip that path out of the compiled | ||
8 | files. | ||
9 | |||
10 | A version of this patch, perhaps stripping root from the direct_urls | ||
11 | may be something that could be considered by upstream. | ||
12 | |||
13 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
14 | |||
15 | Upstream-Status: Submitted [https://github.com/pypa/pip/issues/11424] | ||
16 | |||
17 | Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> | ||
18 | --- | ||
19 | src/pip/_internal/operations/install/wheel.py | 5 ++++- | ||
20 | src/pip/_internal/req/req_install.py | 5 ++++- | ||
21 | 2 files changed, 8 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/src/pip/_internal/operations/install/wheel.py b/src/pip/_internal/operations/install/wheel.py | ||
24 | index 1af8978..3e48f9b 100644 | ||
25 | --- a/src/pip/_internal/operations/install/wheel.py | ||
26 | +++ b/src/pip/_internal/operations/install/wheel.py | ||
27 | @@ -434,6 +434,7 @@ def _install_wheel( | ||
28 | warn_script_location: bool = True, | ||
29 | direct_url: Optional[DirectUrl] = None, | ||
30 | requested: bool = False, | ||
31 | + root: str = None, | ||
32 | ) -> None: | ||
33 | """Install a wheel. | ||
34 | |||
35 | @@ -610,7 +611,7 @@ def _install_wheel( | ||
36 | with warnings.catch_warnings(): | ||
37 | warnings.filterwarnings("ignore") | ||
38 | for path in pyc_source_file_paths(): | ||
39 | - success = compileall.compile_file(path, force=True, quiet=True) | ||
40 | + success = compileall.compile_file(path, force=True, quiet=True, stripdir=root) | ||
41 | if success: | ||
42 | pyc_path = pyc_output_path(path) | ||
43 | assert os.path.exists(pyc_path) | ||
44 | @@ -721,6 +722,7 @@ def install_wheel( | ||
45 | warn_script_location: bool = True, | ||
46 | direct_url: Optional[DirectUrl] = None, | ||
47 | requested: bool = False, | ||
48 | + root: str = None, | ||
49 | ) -> None: | ||
50 | with ZipFile(wheel_path, allowZip64=True) as z: | ||
51 | with req_error_context(req_description): | ||
52 | @@ -733,4 +735,5 @@ def install_wheel( | ||
53 | warn_script_location=warn_script_location, | ||
54 | direct_url=direct_url, | ||
55 | requested=requested, | ||
56 | + root=root, | ||
57 | ) | ||
58 | diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py | ||
59 | index a1e376c..4c3f1bb 100644 | ||
60 | --- a/src/pip/_internal/req/req_install.py | ||
61 | +++ b/src/pip/_internal/req/req_install.py | ||
62 | @@ -779,7 +779,9 @@ class InstallRequirement: | ||
63 | assert self.local_file_path | ||
64 | direct_url = None | ||
65 | # TODO this can be refactored to direct_url = self.download_info | ||
66 | - if self.editable: | ||
67 | + if '_PYTHON_SYSCONFIGDATA_NAME' in os.environ: | ||
68 | + direct_url = None | ||
69 | + elif self.editable: | ||
70 | direct_url = direct_url_for_editable(self.unpacked_source_directory) | ||
71 | elif self.original_link: | ||
72 | direct_url = direct_url_from_link( | ||
73 | @@ -796,6 +798,7 @@ class InstallRequirement: | ||
74 | warn_script_location=warn_script_location, | ||
75 | direct_url=direct_url, | ||
76 | requested=self.user_supplied, | ||
77 | + root=root, | ||
78 | ) | ||
79 | self.install_succeeded = True | ||
80 | return | ||
81 | -- | ||
82 | 2.25.1 | ||
83 | |||