From 3390b1e608f2cf39c00cf66a2e975b756c5e8b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20S=C3=B6derqvist?= Date: Wed, 8 Oct 2025 11:37:15 +0200 Subject: [PATCH] Allow TCL 9.0 for tests (#1673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes our tests possible to run with TCL 9. The latest Fedora now has TCL 9.0 and it's working now, including the TCL TLS package. (This wasn't working earlier due to some packaging errors for TCL packages in Fedora, which have been fixed now.) This PR also removes the custom compilation of TCL 8 used in our Daily jobs and uses the system default TCL version instead. The TCL version depends on the OS. For the latest Fedora, you get 9.0, for macOS you get 8.5 and for most other OSes you get 8.6. The checks for TCL 8.7 are removed, because 8.7 doesn't exist. It was never released. --------- Signed-off-by: Viktor Söderqvist --- .github/actions/rpm-distros-tcl8/action.yml | 31 --------------------- .github/workflows/daily.yml | 18 ++++++------ runtest | 2 +- runtest-cluster | 2 +- runtest-moduleapi | 2 +- runtest-sentinel | 2 +- tests/instances.tcl | 4 +-- tests/support/cluster.tcl | 1 - tests/support/response_transformers.tcl | 2 -- tests/support/valkey.tcl | 1 - tests/test_helper.tcl | 8 ++---- tests/unit/other.tcl | 2 +- 12 files changed, 17 insertions(+), 58 deletions(-) delete mode 100644 .github/actions/rpm-distros-tcl8/action.yml diff --git a/.github/actions/rpm-distros-tcl8/action.yml b/.github/actions/rpm-distros-tcl8/action.yml deleted file mode 100644 index b43b3cc32..000000000 --- a/.github/actions/rpm-distros-tcl8/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: 'Install TCL8' -description: 'Installs tcl8 and tcltls from source on Fedora-based or uses the system package on others.' - -inputs: - matrix_name: - description: 'The name of the matrix to check for fedora' - required: true - -runs: - using: "composite" - steps: - # Fedora 42 comes with Tcl 9 by default, but tcltls is currently incompatible with Tcl 9. - # As a workaround, we install Tcl 8 and manually build tcltls 1.7.22 from source. - # Once tcltls adds support for Tcl 9, this logic can be removed and system packages used instead. - - run: | - if [[ "${{ inputs.matrix_name }}" =~ "fedora" ]]; then - dnf -y install tcl8 tcl8-devel gcc make awk openssl openssl-devel - ln -s /usr/bin/tclsh8.6 /usr/bin/tclsh - curl -LO https://core.tcl-lang.org/tcltls/uv/tcltls-1.7.22.tar.gz - tar -xzf tcltls-1.7.22.tar.gz - pushd tcltls-1.7.22 - ./configure --with-tcl=/usr/lib64/tcl8.6 - make - mkdir -p /usr/lib64/tcl8.6/tls1.7.22 - cp tcltls.so pkgIndex.tcl /usr/lib64/tcl8.6/tls1.7.22/ - popd - else - dnf -y install tcl tcltls - fi - ./utils/gen-test-certs.sh - shell: bash diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 52899e44e..de65828a9 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -947,12 +947,10 @@ jobs: run: dnf -y install epel-release - name: make run: | - dnf -y install gcc make procps-ng openssl-devel openssl which /usr/bin/kill /usr/bin/awk + dnf -y install gcc make procps-ng which /usr/bin/kill /usr/bin/awk make -j SERVER_CFLAGS='-Werror' - name: testprep - uses: ./.github/actions/rpm-distros-tcl8 - with: - matrix_name: ${{ matrix.name }} + run: dnf -y install tcl tcltls - name: test if: true && !contains(github.event.inputs.skiptests, 'valkey') run: ./runtest ${{ github.event_name != 'pull_request' && '--accurate' || '' }} --verbose --dump-logs ${{github.event.inputs.test_args}} @@ -1018,9 +1016,9 @@ jobs: dnf -y install make gcc openssl-devel openssl procps-ng which /usr/bin/kill /usr/bin/awk make -j BUILD_TLS=module SERVER_CFLAGS='-Werror' - name: testprep - uses: ./.github/actions/rpm-distros-tcl8 - with: - matrix_name: ${{ matrix.name }} + run: | + dnf -y install tcl tcltls + ./utils/gen-test-certs.sh - name: test if: true && !contains(github.event.inputs.skiptests, 'valkey') run: | @@ -1090,9 +1088,9 @@ jobs: dnf -y install make gcc openssl-devel openssl procps-ng which /usr/bin/kill /usr/bin/awk make -j BUILD_TLS=module SERVER_CFLAGS='-Werror' - name: testprep - uses: ./.github/actions/rpm-distros-tcl8 - with: - matrix_name: ${{ matrix.name }} + run: | + dnf -y install tcl tcltls + ./utils/gen-test-certs.sh - name: test if: true && !contains(github.event.inputs.skiptests, 'valkey') run: | diff --git a/runtest b/runtest index 00949bc30..f0c4c422d 100755 --- a/runtest +++ b/runtest @@ -1,5 +1,5 @@ #!/bin/sh -TCL_VERSIONS="8.5 8.6 8.7" +TCL_VERSIONS="8.5 8.6 9.0" TCLSH="" for VERSION in $TCL_VERSIONS; do diff --git a/runtest-cluster b/runtest-cluster index 85e8690b1..de31e7287 100755 --- a/runtest-cluster +++ b/runtest-cluster @@ -1,5 +1,5 @@ #!/bin/sh -TCL_VERSIONS="8.5 8.6 8.7" +TCL_VERSIONS="8.5 8.6 9.0" TCLSH="" for VERSION in $TCL_VERSIONS; do diff --git a/runtest-moduleapi b/runtest-moduleapi index 460ee5946..990e3a5fd 100755 --- a/runtest-moduleapi +++ b/runtest-moduleapi @@ -1,5 +1,5 @@ #!/bin/sh -TCL_VERSIONS="8.5 8.6 8.7" +TCL_VERSIONS="8.5 8.6 9.0" TCLSH="" [ -z "$MAKE" ] && MAKE=make diff --git a/runtest-sentinel b/runtest-sentinel index 3bbe9af3c..c2889e9d6 100755 --- a/runtest-sentinel +++ b/runtest-sentinel @@ -1,5 +1,5 @@ #!/bin/sh -TCL_VERSIONS="8.5 8.6 8.7" +TCL_VERSIONS="8.5 8.6 9.0" TCLSH="" for VERSION in $TCL_VERSIONS; do diff --git a/tests/instances.tcl b/tests/instances.tcl index 76d9e14bc..265fa054a 100644 --- a/tests/instances.tcl +++ b/tests/instances.tcl @@ -7,8 +7,6 @@ # This software is released under the BSD License. See the COPYING file for # more information. -package require Tcl 8.5 - set tcl_precision 17 source ../support/valkey.tcl source ../support/util.tcl @@ -293,7 +291,7 @@ proc parse_options {} { incr j set ::host ${val} } elseif {$opt eq {--tls} || $opt eq {--tls-module}} { - package require tls 1.6 + package require tls ::tls::init \ -cafile "$::tlsdir/ca.crt" \ -certfile "$::tlsdir/client.crt" \ diff --git a/tests/support/cluster.tcl b/tests/support/cluster.tcl index f9d4792d7..0c26310a5 100644 --- a/tests/support/cluster.tcl +++ b/tests/support/cluster.tcl @@ -9,7 +9,6 @@ # $c get foo # $c close -package require Tcl 8.5 package provide valkey_cluster 0.1 namespace eval valkey_cluster {} diff --git a/tests/support/response_transformers.tcl b/tests/support/response_transformers.tcl index 26a4e0f17..da3d31912 100644 --- a/tests/support/response_transformers.tcl +++ b/tests/support/response_transformers.tcl @@ -14,8 +14,6 @@ # changes in many files) we decided to transform the response to RESP2 # when running with --force-resp3 -package require Tcl 8.5 - namespace eval response_transformers {} # Transform a map response into an array of tuples (tuple = array with 2 elements) diff --git a/tests/support/valkey.tcl b/tests/support/valkey.tcl index a5d1e2ca0..65e65fe05 100644 --- a/tests/support/valkey.tcl +++ b/tests/support/valkey.tcl @@ -25,7 +25,6 @@ # # vwait forever -package require Tcl 8.5 package provide valkey 0.1 source [file join [file dirname [info script]] "response_transformers.tcl"] diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 5ca9c6ba4..e0b98737b 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -2,8 +2,6 @@ # This software is released under the BSD License. See the COPYING file for # more information. -package require Tcl 8.5 - set tcl_precision 17 source tests/support/valkey.tcl source tests/support/aofmanifest.tcl @@ -419,7 +417,7 @@ proc test_server_cron {} { } proc accept_test_clients {fd addr port} { - fconfigure $fd -encoding binary + fconfigure $fd -translation binary fileevent $fd readable [list read_from_test_client $fd] } @@ -620,7 +618,7 @@ proc the_end {} { # to read the command, execute, reply... all this in a loop. proc test_client_main server_port { set ::test_server_fd [socket localhost $server_port] - fconfigure $::test_server_fd -encoding binary + fconfigure $::test_server_fd -translation binary send_data_packet $::test_server_fd ready [pid] while 1 { set bytes [gets $::test_server_fd] @@ -755,7 +753,7 @@ for {set j 0} {$j < [llength $argv]} {incr j} { } elseif {$opt eq {--io-threads}} { set ::io_threads 1 } elseif {$opt eq {--tls} || $opt eq {--tls-module}} { - package require tls 1.6 + package require tls set ::tls 1 ::tls::init \ -cafile "$::tlsdir/ca.crt" \ diff --git a/tests/unit/other.tcl b/tests/unit/other.tcl index 4a802eed3..46f4b1b7b 100644 --- a/tests/unit/other.tcl +++ b/tests/unit/other.tcl @@ -216,7 +216,7 @@ start_server {tags {"other"}} { } else { set fd2 [socket [srv host] [srv port]] } - fconfigure $fd2 -encoding binary -translation binary + fconfigure $fd2 -translation binary if {!$::singledb} { puts -nonewline $fd2 "SELECT 9\r\n" flush $fd2