Skip to content

Commit

Permalink
[python3][python2] Use MKDIR_P to create directories to avoid race co…
Browse files Browse the repository at this point in the history
…nditions (#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 a515872.

# Conflicts:
#	ports/python3/vcpkg.json
#	versions/baseline.json
#	versions/p-/python3.json

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
  • Loading branch information
ras0219-msft and BillyONeal authored Feb 4, 2022
1 parent bce1415 commit c0d667a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 2 additions & 0 deletions ports/python2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 3 additions & 2 deletions ports/python2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
}
15 changes: 0 additions & 15 deletions ports/python3/0008-fix-parallel-install.patch

This file was deleted.

3 changes: 2 additions & 1 deletion ports/python3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion ports/python3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/python2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "fc1f7aaa8a2312a56ce7dc1324c2eaf608a7a331",
"version": "2.7.18",
"port-version": 2
},
{
"git-tree": "052ef22af59535134ca2944cfd8e7e7d3ea24d67",
"version": "2.7.18",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/python3.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c9b705608afc0485c03effb5aaa439f027b20af4",
"version-semver": "3.10.1",
"port-version": 5
},
{
"git-tree": "75172bc36c45d15ee298de1803625af1770cb805",
"version-semver": "3.10.1",
Expand Down

0 comments on commit c0d667a

Please sign in to comment.