Skip to content

Protect Tcl sub-interpreter creation with quarantine mechanism #665

Protect Tcl sub-interpreter creation with quarantine mechanism

Protect Tcl sub-interpreter creation with quarantine mechanism #665

Workflow file for this run

name: windows-tests
on:
push:
branches:
- main
- v*.*.x
pull_request:
branches:
- main
- v*.*.x
permissions:
contents: read
jobs:
native-cmd:
runs-on: windows-2022
env:
TCL_INSTALLER: SetupTcl-8.6.17-x64_Bawt-3.2.0
TCL_DL_URL: https://www.bawt.tcl3d.org/download/Tcl-Pure
TCLSH_DIR: C:\Tcl\bin
DIST_WIN: modules-*-win
MODULE_DIR: C:\Program Files\Environment Modules\bin
steps:
- name: Configure Git autocrlf
shell: bash
run: git config --global core.autocrlf input
- uses: actions/checkout@v7
with:
fetch-depth: 0
set-safe-directory: /cygdrive/d/a/modules/modules
- uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1
with:
# precise all sphinxcontrib packages required as dependency spec
# of python39-sphinx package is regularly broken
packages: make sed git autoconf automake libtool tcl python39 python39-docutils=0.18.1-1 python39-sphinx gzip zip python39-sphinxcontrib-applehelp python39-sphinxcontrib-devhelp python39-sphinxcontrib-htmlhelp python39-sphinxco ntrib-jsmath python39-sphinxcontrib-qthelp python39-sphinxcontrib-serializinghtml python39-sphinxcontrib-websupport python39-alabaster python39-sqlalchemy
- name: Install Tcl under Windows
shell: cmd
run: |
curl -LfsS --retry 5 --retry-all-errors --retry-delay 5 -o %TCL_INSTALLER%.exe %TCL_DL_URL%/%TCL_INSTALLER%.exe
%TCL_INSTALLER% /verysilent
- name: Configure Git safe.directory
run: |
bash -lc 'git config --global --add safe.directory $(cygpath -u "$GITHUB_WORKSPACE")'
- name: Build Modules dist
run: |
bash -lc 'cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure --disable-libtclenvmodules && make dist-win'
- name: Install Modules
shell: cmd
run: |
jar xvf %DIST_WIN%.zip
cd %DIST_WIN%
:: replace (rather than extend) the inherited PATH with a
:: controlled value that is still past the legacy 1024-character
:: limit of the 'setx' tool previously used here, to simulate a
:: large pre-existing PATH such as found in a Visual Studio
:: Developer Prompt (see GH-654), while staying safely under the
:: 8191-character command line length limit of cmd.exe
setlocal enabledelayedexpansion
set "PATH=%SYSTEMROOT%\system32;%SYSTEMROOT%"
for /L %%i in (1,1,50) do set "PATH=!PATH!;C:\dummy-path-segment-%%i"
set "PATH=!PATH!;C:\marker-end-of-long-path"
call INSTALL.bat
- name: Check persisted PATH is not truncated
shell: cmd
run: |
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PATH > persisted-path.txt
%SYSTEMROOT%\system32\find /i "marker-end-of-long-path" persisted-path.txt >nul
if errorlevel 1 (
echo "persisted system PATH truncated: marker entry not found"
exit /b 1
)
%SYSTEMROOT%\system32\find /i "%MODULE_DIR%" persisted-path.txt >nul
if errorlevel 1 (
echo "installation 'bin' directory not found in persisted system PATH"
exit /b 1
)
- name: Test Modules installation
shell: cmd
run: |
:: manually define module cmd dir as PATH updated by INSTALL.bat
:: is not inherited by test_script
if not "%TCLSH_DIR%" == "" path %MODULE_DIR%;%TCLSH_DIR%;%PATH%
cd %DIST_WIN%
TESTINSTALL.bat
- name: Uninstall Modules
shell: cmd
run: |
cd %DIST_WIN%
UNINSTALL.bat
native-pwsh:
runs-on: windows-2022
env:
TCL_INSTALLER: SetupTcl-8.6.17-x64_Bawt-3.2.0
TCL_DL_URL: https://www.bawt.tcl3d.org/download/Tcl-Pure
TCLSH_DIR: C:\Tcl\bin
DIST_WIN: modules-*-win
steps:
- name: Configure Git autocrlf
shell: bash
run: git config --global core.autocrlf input
- uses: actions/checkout@v7
with:
fetch-depth: 0
set-safe-directory: /cygdrive/d/a/modules/modules
- uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1
with:
# precise all sphinxcontrib packages required as dependency spec
# of python39-sphinx package is regularly broken
packages: make sed git autoconf automake libtool tcl python39 python39-docutils=0.18.1-1 python39-sphinx gzip zip python39-sphinxcontrib-applehelp python39-sphinxcontrib-devhelp python39-sphinxcontrib-htmlhelp python39-sphinxco ntrib-jsmath python39-sphinxcontrib-qthelp python39-sphinxcontrib-serializinghtml python39-sphinxcontrib-websupport python39-alabaster python39-sqlalchemy
- name: Install Tcl under Windows
shell: cmd
run: |
curl -LfsS --retry 5 --retry-all-errors --retry-delay 5 -o %TCL_INSTALLER%.exe %TCL_DL_URL%/%TCL_INSTALLER%.exe
%TCL_INSTALLER% /verysilent
- name: Configure Git safe.directory
run: |
bash -lc 'git config --global --add safe.directory $(cygpath -u "$GITHUB_WORKSPACE")'
- name: Build Modules dist
run: |
bash -lc 'cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure --disable-libtclenvmodules && make dist-win'
- name: Install Modules
shell: cmd
run: |
jar xvf %DIST_WIN%.zip
cd %DIST_WIN%
INSTALL_PWSH.bat
- name: Test Modules installation
shell: cmd
run: |
:: manually define module cmd dir as PATH updated by INSTALL.bat
:: is not inherited by test_script
if not "%TCLSH_DIR%" == "" path %TCLSH_DIR%;%PATH%
cd %DIST_WIN%
pwsh TESTINSTALL_PWSH.ps1
- name: Uninstall Modules
shell: cmd
run: |
cd %DIST_WIN%
UNINSTALL.bat
cygwin:
runs-on: windows-2022
steps:
- name: Configure Git autocrlf
shell: bash
run: git config --global core.autocrlf input
- uses: actions/checkout@v7
with:
fetch-depth: 0
set-safe-directory: /cygdrive/d/a/modules/modules
- uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1
with:
# precise all sphinxcontrib packages required as dependency spec
# of python39-sphinx package is regularly broken
# precise liblapack0 package needed by R package (missing dependency
# since R-4.2.1-1)
packages: make sed git autoconf automake libtool tcl dejagnu python39 python39-docutils=0.18.1-1 python39-sphinx gzip ruby zsh tcsh mksh fish cmake R liblapack0 tcl-devel gcc-core curl python39-sphinxcontrib-applehelp python39-sphinxcontrib-devhelp python39-sphinxcontrib-htmlhelp python39-sphinxcontrib-jsmath python39-sphinxcontrib-qthelp python39-sphinxcontrib-serializinghtml python39-sphinxcontrib-websupport python39-alabaster python39-sqlalchemy
- name: Configure Git safe.directory
run: |
bash -lc 'git config --global --add safe.directory $(cygpath -u "$GITHUB_WORKSPACE")'
- name: Build Modules
run: |
bash -lc 'cd $(cygpath -u "$GITHUB_WORKSPACE") && ./configure && make'
- name: Test Modules build
run: |
bash -lc 'cd $(cygpath -u "$GITHUB_WORKSPACE") && script/mt'
- name: Install Modules
run: |
bash -lc 'cd $(cygpath -u "$GITHUB_WORKSPACE") && make install'
- name: Test Modules installation
run: |
bash -lc 'cd $(cygpath -u "$GITHUB_WORKSPACE") && script/mt install'
- name: Uninstall Modules
run: |
bash -lc 'cd $(cygpath -u "$GITHUB_WORKSPACE") && make uninstall'
- uses: actions/upload-artifact@v7
if: failure()
with:
name: testsuite-logs-${{ github.job }}
path: |
modules.log
install.log
retention-days: 5
msys:
runs-on: windows-2022
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MSYS
update: true
- name: Configure Git autocrlf
shell: bash
run: git config --global core.autocrlf input
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install system packages
shell: msys2 {0}
run: |
pacman --noconfirm --noprogressbar -S tcl tcl-devel dejagnu python ruby cmake zsh tcsh mksh fish gcc autoconf make git curl gzip
- name: Build Modules
shell: msys2 {0}
run: |
./configure
make
- name: Test Modules build
shell: msys2 {0}
run: |
script/mt
- name: Install Modules
shell: msys2 {0}
run: |
make install
- name: Test Modules installation
shell: msys2 {0}
run: |
script/mt install
- name: Uninstall Modules
shell: msys2 {0}
run: |
make uninstall
- uses: actions/upload-artifact@v7
if: failure()
with:
name: testsuite-logs-${{ github.job }}
path: |
modules.log
install.log
retention-days: 5