From 53cfa53040ac496095fa01da520df8d2c3dabd5a Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 31 Oct 2024 15:34:45 -0600 Subject: [PATCH] Update urls to deps so windows pkgs will build --- cicd/shared-gh-workflows-context.yml | 2 +- pkg/windows/build_python.ps1 | 5 +- pkg/windows/install_nsis.ps1 | 4 +- pkg/windows/install_salt.ps1 | 5 - pkg/windows/prep_salt.ps1 | 7 +- pkg/windows/sign.bat | 219 --------------------------- 6 files changed, 6 insertions(+), 236 deletions(-) delete mode 100644 pkg/windows/sign.bat diff --git a/cicd/shared-gh-workflows-context.yml b/cicd/shared-gh-workflows-context.yml index b759400266dc..4a2ca3bd5951 100644 --- a/cicd/shared-gh-workflows-context.yml +++ b/cicd/shared-gh-workflows-context.yml @@ -1,6 +1,6 @@ nox_version: "2022.8.7" python_version: "3.10.15" -relenv_version: "0.17.3" +relenv_version: "0.18.0" mandatory_os_slugs: - rockylinux-9 - amazonlinux-2023-arm64 diff --git a/pkg/windows/build_python.ps1 b/pkg/windows/build_python.ps1 index 9257ae79456d..47b6c9a641ad 100644 --- a/pkg/windows/build_python.ps1 +++ b/pkg/windows/build_python.ps1 @@ -176,13 +176,10 @@ $BUILD_DIR = "$SCRIPT_DIR\buildenv" $RELENV_DIR = "${env:LOCALAPPDATA}\relenv" $SYS_PY_BIN = (python -c "import sys; print(sys.executable)") $BLD_PY_BIN = "$BUILD_DIR\Scripts\python.exe" -$SALT_DEP_URL = "https://repo.saltproject.io/windows/dependencies" if ( $Architecture -eq "x64" ) { - $SALT_DEP_URL = "$SALT_DEP_URL/64" $ARCH = "amd64" } else { - $SALT_DEP_URL = "$SALT_DEP_URL/32" $ARCH = "x86" } @@ -249,7 +246,7 @@ if ( $env:VIRTUAL_ENV ) { #------------------------------------------------------------------------------- # Installing Relenv #------------------------------------------------------------------------------- -Write-Host "Installing Relenv: " -NoNewLine +Write-Host "Installing Relenv ($RelenvVersion): " -NoNewLine pip install relenv==$RelenvVersion --disable-pip-version-check | Out-Null $output = pip list --disable-pip-version-check if ("relenv" -in $output.split()) { diff --git a/pkg/windows/install_nsis.ps1 b/pkg/windows/install_nsis.ps1 index f30abdfbb9a3..e225ab2c7418 100644 --- a/pkg/windows/install_nsis.ps1 +++ b/pkg/windows/install_nsis.ps1 @@ -46,7 +46,7 @@ $NSIS_DIR = "${env:ProgramFiles(x86)}\NSIS" $NSIS_PLUG_A = "$NSIS_DIR\Plugins\x86-ansi" $NSIS_PLUG_U = "$NSIS_DIR\Plugins\x86-unicode" $NSIS_LIB_DIR = "$NSIS_DIR\Include" -$DEPS_URL = "https://repo.saltproject.io/windows/dependencies" +$DEPS_URL = "https://github.com/saltstack/salt-windows-deps/raw/refs/heads/main/nsis" #------------------------------------------------------------------------------- # Start the Script @@ -68,7 +68,7 @@ if ( Test-Path -Path "$check_file" ) { Write-Result "Missing" -ForegroundColor Yellow Write-Host "Downloading NSIS: " -NoNewline - $url = "$DEPS_URL/nsis-3.03-setup.exe" + $url = "$DEPS_URL/nsis-3.10-setup.exe" $file = "$env:TEMP\install_nsis.exe" Invoke-WebRequest -Uri $url -OutFile "$file" if ( Test-Path -Path "$file" ) { diff --git a/pkg/windows/install_salt.ps1 b/pkg/windows/install_salt.ps1 index 3be6e6f18da1..670ea38a473c 100644 --- a/pkg/windows/install_salt.ps1 +++ b/pkg/windows/install_salt.ps1 @@ -81,11 +81,6 @@ $ARCH = $(. $PYTHON_BIN -c "import platform; print(platform.architectur # Script Variables $PROJECT_DIR = $(git rev-parse --show-toplevel) $SALT_DEPS = "$PROJECT_DIR\requirements\static\pkg\py$PY_VERSION\windows.txt" -if ( $ARCH -eq "64bit" ) { - $SALT_DEP_URL = "https://repo.saltproject.io/windows/dependencies/64" -} else { - $SALT_DEP_URL = "https://repo.saltproject.io/windows/dependencies/32" -} if ( ! $SkipInstall ) { #------------------------------------------------------------------------------- diff --git a/pkg/windows/prep_salt.ps1 b/pkg/windows/prep_salt.ps1 index 7bcde5b60c7b..2339ccb006e8 100644 --- a/pkg/windows/prep_salt.ps1 +++ b/pkg/windows/prep_salt.ps1 @@ -65,7 +65,6 @@ if ( $BuildDir ) { $SCRIPTS_DIR = "$BUILD_DIR\Scripts" $BUILD_CONF_DIR = "$BUILD_DIR\configs" $SITE_PKGS_DIR = "$BUILD_DIR\Lib\site-packages" -$BUILD_SALT_DIR = "$SITE_PKGS_DIR\salt" $PYTHON_BIN = "$SCRIPTS_DIR\python.exe" $PY_VERSION = [Version]((Get-Command $PYTHON_BIN).FileVersionInfo.ProductVersion) $PY_VERSION = "$($PY_VERSION.Major).$($PY_VERSION.Minor)" @@ -73,12 +72,10 @@ $ARCH = $(. $PYTHON_BIN -c "import platform; print(platform.architectu if ( $ARCH -eq "64bit" ) { $ARCH = "AMD64" - $ARCH_X = "x64" - $SALT_DEP_URL = "https://repo.saltproject.io/windows/dependencies/64" + $SALT_DEP_URL = "https://github.com/saltstack/salt-windows-deps/raw/refs/heads/main/ssm/64" } else { $ARCH = "x86" - $ARCH_X = "x86" - $SALT_DEP_URL = "https://repo.saltproject.io/windows/dependencies/32" + $SALT_DEP_URL = "https://github.com/saltstack/salt-windows-deps/raw/refs/heads/main/ssm/32" } #------------------------------------------------------------------------------- diff --git a/pkg/windows/sign.bat b/pkg/windows/sign.bat deleted file mode 100644 index 64809a5a1601..000000000000 --- a/pkg/windows/sign.bat +++ /dev/null @@ -1,219 +0,0 @@ -:: ############################################################################ -:: -:: FILE: sign.bat -:: -:: DESCRIPTION: Signing and Hashing script for Salt builds on Windows. -:: Requires an official Code Signing Certificate and drivers -:: installed to sign the files. Generates hashes in MD5 and -:: SHA256 in a file of the same name with a `.md5` or -:: `.sha256` extension. -:: -:: NOTE: This script is used internally by SaltStack to sign and -:: hash Windows Installer builds and uses resources not -:: available to the community, such as SaltStack's Code -:: Signing Certificate. It is placed here for version -:: control. -:: -:: COPYRIGHT: (c) 2012-2018 by the SaltStack Team -:: -:: LICENSE: Apache 2.0 -:: ORGANIZATION: SaltStack, Inc (saltstack.com) -:: CREATED: 2017 -:: -:: ############################################################################ -:: -:: USAGE: The script must be located in a directory that has the installer -:: files in a sub-folder named with the major version, ie: `2018.3`. -:: Insert the key fob that contains the code signing certificate. Run -:: the script passing the full version: `.\sign.bat 2018.3.1`. -:: -:: The script will sign the installers and generate the corresponding -:: hash files. These can then be uploaded to the salt repo. -:: -:: The files must be in the following format: -:: \Salt-Minion----Setup.exe -:: So, for a Salt Minion installer for 2018.3.1 on AMD64 for Python 3 -:: file would be placed in a subdirectory named `2018.3` and the file -:: would be named: `Salt-Minion-2018.3.1-Py3-AMD64-Setup.exe`. This -:: is how the file is created by the NSI Script anyway. -:: -:: You can test the timestamp server with the following command: -:: curl -i timestamp.digicert.com/timestamp/health -:: -:: REQUIREMENTS: This script requires the ``signtool.exe`` binary that is a part -:: of the Windows SDK. To install just the ``signtool.exe``: -:: -:: OPTION 1: -:: 1. Download the Windows 10 SDK ISO: -:: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ -:: 2. Mount the ISO and browse to the ``Installers`` directory -:: 3. Run the ``Windows SDK Signing Tools-x86_en-us.msi`` -:: -:: OPTION 2: -:: 1. Download the Visual Studio BUild Tools: -:: https://aka.ms/vs/15/release/vs_buildtools.exe -:: 2. Run the following command: -:: vs_buildtools.exe --quiet --add Microsoft.Component.ClickOnce.MSBuild -:: -:: ############################################################################ -@ echo off -if [%1]==[] ( - echo You must pass a version - goto quit -) else ( - set "Version=%~1" -) - -set Series=%Version:~0,4% - -if not exist .\%Series%\ ( - echo - Series %Series% is not valid - exit 1 -) - -:: Sign Installer Files -echo =========================================================================== -echo Signing... -echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -signtool.exe sign /a /t http://timestamp.digicert.com ^ - "%Series%\Salt-Minion-%Version%-AMD64-Setup.exe" ^ - "%Series%\Salt-Minion-%Version%-x86-Setup.exe" ^ - "%Series%\Salt-%Version%-AMD64-Setup.exe" ^ - "%Series%\Salt-%Version%-x86-Setup.exe" ^ - "%Series%\Salt-%Version%-Py2-AMD64-Setup.exe" ^ - "%Series%\Salt-%Version%-Py2-x86-Setup.exe" ^ - "%Series%\Salt-%Version%-Py3-AMD64-Setup.exe" ^ - "%Series%\Salt-%Version%-Py3-x86-Setup.exe" ^ - "%Series%\Salt-Minion-%Version%-Py2-AMD64-Setup.exe" ^ - "%Series%\Salt-Minion-%Version%-Py2-x86-Setup.exe" ^ - "%Series%\Salt-Minion-%Version%-Py3-AMD64-Setup.exe" ^ - "%Series%\Salt-Minion-%Version%-Py3-x86-Setup.exe" ^ - "%Series%\Salt-Minion-%Version%-Py3-AMD64.msi" ^ - "%Series%\Salt-Minion-%Version%-Py3-x86.msi" - -echo %ERRORLEVEL% -echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -echo Signing Complete -echo =========================================================================== - -:: Create Hash files -echo =========================================================================== -echo Creating Hashes... -echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -set "file_name=Salt-Minion-%Version%-AMD64-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-Minion-%Version%-x86-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-%Version%-AMD64-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-%Version%-x86-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-%Version%-Py2-AMD64-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-%Version%-Py2-x86-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-%Version%-Py3-AMD64-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-%Version%-Py3-x86-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-Minion-%Version%-Py2-AMD64-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-Minion-%Version%-Py2-x86-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-Minion-%Version%-Py3-AMD64-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-Minion-%Version%-Py3-x86-Setup.exe" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-Minion-%Version%-Py3-AMD64.msi" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -set "file_name=Salt-Minion-%Version%-Py3-x86.msi" -set "file=.\%Series%\%file_name%" -if exist "%file%" ( - echo - %file_name% - powershell -c "$hash = (Get-FileHash -Algorithm MD5 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.md5\" -NoNewLine -Encoding ASCII" - powershell -c "$hash = (Get-FileHash -Algorithm SHA256 \"%file%\").Hash; Out-File -InputObject $hash\" %file_name%\" -FilePath \"%file%.sha256\" -NoNewLine -Encoding ASCII" -) - -echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -echo Hashing Complete -echo =========================================================================== - -:quit