From 15965b1e3286bed6153ceeff307f6b6749733fd4 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 19:47:35 -0500 Subject: [PATCH 1/9] add some debugging to track down tcl issues --- .github/workflows/windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 41adb19cfa9..7af33611f27 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -109,6 +109,11 @@ jobs: conda config --show-sources conda list -n $env:CONDA_ENV_NAME + - name: Log TCL path + run: | + Get-ChildItem -Recurse Env: + Get-ChildItem -Path ${{ env.CONDA }}/envs/mlos -Recurse -Filter '*tcl*' | Select-Object -ExpandProperty FullName + # This is moreso about code cleanliness, which is a dev thing, not a # functionality thing, and the rules for that change between python versions, # so only do this for the default in the devcontainer. From b7f63dbc2e39f9966c3d1ac7a817e1aaeefdb8be Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 20:11:13 -0500 Subject: [PATCH 2/9] add a workaround for tcl location discovery for windows --- mlos_viz/mlos_viz/tests/conftest.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mlos_viz/mlos_viz/tests/conftest.py b/mlos_viz/mlos_viz/tests/conftest.py index 9299ebb377f..687fb05974f 100644 --- a/mlos_viz/mlos_viz/tests/conftest.py +++ b/mlos_viz/mlos_viz/tests/conftest.py @@ -4,6 +4,11 @@ # """Export test fixtures for mlos_viz.""" +from pathlib import Path +import glob +import os +import sys + from mlos_bench.tests import tunable_groups_fixtures from mlos_bench.tests.storage.sql import fixtures as sql_storage_fixtures @@ -15,3 +20,20 @@ tunable_groups_config = tunable_groups_fixtures.tunable_groups_config tunable_groups = tunable_groups_fixtures.tunable_groups + +# Workaround for #1004 +# See Also: https://github.com/python/cpython/issues/111754 +if sys.platform == "win32": + # Fix Tcl/Tk folder + if "TK_LIBRARY" not in os.environ: + os.environ["TCL_LIBRARY"] = str( + Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tcl*", "init.tcl"))[0]).parent + ) + if "TK_LIBRARY" not in os.environ: + os.environ["TK_LIBRARY"] = str( + Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tk*", "pkgIndex.tcl"))[0]).parent + ) + if "TIX_LIBRARY" not in os.environ: + os.environ["TIX_LIBRARY"] = str( + Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tix*", "pkgIndex.tcl"))[0]).parent + ) From 7fa0eafeecfc66c3678941791eb4e38227b91ec3 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 20:13:58 -0500 Subject: [PATCH 3/9] add messages --- mlos_viz/mlos_viz/tests/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mlos_viz/mlos_viz/tests/conftest.py b/mlos_viz/mlos_viz/tests/conftest.py index 687fb05974f..6bfc73de1ab 100644 --- a/mlos_viz/mlos_viz/tests/conftest.py +++ b/mlos_viz/mlos_viz/tests/conftest.py @@ -4,6 +4,7 @@ # """Export test fixtures for mlos_viz.""" +from logging import warning from pathlib import Path import glob import os @@ -29,11 +30,14 @@ os.environ["TCL_LIBRARY"] = str( Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tcl*", "init.tcl"))[0]).parent ) + warning(f"""Setting TCL_LIBRARY to {os.environ["TCL_LIBRARY"]}""") if "TK_LIBRARY" not in os.environ: os.environ["TK_LIBRARY"] = str( Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tk*", "pkgIndex.tcl"))[0]).parent ) + warning(f"""Setting TK_LIBRARY to {os.environ["TK_LIBRARY"]}""") if "TIX_LIBRARY" not in os.environ: os.environ["TIX_LIBRARY"] = str( Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tix*", "pkgIndex.tcl"))[0]).parent ) + warning(f"""Setting TIX_LIBRARY to {os.environ["TIX_LIBRARY"]}""") From 8e9384ecdf8305fcaa31fc73abaa6e335eb670f1 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 20:20:16 -0500 Subject: [PATCH 4/9] try and set some environment variables in the ci/cd pipeline --- .github/workflows/windows.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7af33611f27..e7601864bb9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -101,6 +101,12 @@ jobs: run: | if (! (conda env list | Select-String -Pattern "^$env:CONDA_ENV_NAME ") ) { conda env create -v -n $env:CONDA_ENV_NAME -f conda-envs/$env:CONDA_ENV_YML } conda env update -v -n $env:CONDA_ENV_NAME -f conda-envs/$env:CONDA_ENV_YML --prune + $TCL_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'init.tcl' | Select-Object -First 1 | Select-Object -ExpandProperty Directory | Select-Object -ExpandProperty FullName) + "TCL_LIBRARY=$TCL_LIBRARY" >> $env:GITHUB_ENV + $TK_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty Directory | Where-Object -Property Name -Like 'tk*' | Select-Object -ExpandProperty FullName) + "TK_LIBRARY=$TK_LIBRARY" >> $env:GITHUB_ENV + $TIX_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty Directory | Where-Object -Property Name -Like 'tix*' | Select-Object -ExpandProperty FullName) + "TIX_LIBRARY=$TIX_LIBRARY" >> $env:GITHUB_ENV - name: Log conda info run: | @@ -111,8 +117,11 @@ jobs: - name: Log TCL path run: | - Get-ChildItem -Recurse Env: - Get-ChildItem -Path ${{ env.CONDA }}/envs/mlos -Recurse -Filter '*tcl*' | Select-Object -ExpandProperty FullName + Get-Item Env:TCL_LIBRARY + Get-Item Env:TK_LIBRARY + Get-Item Env:TIX_LIBRARY + Get-ChildItem -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'init.tcl' | Select-Object -ExpandProperty FullName + Get-ChildItem -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty FullName # This is moreso about code cleanliness, which is a dev thing, not a # functionality thing, and the rules for that change between python versions, From 923cae2f5869fc7972a89f9d8c7192784ed171b8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 01:20:44 +0000 Subject: [PATCH 5/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- mlos_viz/mlos_viz/tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlos_viz/mlos_viz/tests/conftest.py b/mlos_viz/mlos_viz/tests/conftest.py index 6bfc73de1ab..540d7d2daec 100644 --- a/mlos_viz/mlos_viz/tests/conftest.py +++ b/mlos_viz/mlos_viz/tests/conftest.py @@ -4,11 +4,11 @@ # """Export test fixtures for mlos_viz.""" -from logging import warning -from pathlib import Path import glob import os import sys +from logging import warning +from pathlib import Path from mlos_bench.tests import tunable_groups_fixtures from mlos_bench.tests.storage.sql import fixtures as sql_storage_fixtures From 8aa83f05863b84cf8f5afd9561ba0233166b892b Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 21:05:36 -0500 Subject: [PATCH 6/9] refactor and fixup --- mlos_viz/mlos_viz/tests/conftest.py | 45 +++++++++++++++++++---------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/mlos_viz/mlos_viz/tests/conftest.py b/mlos_viz/mlos_viz/tests/conftest.py index 540d7d2daec..955a4f86629 100644 --- a/mlos_viz/mlos_viz/tests/conftest.py +++ b/mlos_viz/mlos_viz/tests/conftest.py @@ -4,9 +4,9 @@ # """Export test fixtures for mlos_viz.""" -import glob import os import sys +from glob import glob from logging import warning from pathlib import Path @@ -26,18 +26,31 @@ # See Also: https://github.com/python/cpython/issues/111754 if sys.platform == "win32": # Fix Tcl/Tk folder - if "TK_LIBRARY" not in os.environ: - os.environ["TCL_LIBRARY"] = str( - Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tcl*", "init.tcl"))[0]).parent - ) - warning(f"""Setting TCL_LIBRARY to {os.environ["TCL_LIBRARY"]}""") - if "TK_LIBRARY" not in os.environ: - os.environ["TK_LIBRARY"] = str( - Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tk*", "pkgIndex.tcl"))[0]).parent - ) - warning(f"""Setting TK_LIBRARY to {os.environ["TK_LIBRARY"]}""") - if "TIX_LIBRARY" not in os.environ: - os.environ["TIX_LIBRARY"] = str( - Path(glob.glob(os.path.join(sys.base_prefix, "tcl", "tix*", "pkgIndex.tcl"))[0]).parent - ) - warning(f"""Setting TIX_LIBRARY to {os.environ["TIX_LIBRARY"]}""") + tcl_path_info = { + "TCL_LIBRARY": ["tcl*", "init.tcl"], + "TK_LIBRARY": ["tk*", "pkgIndex.tcl"], + "TIX_LIBRARY": ["tix*", "pkgIndex.tcl"], + } + for env_var, (subdir_pattern, file_name) in tcl_path_info.items(): + if env_var not in os.environ: + try: + os.environ[env_var] = str( + Path( + next( + iter( + glob( + os.path.join( + sys.base_prefix, + "Library", + "lib", + subdir_pattern, + file_name, + ) + ) + ) + ) + ).parent + ) + warning(f"""Setting {env_var} to {os.environ[env_var]}""") + except StopIteration: + warning(f"{env_var} not found, some Tcl/Tk functionality may be limited.") From 6b52329c65fa7a8e571dcf922e090567618673d2 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 21:11:16 -0500 Subject: [PATCH 7/9] disabled in favor of python method --- .github/workflows/windows.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e7601864bb9..beeff6ed4ee 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -102,11 +102,13 @@ jobs: if (! (conda env list | Select-String -Pattern "^$env:CONDA_ENV_NAME ") ) { conda env create -v -n $env:CONDA_ENV_NAME -f conda-envs/$env:CONDA_ENV_YML } conda env update -v -n $env:CONDA_ENV_NAME -f conda-envs/$env:CONDA_ENV_YML --prune $TCL_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'init.tcl' | Select-Object -First 1 | Select-Object -ExpandProperty Directory | Select-Object -ExpandProperty FullName) - "TCL_LIBRARY=$TCL_LIBRARY" >> $env:GITHUB_ENV $TK_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty Directory | Where-Object -Property Name -Like 'tk*' | Select-Object -ExpandProperty FullName) - "TK_LIBRARY=$TK_LIBRARY" >> $env:GITHUB_ENV $TIX_LIBRARY=(Get-ChildItem -Path "$env:CONDA/envs/$env:CONDA_ENV_NAME/Library/lib" -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty Directory | Where-Object -Property Name -Like 'tix*' | Select-Object -ExpandProperty FullName) - "TIX_LIBRARY=$TIX_LIBRARY" >> $env:GITHUB_ENV + # Omitted from environment variables for now, but can re-enable if needed. + # See Also: mlos_viz/tests/conftest.py + #"TCL_LIBRARY=$TCL_LIBRARY" >> $env:GITHUB_ENV + #"TK_LIBRARY=$TK_LIBRARY" >> $env:GITHUB_ENV + #"TIX_LIBRARY=$TIX_LIBRARY" >> $env:GITHUB_ENV - name: Log conda info run: | From 8dbaa5182e35cd664f301f3de9fe026fc29bcfeb Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 21:37:13 -0500 Subject: [PATCH 8/9] ignore errors --- .github/workflows/windows.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index beeff6ed4ee..a23aef95ab4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -119,11 +119,11 @@ jobs: - name: Log TCL path run: | - Get-Item Env:TCL_LIBRARY - Get-Item Env:TK_LIBRARY - Get-Item Env:TIX_LIBRARY - Get-ChildItem -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'init.tcl' | Select-Object -ExpandProperty FullName - Get-ChildItem -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty FullName + Get-Item -ErrorAction Ignore Env:TCL_LIBRARY + Get-Item -ErrorAction Ignore Env:TK_LIBRARY + Get-Item -ErrorAction Ignore Env:TIX_LIBRARY + Get-ChildItem -ErrorAction Ignore -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'init.tcl' | Select-Object -ExpandProperty FullName + Get-ChildItem -ErrorAction Ignore -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty FullName # This is moreso about code cleanliness, which is a dev thing, not a # functionality thing, and the rules for that change between python versions, From b423b95983a99605091d6ea821f7a18fe462a96e Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Wed, 22 Oct 2025 21:38:53 -0500 Subject: [PATCH 9/9] show the error still --- .github/workflows/windows.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a23aef95ab4..fde76116782 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -119,11 +119,11 @@ jobs: - name: Log TCL path run: | - Get-Item -ErrorAction Ignore Env:TCL_LIBRARY - Get-Item -ErrorAction Ignore Env:TK_LIBRARY - Get-Item -ErrorAction Ignore Env:TIX_LIBRARY - Get-ChildItem -ErrorAction Ignore -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'init.tcl' | Select-Object -ExpandProperty FullName - Get-ChildItem -ErrorAction Ignore -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty FullName + Get-Item -ErrorAction Continue Env:TCL_LIBRARY + Get-Item -ErrorAction Continue Env:TK_LIBRARY + Get-Item -ErrorAction Continue Env:TIX_LIBRARY + Get-ChildItem -ErrorAction Continue -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'init.tcl' | Select-Object -ExpandProperty FullName + Get-ChildItem -ErrorAction Continue -Path ${{ env.CONDA }}/envs/$env:CONDA_ENV_NAME -Recurse -Filter 'pkgIndex.tcl' | Select-Object -ExpandProperty FullName # This is moreso about code cleanliness, which is a dev thing, not a # functionality thing, and the rules for that change between python versions,