From f329f3e572e8c5673a0f2d348e1ea7688d766619 Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Mon, 12 Aug 2024 10:52:53 -0500 Subject: [PATCH 1/6] Debug, list configs in base conda environment --- .github/actions/setup/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 40ddf4f90678..1ec9069ca8e1 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -33,3 +33,5 @@ runs: run: | conda info conda list + conda info --envs + conda list --name base From 1ff7b87e5c58c9cbc3911217df1c519f4af582fe Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Mon, 12 Aug 2024 11:19:12 -0500 Subject: [PATCH 2/6] Add the "auto-update-conda: true" flag for miniconda setup It looks like the base environment provides `conda==24.5.0`, but the `tvm-build` environment only provides `conda==23.9.0`, and the error in `cargo build` is triggered from within the `tvm-build` environment. Seeing if it just needs to be allowed to update to a newer `conda` version. --- .github/actions/setup/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 1ec9069ca8e1..403db57ac3c2 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -15,6 +15,7 @@ runs: channel-priority: strict environment-file: conda/build-environment.yaml auto-activate-base: false + auto-update-conda: true use-only-tar-bz2: true python-version: 3.9 condarc-file: conda/condarc @@ -25,6 +26,7 @@ runs: channel-priority: strict environment-file: conda/build-environment.yaml auto-activate-base: false + auto-update-conda: true use-only-tar-bz2: true python-version: 3.9 condarc-file: conda/condarc From 182a8bbf4f36a688febe0ea81deddf40c1408047 Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Mon, 12 Aug 2024 11:32:32 -0500 Subject: [PATCH 3/6] Attempt bumping the required conda version The `conda-build` package specifies compatibility with `conda >= 23.7`, but the `libmamba` requirement requirement isn't provided until `23.10`. Possibly an incompatibility, where the default solver is decided based on the base environment's `conda` version, but the availability is based on the `tvm-build` environment. --- conda/build-environment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/build-environment.yaml b/conda/build-environment.yaml index 8eb25ce01ac7..41cedd892455 100644 --- a/conda/build-environment.yaml +++ b/conda/build-environment.yaml @@ -26,6 +26,7 @@ channels: # The packages to install to the environment dependencies: - python=3.9 + - conda >= 23.10 - conda-build - git - llvmdev >=11 From b5752c25096bd18b3a186ef9f552ac31361c4492 Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Mon, 12 Aug 2024 12:47:41 -0500 Subject: [PATCH 4/6] Try adding "conda-solver: classic" Since libmamba isn't available inside the generated environment --- .github/actions/setup/action.yml | 4 ++-- conda/build-environment.yaml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 403db57ac3c2..6fd81c1d6903 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -15,7 +15,7 @@ runs: channel-priority: strict environment-file: conda/build-environment.yaml auto-activate-base: false - auto-update-conda: true + conda-solver: classic use-only-tar-bz2: true python-version: 3.9 condarc-file: conda/condarc @@ -26,7 +26,7 @@ runs: channel-priority: strict environment-file: conda/build-environment.yaml auto-activate-base: false - auto-update-conda: true + conda-solver: classic use-only-tar-bz2: true python-version: 3.9 condarc-file: conda/condarc diff --git a/conda/build-environment.yaml b/conda/build-environment.yaml index 41cedd892455..8eb25ce01ac7 100644 --- a/conda/build-environment.yaml +++ b/conda/build-environment.yaml @@ -26,7 +26,6 @@ channels: # The packages to install to the environment dependencies: - python=3.9 - - conda >= 23.10 - conda-build - git - llvmdev >=11 From 045fb7dce0a1e6313e0ec8b09fb82961720c4fa2 Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Thu, 15 Aug 2024 11:45:02 -0500 Subject: [PATCH 5/6] Exit on cmake failure in Windows build --- conda/recipe/install_libtvm.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipe/install_libtvm.bat b/conda/recipe/install_libtvm.bat index f423c521f84e..c3715648cc5c 100644 --- a/conda/recipe/install_libtvm.bat +++ b/conda/recipe/install_libtvm.bat @@ -15,7 +15,7 @@ :: specific language governing permissions and limitations :: under the License. -cmake --build build --config Release --target install +cmake --build build --config Release --target install || exit /b :: Copy files into library bin so that they can be found cp %LIBRARY_LIB%\tvm.dll %LIBRARY_BIN%\tvm.dll From 34aa52385eb50bb51ed7ba4a9ccad8225b92328e Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Thu, 15 Aug 2024 13:36:04 -0500 Subject: [PATCH 6/6] Exit on first error for Windows conda build From what I can tell, batch scripts do not have an equivalent to `set -e`, so this needs to be added to every command in the batch scripts. --- conda/build_win.bat | 4 +++- conda/recipe/bld.bat | 2 +- conda/recipe/install_libtvm.bat | 6 ++++-- conda/recipe/install_tvm_python.bat | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/conda/build_win.bat b/conda/build_win.bat index 59d0d07340c7..e37a06ce7c05 100644 --- a/conda/build_win.bat +++ b/conda/build_win.bat @@ -15,4 +15,6 @@ :: specific language governing permissions and limitations :: under the License. -conda build --output-folder=conda/pkg conda/recipe +echo on + +conda build --output-folder=conda/pkg conda/recipe || exit /b diff --git a/conda/recipe/bld.bat b/conda/recipe/bld.bat index f8988b135793..561dcff87802 100644 --- a/conda/recipe/bld.bat +++ b/conda/recipe/bld.bat @@ -32,7 +32,7 @@ cmake ^ -DUSE_RANDOM=ON ^ -DUSE_PROFILER=ON ^ -DINSTALL_DEV=ON ^ - %SRC_DIR% + %SRC_DIR% || exit /b cd .. :: defer build to install stage to avoid rebuild. diff --git a/conda/recipe/install_libtvm.bat b/conda/recipe/install_libtvm.bat index c3715648cc5c..c56f83bfaaef 100644 --- a/conda/recipe/install_libtvm.bat +++ b/conda/recipe/install_libtvm.bat @@ -15,8 +15,10 @@ :: specific language governing permissions and limitations :: under the License. +echo on + cmake --build build --config Release --target install || exit /b :: Copy files into library bin so that they can be found -cp %LIBRARY_LIB%\tvm.dll %LIBRARY_BIN%\tvm.dll -cp %LIBRARY_LIB%\tvm_runtime.dll %LIBRARY_BIN%\tvm_runtime.dll +cp %LIBRARY_LIB%\tvm.dll %LIBRARY_BIN%\tvm.dll || exit /b +cp %LIBRARY_LIB%\tvm_runtime.dll %LIBRARY_BIN%\tvm_runtime.dll || exit /b diff --git a/conda/recipe/install_tvm_python.bat b/conda/recipe/install_tvm_python.bat index 96187468c2b2..07c0465b8443 100644 --- a/conda/recipe/install_tvm_python.bat +++ b/conda/recipe/install_tvm_python.bat @@ -16,5 +16,5 @@ :: under the License. echo on -cd %SRC_DIR%\python -%PYTHON% setup.py install --single-version-externally-managed --record=%SRC_DIR%\record.txt +cd %SRC_DIR%\python || exit /b +%PYTHON% setup.py install --single-version-externally-managed --record=%SRC_DIR%\record.txt || exit /b