From c0d667ad6bb2d68890f33ded8b2e5bc182ab01fb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 4 Feb 2022 01:17:37 -0800 Subject: [PATCH] [python3][python2] Use MKDIR_P to create directories to avoid race conditions (#22902) * [python3][python2] Use mkdir -p to create directories to avoid race conditions * Revert "[vcpkg baseline][python3] Fix race during parallel install (#21734)" This reverts commit a515872b1abf58b639bf8b15ab5fe23b62f25ac3. # Conflicts: # ports/python3/vcpkg.json # versions/baseline.json # versions/p-/python3.json Co-authored-by: Billy Robert O'Neal III --- ports/python2/portfile.cmake | 2 ++ ports/python2/vcpkg.json | 5 +++-- ports/python3/0008-fix-parallel-install.patch | 15 --------------- ports/python3/portfile.cmake | 3 ++- ports/python3/vcpkg.json | 3 ++- versions/baseline.json | 4 ++-- versions/p-/python2.json | 5 +++++ versions/p-/python3.json | 5 +++++ 8 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 ports/python3/0008-fix-parallel-install.patch diff --git a/ports/python2/portfile.cmake b/ports/python2/portfile.cmake index fdbf8f415b..fa5fea78c7 100644 --- a/ports/python2/portfile.cmake +++ b/ports/python2/portfile.cmake @@ -50,6 +50,8 @@ vcpkg_extract_source_archive_ex( PATCHES ${_PYTHON_PATCHES} ) +vcpkg_replace_string("${SOURCE_PATH}/Makefile.pre.in" "$(INSTALL) -d -m $(DIRMODE)" "$(MKDIR_P)") + if (VCPKG_TARGET_IS_WINDOWS) if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(BUILD_ARCH "Win32") diff --git a/ports/python2/vcpkg.json b/ports/python2/vcpkg.json index 9780104ac1..f4f4b4e0c4 100644 --- a/ports/python2/vcpkg.json +++ b/ports/python2/vcpkg.json @@ -1,7 +1,8 @@ { "name": "python2", "version": "2.7.18", - "port-version": 1, + "port-version": 2, "description": "The Python programming language as an embeddable library", - "homepage": "https://www.python.org" + "homepage": "https://www.python.org", + "license": "Python-2.0" } diff --git a/ports/python3/0008-fix-parallel-install.patch b/ports/python3/0008-fix-parallel-install.patch deleted file mode 100644 index 26554644c4..0000000000 --- a/ports/python3/0008-fix-parallel-install.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 790d974..88fc444 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -2019,6 +2019,10 @@ Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h - .PHONY: build_all_generate_profile build_all_merge_profile - .PHONY: gdbhooks - -+# Serialize targets which may create /lib -+libinstall: altbininstall -+libainstall: altbininstall -+ - # IF YOU PUT ANYTHING HERE IT WILL GO AWAY - # Local Variables: - # mode: makefile diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index fccf619a50..c127f16f67 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -13,7 +13,6 @@ set(PATCHES 0003-devendor-external-dependencies.patch 0004-dont-copy-vcruntime.patch 0005-only-build-required-projects.patch - 0008-fix-parallel-install.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") list(PREPEND PATCHES 0001-static-library.patch) @@ -46,6 +45,8 @@ vcpkg_from_github( PATCHES ${PATCHES} ) +vcpkg_replace_string("${SOURCE_PATH}/Makefile.pre.in" "$(INSTALL) -d -m $(DIRMODE)" "$(MKDIR_P)") + if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) # Due to the way Python handles C extension modules on Windows, a static python core cannot # load extension modules. diff --git a/ports/python3/vcpkg.json b/ports/python3/vcpkg.json index aaa4b69fce..6fcddcbeaa 100644 --- a/ports/python3/vcpkg.json +++ b/ports/python3/vcpkg.json @@ -1,9 +1,10 @@ { "name": "python3", "version-semver": "3.10.1", - "port-version": 4, + "port-version": 5, "description": "The Python programming language", "homepage": "https://github.com/python/cpython", + "license": "Python-2.0", "supports": "!uwp", "dependencies": [ { diff --git a/versions/baseline.json b/versions/baseline.json index cee30ed55b..80b5e5667c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5534,11 +5534,11 @@ }, "python2": { "baseline": "2.7.18", - "port-version": 1 + "port-version": 2 }, "python3": { "baseline": "3.10.1", - "port-version": 4 + "port-version": 5 }, "qca": { "baseline": "2.3.4", diff --git a/versions/p-/python2.json b/versions/p-/python2.json index 95fa120883..0331d02ffa 100644 --- a/versions/p-/python2.json +++ b/versions/p-/python2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "fc1f7aaa8a2312a56ce7dc1324c2eaf608a7a331", + "version": "2.7.18", + "port-version": 2 + }, { "git-tree": "052ef22af59535134ca2944cfd8e7e7d3ea24d67", "version": "2.7.18", diff --git a/versions/p-/python3.json b/versions/p-/python3.json index 9b4fc18793..7799c51940 100644 --- a/versions/p-/python3.json +++ b/versions/p-/python3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c9b705608afc0485c03effb5aaa439f027b20af4", + "version-semver": "3.10.1", + "port-version": 5 + }, { "git-tree": "75172bc36c45d15ee298de1803625af1770cb805", "version-semver": "3.10.1",