relenv 0.20.4__tar.gz → 0.20.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {relenv-0.20.4/relenv.egg-info → relenv-0.20.6}/PKG-INFO +1 -1
- relenv-0.20.6/relenv/_scripts/install_vc_build.ps1 +200 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/build/__init__.py +2 -2
- {relenv-0.20.4 → relenv-0.20.6}/relenv/build/common.py +1 -1
- {relenv-0.20.4 → relenv-0.20.6}/relenv/build/darwin.py +2 -2
- {relenv-0.20.4 → relenv-0.20.6}/relenv/build/linux.py +12 -12
- {relenv-0.20.4 → relenv-0.20.6}/relenv/build/windows.py +45 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/common.py +3 -1
- {relenv-0.20.4 → relenv-0.20.6}/relenv/fetch.py +2 -1
- {relenv-0.20.4 → relenv-0.20.6}/relenv/runtime.py +3 -7
- {relenv-0.20.4 → relenv-0.20.6/relenv.egg-info}/PKG-INFO +1 -1
- relenv-0.20.4/relenv/_scripts/install_vc_build.ps1 +0 -150
- {relenv-0.20.4 → relenv-0.20.6}/LICENSE.md +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/MANIFEST.in +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/NOTICE +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/README.md +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/pyproject.toml +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/__init__.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/__main__.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/buildenv.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/check.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/create.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/manifest.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/pyversions.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/relocate.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv/toolchain.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv.egg-info/SOURCES.txt +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv.egg-info/dependency_links.txt +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv.egg-info/entry_points.txt +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv.egg-info/requires.txt +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/relenv.egg-info/top_level.txt +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/setup.cfg +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/setup.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/__init__.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/conftest.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_build.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_common.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_create.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_downloads.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_fips_photon.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_relocate.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_runtime.py +0 -0
- {relenv-0.20.4 → relenv-0.20.6}/tests/test_verify_build.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: relenv
|
|
3
|
-
Version: 0.20.
|
|
3
|
+
Version: 0.20.6
|
|
4
4
|
Project-URL: Source Code, https://github.com/saltstack/relative-environment-for-python
|
|
5
5
|
Project-URL: Documentation, https://relenv.readthedocs.io/en/latest/
|
|
6
6
|
Project-URL: Changelog, https://relenv.readthedocs.io/en/latest/changelog.html
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Script that installs Visual Studio Build Tools
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
This script installs the Visual Studio Build Tools if they are not already
|
|
7
|
+
present on the system. Visual Studio Build Tools are the binaries and libraries
|
|
8
|
+
needed to build Python from source.
|
|
9
|
+
|
|
10
|
+
.EXAMPLE
|
|
11
|
+
install_vc_buildtools.ps1
|
|
12
|
+
|
|
13
|
+
#>
|
|
14
|
+
param(
|
|
15
|
+
[Parameter(Mandatory=$false)]
|
|
16
|
+
[Alias("c")]
|
|
17
|
+
# Don't prettify the output of the Write-Result
|
|
18
|
+
[Switch] $CICD
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
#-------------------------------------------------------------------------------
|
|
22
|
+
# Script Preferences
|
|
23
|
+
#-------------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
|
|
26
|
+
$ProgressPreference = "SilentlyContinue"
|
|
27
|
+
$ErrorActionPreference = "Stop"
|
|
28
|
+
# https://stackoverflow.com/a/67201331/4581998
|
|
29
|
+
$env:PSModulePath = [Environment]::GetEnvironmentVariable('PSModulePath', 'Machine')
|
|
30
|
+
|
|
31
|
+
#-------------------------------------------------------------------------------
|
|
32
|
+
# Script Functions
|
|
33
|
+
#-------------------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
function Write-Result($result, $ForegroundColor="Green") {
|
|
36
|
+
if ( $CICD ) {
|
|
37
|
+
Write-Host $result -ForegroundColor $ForegroundColor
|
|
38
|
+
} else {
|
|
39
|
+
$position = 80 - $result.Length - [System.Console]::CursorLeft
|
|
40
|
+
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function Add-Certificate {
|
|
45
|
+
[CmdletBinding()]
|
|
46
|
+
param(
|
|
47
|
+
|
|
48
|
+
[Parameter(Mandatory=$true)]
|
|
49
|
+
# The path in the certstore (CERT:/LocalMachine/Root/<hash>)
|
|
50
|
+
[String] $Path,
|
|
51
|
+
|
|
52
|
+
[Parameter(Mandatory=$true)]
|
|
53
|
+
# The path to the cert file for importing
|
|
54
|
+
[String] $File,
|
|
55
|
+
|
|
56
|
+
[Parameter(Mandatory=$true)]
|
|
57
|
+
# The name of the cert file for importing
|
|
58
|
+
[String] $Name
|
|
59
|
+
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# Validation
|
|
63
|
+
if ( ! (Test-Path -Path $File)) {
|
|
64
|
+
Write-Host "Invalid path to certificate file"
|
|
65
|
+
exit 1
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (! (Test-Path -Path $Path) ) {
|
|
69
|
+
|
|
70
|
+
Write-Host "Installing Certificate $Name`: " -NoNewLine
|
|
71
|
+
$output = Import-Certificate -FilePath $File -CertStoreLocation "Cert:\LocalMachine\Root"
|
|
72
|
+
if ( Test-Path -Path $Path ) {
|
|
73
|
+
Write-Result "Success"
|
|
74
|
+
} else {
|
|
75
|
+
Write-Result "Failed" -ForegroundColor Yellow
|
|
76
|
+
Write-Host $output
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#-------------------------------------------------------------------------------
|
|
82
|
+
# Start the Script
|
|
83
|
+
#-------------------------------------------------------------------------------
|
|
84
|
+
|
|
85
|
+
Write-Host $("=" * 80)
|
|
86
|
+
Write-Host "Install Visual Studio Build Tools" -ForegroundColor Cyan
|
|
87
|
+
Write-Host $("-" * 80)
|
|
88
|
+
|
|
89
|
+
#-------------------------------------------------------------------------------
|
|
90
|
+
# Script Variables
|
|
91
|
+
#-------------------------------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
# Dependency Variables
|
|
94
|
+
$VS_BLD_TOOLS = "https://aka.ms/vs/15/release/vs_buildtools.exe"
|
|
95
|
+
try {
|
|
96
|
+
# If VS is installed, you will be able to get the WMI Object MSFT_VSInstance
|
|
97
|
+
$VS_INST_LOC = $(Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs).InstallLocation
|
|
98
|
+
$MSBUILD_BIN = $(Get-ChildItem "$VS_INST_LOC\MSBuild\*\Bin\msbuild.exe").FullName
|
|
99
|
+
} catch {
|
|
100
|
+
# If VS is not installed, this is the fallback for this installation
|
|
101
|
+
$MSBUILD_BIN = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe"
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#-------------------------------------------------------------------------------
|
|
105
|
+
# Visual Studio
|
|
106
|
+
#-------------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
Write-Host "Confirming Presence of Visual Studio Build Tools: " -NoNewline
|
|
109
|
+
# We're only gonna look for msbuild.exe
|
|
110
|
+
if ( Test-Path -Path $MSBUILD_BIN ) {
|
|
111
|
+
Write-Result "Success" -ForegroundColor Green
|
|
112
|
+
} else {
|
|
113
|
+
Write-Result "Missing" -ForegroundColor Yellow
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
# If VS is installed, you will be able to get the WMI Object MSFT_VSInstance
|
|
117
|
+
Write-Host "Get VS Instance Information"
|
|
118
|
+
Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs
|
|
119
|
+
} catch {}
|
|
120
|
+
|
|
121
|
+
Write-Host "Checking available disk space: " -NoNewLine
|
|
122
|
+
$available = (Get-PSDrive $env:SystemDrive.Trim(":")).Free
|
|
123
|
+
if ( $available -gt (1024 * 1024 * 1024 * 9.1) ) {
|
|
124
|
+
Write-Result "Success" -ForegroundColor Green
|
|
125
|
+
} else {
|
|
126
|
+
Write-Result "Failed" -ForegroundColor Red
|
|
127
|
+
Write-Host "Not enough disk space"
|
|
128
|
+
exit 1
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
Write-Host "Downloading Visual Studio 2017 build tools: " -NoNewline
|
|
132
|
+
Invoke-WebRequest -Uri "$VS_BLD_TOOLS" -OutFile "$env:TEMP\vs_buildtools.exe"
|
|
133
|
+
if ( Test-Path -Path "$env:TEMP\vs_buildtools.exe" ) {
|
|
134
|
+
Write-Result "Success" -ForegroundColor Green
|
|
135
|
+
} else {
|
|
136
|
+
Write-Result "Failed" -ForegroundColor Red
|
|
137
|
+
exit 1
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
Write-Host "Creating Layout for Visual Studio 2017 build tools: " -NoNewline
|
|
141
|
+
if ( ! (Test-Path -Path "$($env:TEMP)\build_tools") ) {
|
|
142
|
+
New-Item -Path "$($env:TEMP)\build_tools" -ItemType Directory | Out-Null
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
Start-Process -FilePath "$env:TEMP\vs_buildtools.exe" `
|
|
146
|
+
-ArgumentList "--layout `"$env:TEMP\build_tools`"", `
|
|
147
|
+
"--add Microsoft.VisualStudio.Workload.MSBuildTools", `
|
|
148
|
+
"--add Microsoft.VisualStudio.Workload.VCTools", `
|
|
149
|
+
"--add Microsoft.VisualStudio.Component.Windows81SDK", `
|
|
150
|
+
"--add Microsoft.VisualStudio.Component.VC.140", `
|
|
151
|
+
"--lang en-US", `
|
|
152
|
+
"--includeRecommended", `
|
|
153
|
+
# "--quiet", `
|
|
154
|
+
"--wait" `
|
|
155
|
+
-Wait -WindowStyle Hidden
|
|
156
|
+
if ( Test-Path -Path "$env:TEMP\build_tools\vs_buildtools.exe" ) {
|
|
157
|
+
Write-Result "Success" -ForegroundColor Green
|
|
158
|
+
} else {
|
|
159
|
+
Write-Result "Failed" -ForegroundColor Red
|
|
160
|
+
exit 1
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
# Serial: 28cc3a25bfba44ac449a9b586b4339aa
|
|
164
|
+
# Hash: 3b1efd3a66ea28b16697394703a72ca340a05bd5
|
|
165
|
+
$cert_name = "Sign Root Certificate"
|
|
166
|
+
$cert_path = "Cert:\LocalMachine\Root\3b1efd3a66ea28b16697394703a72ca340a05bd5"
|
|
167
|
+
$cert_file = "$env:TEMP\build_tools\certificates\manifestCounterSignRootCertificate.cer"
|
|
168
|
+
Add-Certificate -Name $cert_name -Path $cert_path -File $cert_file
|
|
169
|
+
|
|
170
|
+
# Serial: 3f8bc8b5fc9fb29643b569d66c42e144
|
|
171
|
+
# Hash: 8f43288ad272f3103b6fb1428485ea3014c0bcfe
|
|
172
|
+
$cert_name = "Root Certificate"
|
|
173
|
+
$cert_path = "Cert:\LocalMachine\Root\8f43288ad272f3103b6fb1428485ea3014c0bcfe"
|
|
174
|
+
$cert_file = "$env:TEMP\build_tools\certificates\manifestRootCertificate.cer"
|
|
175
|
+
Add-Certificate -Name $cert_name -Path $cert_path -File $cert_file
|
|
176
|
+
|
|
177
|
+
Write-Host "Installing Visual Studio 2017 build tools: " -NoNewline
|
|
178
|
+
$proc = Start-Process `
|
|
179
|
+
-FilePath "$env:TEMP\build_tools\vs_setup.exe" `
|
|
180
|
+
-ArgumentList "--wait", "--noweb", "--quiet" `
|
|
181
|
+
-PassThru -Wait `
|
|
182
|
+
-RedirectStandardOutput "$env:TEMP\stdout.txt"
|
|
183
|
+
if ( Test-Path -Path $MSBUILD_BIN ) {
|
|
184
|
+
Write-Result "Failed" -ForegroundColor Red
|
|
185
|
+
Write-Host "Missing: $_"
|
|
186
|
+
Write-Host "ExitCode: $($proc.ExitCode)"
|
|
187
|
+
Write-Host "STDOUT:"
|
|
188
|
+
Get-Content "$env:TEMP\stdout.txt"
|
|
189
|
+
exit 1
|
|
190
|
+
}
|
|
191
|
+
Write-Result "Success" -ForegroundColor Green
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
#-------------------------------------------------------------------------------
|
|
195
|
+
# Finished
|
|
196
|
+
#-------------------------------------------------------------------------------
|
|
197
|
+
|
|
198
|
+
Write-Host $("-" * 80)
|
|
199
|
+
Write-Host "Install Visual Studio Build Tools Completed" -ForegroundColor Cyan
|
|
200
|
+
Write-Host $("=" * 80)
|
|
@@ -13,7 +13,7 @@ from .common import builds, CHECK_VERSIONS_SUPPORT
|
|
|
13
13
|
|
|
14
14
|
from ..pyversions import python_versions, Version
|
|
15
15
|
|
|
16
|
-
from ..common import build_arch
|
|
16
|
+
from ..common import build_arch, DEFAULT_PYTHON
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def platform_module():
|
|
@@ -58,7 +58,7 @@ def setup_parser(subparsers):
|
|
|
58
58
|
)
|
|
59
59
|
build_subparser.add_argument(
|
|
60
60
|
"--python",
|
|
61
|
-
default=
|
|
61
|
+
default=DEFAULT_PYTHON,
|
|
62
62
|
type=str,
|
|
63
63
|
help="The python version [default: %(default)s]",
|
|
64
64
|
)
|
|
@@ -99,8 +99,8 @@ build.add(
|
|
|
99
99
|
download={
|
|
100
100
|
"url": "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz",
|
|
101
101
|
"fallback_url": "https://woz.io/relenv/dependencies/sqlite-autoconf-{version}.tar.gz",
|
|
102
|
-
"version": "
|
|
103
|
-
"checksum": "
|
|
102
|
+
"version": "3500400",
|
|
103
|
+
"checksum": "145048005c777796dd8494aa1cfed304e8c34283",
|
|
104
104
|
},
|
|
105
105
|
)
|
|
106
106
|
|
|
@@ -466,8 +466,8 @@ build.add(
|
|
|
466
466
|
wait_on=["openssl"],
|
|
467
467
|
download={
|
|
468
468
|
"url": "https://www.openssl.org/source/openssl-{version}.tar.gz",
|
|
469
|
-
"version": "3.
|
|
470
|
-
"checksum": "
|
|
469
|
+
"version": "3.1.2",
|
|
470
|
+
"checksum": "206036c21264e53f0196f715d81d905742e6245b",
|
|
471
471
|
"checkfunc": tarball_version,
|
|
472
472
|
"checkurl": "https://www.openssl.org/source/",
|
|
473
473
|
},
|
|
@@ -500,8 +500,8 @@ build.add(
|
|
|
500
500
|
build_func=build_sqlite,
|
|
501
501
|
download={
|
|
502
502
|
"url": "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz",
|
|
503
|
-
"version": "
|
|
504
|
-
"checksum": "
|
|
503
|
+
"version": "3500400",
|
|
504
|
+
"checksum": "145048005c777796dd8494aa1cfed304e8c34283",
|
|
505
505
|
"checkfunc": sqlite_version,
|
|
506
506
|
"checkurl": "https://sqlite.org/",
|
|
507
507
|
},
|
|
@@ -523,8 +523,8 @@ build.add(
|
|
|
523
523
|
build_func=build_gdbm,
|
|
524
524
|
download={
|
|
525
525
|
"url": "https://ftp.gnu.org/gnu/gdbm/gdbm-{version}.tar.gz",
|
|
526
|
-
"version": "1.
|
|
527
|
-
"checksum": "
|
|
526
|
+
"version": "1.26",
|
|
527
|
+
"checksum": "6cee3657de948e691e8df26509157be950cef4d4",
|
|
528
528
|
"checkfunc": tarball_version,
|
|
529
529
|
},
|
|
530
530
|
)
|
|
@@ -548,8 +548,8 @@ build.add(
|
|
|
548
548
|
build_libffi,
|
|
549
549
|
download={
|
|
550
550
|
"url": "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz",
|
|
551
|
-
"version": "3.5.
|
|
552
|
-
"checksum": "
|
|
551
|
+
"version": "3.5.2",
|
|
552
|
+
"checksum": "2bd35b135b0eeb5c631e02422c9dbe786ddb626a",
|
|
553
553
|
"checkfunc": github_version,
|
|
554
554
|
"checkurl": "https://github.com/libffi/libffi/releases/",
|
|
555
555
|
},
|
|
@@ -582,8 +582,8 @@ build.add(
|
|
|
582
582
|
wait_on=["openssl"],
|
|
583
583
|
download={
|
|
584
584
|
"url": "https://kerberos.org/dist/krb5/{version}/krb5-{version}.tar.gz",
|
|
585
|
-
"version": "1.
|
|
586
|
-
"checksum": "
|
|
585
|
+
"version": "1.22",
|
|
586
|
+
"checksum": "3ad930ab036a8dc3678356fbb9de9246567e7984",
|
|
587
587
|
"checkfunc": krb_version,
|
|
588
588
|
"checkurl": "https://kerberos.org/dist/krb5/",
|
|
589
589
|
},
|
|
@@ -595,8 +595,8 @@ build.add(
|
|
|
595
595
|
wait_on=["ncurses"],
|
|
596
596
|
download={
|
|
597
597
|
"url": "https://ftp.gnu.org/gnu/readline/readline-{version}.tar.gz",
|
|
598
|
-
"version": "8.
|
|
599
|
-
"checksum": "
|
|
598
|
+
"version": "8.3",
|
|
599
|
+
"checksum": "2c05ae9350b695f69d70b47f17f092611de2081f",
|
|
600
600
|
"checkfunc": tarball_version,
|
|
601
601
|
},
|
|
602
602
|
)
|
|
@@ -36,6 +36,44 @@ def populate_env(env, dirs):
|
|
|
36
36
|
env["MSBUILDDISABLENODEREUSE"] = "1"
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
def patch_file(path, old, new):
|
|
40
|
+
"""
|
|
41
|
+
Search a file line by line for a string to replace.
|
|
42
|
+
|
|
43
|
+
:param path: Location of the file to search
|
|
44
|
+
:type path: str
|
|
45
|
+
:param old: The value that will be replaced
|
|
46
|
+
:type path: str
|
|
47
|
+
:param new: The value that will replace the 'old' value.
|
|
48
|
+
:type path: str
|
|
49
|
+
"""
|
|
50
|
+
import re
|
|
51
|
+
|
|
52
|
+
with open(path, "r") as fp:
|
|
53
|
+
content = fp.read()
|
|
54
|
+
new_content = ""
|
|
55
|
+
for line in content.splitlines():
|
|
56
|
+
re.sub(old, new, line)
|
|
57
|
+
new_content += line + os.linesep
|
|
58
|
+
with open(path, "w") as fp:
|
|
59
|
+
fp.write(new_content)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def override_dependency(source, old, new):
|
|
63
|
+
"""
|
|
64
|
+
Overwrite a dependency string for Windoes PCBuild.
|
|
65
|
+
|
|
66
|
+
:param source: Python's source directory
|
|
67
|
+
:type path: str
|
|
68
|
+
:param old: Regular expression to search for
|
|
69
|
+
:type path: str
|
|
70
|
+
:param new: Replacement text
|
|
71
|
+
:type path: str
|
|
72
|
+
"""
|
|
73
|
+
patch_file(source / "PCbuild" / "python.props", old, new)
|
|
74
|
+
patch_file(source / "PCbuild" / "get_externals.bat", old, new)
|
|
75
|
+
|
|
76
|
+
|
|
39
77
|
def build_python(env, dirs, logfp):
|
|
40
78
|
"""
|
|
41
79
|
Run the commands to build Python.
|
|
@@ -47,6 +85,13 @@ def build_python(env, dirs, logfp):
|
|
|
47
85
|
:param logfp: A handle for the log file
|
|
48
86
|
:type logfp: file
|
|
49
87
|
"""
|
|
88
|
+
# Override default versions
|
|
89
|
+
if env["RELENV_PY_MAJOR_VERSION"] in [
|
|
90
|
+
"3.10",
|
|
91
|
+
"3.11",
|
|
92
|
+
]:
|
|
93
|
+
override_dependency(dirs.source, r"sqlite-\d+.\d+.\d+.\d+", "sqlite-3.50.4.0")
|
|
94
|
+
|
|
50
95
|
arch_to_plat = {
|
|
51
96
|
"amd64": "x64",
|
|
52
97
|
"x86": "win32",
|
|
@@ -18,10 +18,12 @@ import threading
|
|
|
18
18
|
import time
|
|
19
19
|
|
|
20
20
|
# relenv package version
|
|
21
|
-
__version__ = "0.20.
|
|
21
|
+
__version__ = "0.20.6"
|
|
22
22
|
|
|
23
23
|
MODULE_DIR = pathlib.Path(__file__).resolve().parent
|
|
24
24
|
|
|
25
|
+
DEFAULT_PYTHON = "3.10.18"
|
|
26
|
+
|
|
25
27
|
LINUX = "linux"
|
|
26
28
|
WIN32 = "win32"
|
|
27
29
|
DARWIN = "darwin"
|
|
@@ -11,6 +11,7 @@ from .build import platform_module
|
|
|
11
11
|
from .common import (
|
|
12
12
|
CHECK_HOSTS,
|
|
13
13
|
DATA_DIR,
|
|
14
|
+
DEFAULT_PYTHON,
|
|
14
15
|
__version__,
|
|
15
16
|
build_arch,
|
|
16
17
|
check_url,
|
|
@@ -39,7 +40,7 @@ def setup_parser(subparsers):
|
|
|
39
40
|
)
|
|
40
41
|
subparser.add_argument(
|
|
41
42
|
"--python",
|
|
42
|
-
default=
|
|
43
|
+
default=DEFAULT_PYTHON,
|
|
43
44
|
type=str,
|
|
44
45
|
help="The python version [default: %(default)s]",
|
|
45
46
|
)
|
|
@@ -613,7 +613,7 @@ def wrap_pip_build_wheel(name):
|
|
|
613
613
|
return func(*args, **kwargs)
|
|
614
614
|
base_dir = common().DATA_DIR / "toolchain"
|
|
615
615
|
toolchain = base_dir / common().get_triplet()
|
|
616
|
-
cargo_home =
|
|
616
|
+
cargo_home = str(common().DATA_DIR / "cargo")
|
|
617
617
|
if not toolchain.exists():
|
|
618
618
|
debug("Unable to set CARGO_HOME no toolchain exists")
|
|
619
619
|
else:
|
|
@@ -844,13 +844,9 @@ def install_cargo_config():
|
|
|
844
844
|
# We need this as a late import for python < 3.12 becuase importing it will
|
|
845
845
|
# load the ssl module. Causing out setup_openssl method to fail to load
|
|
846
846
|
# fips module.
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
install_cargo_config.tmpdir = tempfile.TemporaryDirectory(prefix="relenvcargo")
|
|
850
|
-
cargo_home = pathlib.Path(install_cargo_config.tmpdir.name)
|
|
851
|
-
|
|
847
|
+
dirs = common().work_dirs()
|
|
852
848
|
triplet = common().get_triplet()
|
|
853
|
-
|
|
849
|
+
cargo_home = dirs.data / "cargo"
|
|
854
850
|
|
|
855
851
|
toolchain = common().get_toolchain()
|
|
856
852
|
if not toolchain:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: relenv
|
|
3
|
-
Version: 0.20.
|
|
3
|
+
Version: 0.20.6
|
|
4
4
|
Project-URL: Source Code, https://github.com/saltstack/relative-environment-for-python
|
|
5
5
|
Project-URL: Documentation, https://relenv.readthedocs.io/en/latest/
|
|
6
6
|
Project-URL: Changelog, https://relenv.readthedocs.io/en/latest/changelog.html
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
# Copyright 2022 VMware, Inc.
|
|
2
|
-
# SPDX-License-Identifier: Apache-2
|
|
3
|
-
|
|
4
|
-
<#
|
|
5
|
-
Taken from: https://github.com/saltstack/salt-windows-nsis/blob/main/scripts/install_vs_buildtools.bat
|
|
6
|
-
|
|
7
|
-
.SYNOPSIS
|
|
8
|
-
Script that installs Visual Studio Build Tools
|
|
9
|
-
.DESCRIPTION
|
|
10
|
-
This script installs the Visual Studio Build Tools if they are not already
|
|
11
|
-
present on the system. Visual Studio Build Tools are the binaries and libraries
|
|
12
|
-
needed to build Python from source.
|
|
13
|
-
.EXAMPLE
|
|
14
|
-
install_vc_buildtools.ps1
|
|
15
|
-
#>
|
|
16
|
-
|
|
17
|
-
# Script Preferences
|
|
18
|
-
$ProgressPreference = "SilentlyContinue"
|
|
19
|
-
$ErrorActionPreference = "Stop"
|
|
20
|
-
|
|
21
|
-
#-------------------------------------------------------------------------------
|
|
22
|
-
# Start the Script
|
|
23
|
-
#-------------------------------------------------------------------------------
|
|
24
|
-
|
|
25
|
-
Write-Host $("=" * 80)
|
|
26
|
-
Write-Host "Install Visual Studio Build Tools" -ForegroundColor Cyan
|
|
27
|
-
Write-Host $("-" * 80)
|
|
28
|
-
|
|
29
|
-
#-------------------------------------------------------------------------------
|
|
30
|
-
# Script Variables
|
|
31
|
-
#-------------------------------------------------------------------------------
|
|
32
|
-
|
|
33
|
-
# Dependency Variables
|
|
34
|
-
$VS_BLD_TOOLS = "https://aka.ms/vs/15/release/vs_buildtools.exe"
|
|
35
|
-
$VS_CL_BIN = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\VC\bin\cl.exe"
|
|
36
|
-
$MSBUILD_BIN = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe"
|
|
37
|
-
$WIN10_SDK_RC = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.17763.0\x64\rc.exe"
|
|
38
|
-
|
|
39
|
-
#-------------------------------------------------------------------------------
|
|
40
|
-
# Visual Studio
|
|
41
|
-
#-------------------------------------------------------------------------------
|
|
42
|
-
|
|
43
|
-
$install_build_tools = $false
|
|
44
|
-
Write-Host "Confirming Presence of Visual Studio Build Tools: " -NoNewline
|
|
45
|
-
@($VS_CL_BIN, $MSBUILD_BIN, $WIN10_SDK_RC) | ForEach-Object {
|
|
46
|
-
if ( ! (Test-Path -Path $_) ) {
|
|
47
|
-
$install_build_tools = $true
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if ( $install_build_tools ) {
|
|
52
|
-
Write-Host "Missing" -ForegroundColor Yellow
|
|
53
|
-
|
|
54
|
-
Write-Host "Checking available disk space: " -NoNewLine
|
|
55
|
-
$available = (Get-PSDrive $env:SystemDrive.Trim(":")).Free
|
|
56
|
-
if ( $available -gt (1024 * 1024 * 1024 * 9.1) ) {
|
|
57
|
-
Write-Host "Success" -ForegroundColor Green
|
|
58
|
-
} else {
|
|
59
|
-
Write-Host "Failed" -ForegroundColor Red
|
|
60
|
-
Write-Host "Not enough disk space"
|
|
61
|
-
exit 1
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
Write-Host "Downloading Visual Studio 2017 build tools: " -NoNewline
|
|
65
|
-
Invoke-WebRequest -Uri "$VS_BLD_TOOLS" -OutFile "$env:TEMP\vs_buildtools.exe"
|
|
66
|
-
if ( Test-Path -Path "$env:TEMP\vs_buildtools.exe" ) {
|
|
67
|
-
Write-Host "Success" -ForegroundColor Green
|
|
68
|
-
} else {
|
|
69
|
-
Write-Host "Failed" -ForegroundColor Red
|
|
70
|
-
exit 1
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
Write-Host "Creating Layout for Visual Studio 2017 build tools: " -NoNewline
|
|
74
|
-
if ( ! (Test-Path -Path "$($env:TEMP)\build_tools") ) {
|
|
75
|
-
New-Item -Path "$($env:TEMP)\build_tools" -ItemType Directory | Out-Null
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
Start-Process -FilePath "$env:TEMP\vs_buildtools.exe" `
|
|
79
|
-
-ArgumentList "--layout `"$env:TEMP\build_tools`"", `
|
|
80
|
-
"--add Microsoft.VisualStudio.Workload.MSBuildTools", `
|
|
81
|
-
"--add Microsoft.VisualStudio.Workload.VCTools", `
|
|
82
|
-
"--add Microsoft.VisualStudio.Component.Windows81SDK", `
|
|
83
|
-
"--add Microsoft.VisualStudio.Component.Windows10SDK.17763", `
|
|
84
|
-
"--add Microsoft.VisualStudio.Component.VC.140", `
|
|
85
|
-
"--add Microsoft.Component.VC.Runtime.UCRTSDK", `
|
|
86
|
-
"--lang en-US", `
|
|
87
|
-
"--includeRecommended", `
|
|
88
|
-
"--quiet", `
|
|
89
|
-
"--wait" `
|
|
90
|
-
-Wait -WindowStyle Hidden
|
|
91
|
-
if ( Test-Path -Path "$env:TEMP\build_tools\vs_buildtools.exe" ) {
|
|
92
|
-
Write-Host "Success" -ForegroundColor Green
|
|
93
|
-
} else {
|
|
94
|
-
Write-Host "Failed" -ForegroundColor Red
|
|
95
|
-
exit 1
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
# Serial: 28cc3a25bfba44ac449a9b586b4339a
|
|
99
|
-
# Hash: 3b1efd3a66ea28b16697394703a72ca340a05bd5
|
|
100
|
-
if (! (Test-Path -Path Cert:\LocalMachine\Root\3b1efd3a66ea28b16697394703a72ca340a05bd5) ) {
|
|
101
|
-
Write-Host "Installing Certificate Sign Root Certificate: " -NoNewLine
|
|
102
|
-
Start-Process -FilePath "certutil" `
|
|
103
|
-
-ArgumentList "-addstore", `
|
|
104
|
-
"Root", `
|
|
105
|
-
"$($env:TEMP)\build_tools\certificates\manifestCounterSignRootCertificate.cer" `
|
|
106
|
-
-Wait -WindowStyle Hidden
|
|
107
|
-
if ( Test-Path -Path Cert:\LocalMachine\Root\3b1efd3a66ea28b16697394703a72ca340a05bd5 ) {
|
|
108
|
-
Write-Host "Success" -ForegroundColor Green
|
|
109
|
-
} else {
|
|
110
|
-
Write-Host "Failed" -ForegroundColor Yellow
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
# Serial: 3f8bc8b5fc9fb29643b569d66c42e144
|
|
115
|
-
# Hash: 8f43288ad272f3103b6fb1428485ea3014c0bcfe
|
|
116
|
-
if (! (Test-Path -Path Cert:\LocalMachine\Root\8f43288ad272f3103b6fb1428485ea3014c0bcfe) ) {
|
|
117
|
-
Write-Host "Installing Certificate Root Certificate: " -NoNewLine
|
|
118
|
-
Start-Process -FilePath "certutil" `
|
|
119
|
-
-ArgumentList "-addstore", `
|
|
120
|
-
"Root", `
|
|
121
|
-
"$($env:TEMP)\build_tools\certificates\manifestRootCertificate.cer" `
|
|
122
|
-
-Wait -WindowStyle Hidden
|
|
123
|
-
if ( Test-Path -Path Cert:\LocalMachine\Root\8f43288ad272f3103b6fb1428485ea3014c0bcfe ) {
|
|
124
|
-
Write-Host "Success" -ForegroundColor Green
|
|
125
|
-
} else {
|
|
126
|
-
Write-Host "Failed" -ForegroundColor Yellow
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
Write-Host "Installing Visual Studio 2017 build tools: " -NoNewline
|
|
131
|
-
Start-Process -FilePath "$env:TEMP\build_tools\vs_setup.exe" `
|
|
132
|
-
-ArgumentList "--wait", "--noweb", "--quiet" `
|
|
133
|
-
-Wait
|
|
134
|
-
@($VS_CL_BIN, $MSBUILD_BIN, $WIN10_SDK_RC) | ForEach-Object {
|
|
135
|
-
if ( ! (Test-Path -Path $_) ) {
|
|
136
|
-
Write-Host "Failed" -ForegroundColor Red
|
|
137
|
-
exit 1
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
Write-Host "Success" -ForegroundColor Green
|
|
141
|
-
} else {
|
|
142
|
-
Write-Host "Success" -ForegroundColor Green
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
#-------------------------------------------------------------------------------
|
|
146
|
-
# Finished
|
|
147
|
-
#-------------------------------------------------------------------------------
|
|
148
|
-
Write-Host $("-" * 80)
|
|
149
|
-
Write-Host "Install Visual Studio Build Tools Completed" -ForegroundColor Cyan
|
|
150
|
-
Write-Host $("=" * 80)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|