This is an automated email from the ASF dual-hosted git repository.

spectrometerHBH pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 57cbc5eeed [REFACTOR] Phase out unreachable contrib/rust_extension.cc 
(#19458)
57cbc5eeed is described below

commit 57cbc5eeed833db34f3e64a57eb5a5c13fc3cd3a
Author: Tianqi Chen <[email protected]>
AuthorDate: Mon Apr 27 16:38:33 2026 -0400

    [REFACTOR] Phase out unreachable contrib/rust_extension.cc (#19458)
    
    This commit removes `src/contrib/rust_extension.cc`, a 32-line file
    whose entire body is wrapped in `#ifdef RUST_COMPILER_EXT` — a macro
    defined nowhere in the tree, making the file's contents unreachable in
    any build configuration. The orphaned `USE_RUST_EXT` cmake option (no
    longer gates anything after `cmake/modules/RustExt.cmake` was previously
    removed) is also removed from CMakeLists.txt, LibInfo.cmake, and
    libinfo.cc.
    
    ## Test plan
    - [x] Reconfigure and rebuild: `cmake -G Ninja` + `ninja -j$(nproc)` (no
    errors expected)
    - [x] Verify symbols: confirm `libtvm.so` and `libtvm_runtime.so` link
    without unresolved references
    - [x] Smoke test: `tests/python/all-platform-minimal-test/` (~75 tests,
    ~0.3s)
    - [x] Linting: `pre-commit run --all-files`
---
 CMakeLists.txt                |  1 -
 cmake/modules/LibInfo.cmake   |  1 -
 src/contrib/rust_extension.cc | 31 -------------------------------
 src/support/libinfo.cc        |  1 -
 4 files changed, 34 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a8b1ab72b..f75f5b6e73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,7 +95,6 @@ tvm_option(USE_NNAPI_CODEGEN "Build with NNAPI Codegen 
support" OFF)
 tvm_option(USE_NNAPI_RUNTIME "Build with NNAPI runtime" OFF)
 tvm_option(USE_EXAMPLE_NPU_CODEGEN "Build with Example NPU Codegen support" 
OFF)
 tvm_option(USE_EXAMPLE_NPU_RUNTIME "Build with Example NPU runtime" OFF)
-tvm_option(USE_RUST_EXT "Build with Rust based compiler extensions, STATIC, 
DYNAMIC, or OFF" OFF)
 tvm_option(SUMMARIZE "Print CMake option summary after configuring" OFF)
 tvm_option(USE_CLML "Build with CLML Codegen support" OFF)
 tvm_option(USE_CLML_GRAPH_EXECUTOR "Build with CLML graph runtime" OFF)
diff --git a/cmake/modules/LibInfo.cmake b/cmake/modules/LibInfo.cmake
index e98c5b27c0..5c1286e0b5 100644
--- a/cmake/modules/LibInfo.cmake
+++ b/cmake/modules/LibInfo.cmake
@@ -94,7 +94,6 @@ function(add_lib_info src_file)
     TVM_INFO_USE_RPC="${USE_RPC}"
     TVM_INFO_TVM_BUILD_PYTHON_MODULE="${TVM_BUILD_PYTHON_MODULE}"
     TVM_INFO_USE_RTTI="${USE_RTTI}"
-    TVM_INFO_USE_RUST_EXT="${USE_RUST_EXT}"
     TVM_INFO_USE_SORT="${USE_SORT}"
     
TVM_INFO_USE_SPIRV_KHR_INTEGER_DOT_PRODUCT="${USE_SPIRV_KHR_INTEGER_DOT_PRODUCT}"
     TVM_INFO_USE_TENSORRT_CODEGEN="${USE_TENSORRT_CODEGEN}"
diff --git a/src/contrib/rust_extension.cc b/src/contrib/rust_extension.cc
deleted file mode 100644
index 46e94fffdf..0000000000
--- a/src/contrib/rust_extension.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*!
- * \file src/contrib/rust_extension.cc
- * \brief Expose Rust extensions initialization.
- */
-#ifdef RUST_COMPILER_EXT
-
-extern "C" {
-int compiler_ext_initialize();
-static int test = compiler_ext_initialize();
-}
-
-#endif
diff --git a/src/support/libinfo.cc b/src/support/libinfo.cc
index 7aaeb37795..e3d03cf76c 100644
--- a/src/support/libinfo.cc
+++ b/src/support/libinfo.cc
@@ -294,7 +294,6 @@ TVM_DLL ffi::Map<ffi::String, ffi::String> GetLibInfo() {
       {"USE_RPC", TVM_INFO_USE_RPC},
       {"TVM_BUILD_PYTHON_MODULE", TVM_INFO_TVM_BUILD_PYTHON_MODULE},
       {"USE_RTTI", TVM_INFO_USE_RTTI},
-      {"USE_RUST_EXT", TVM_INFO_USE_RUST_EXT},
       {"USE_SORT", TVM_INFO_USE_SORT},
       {"USE_SPIRV_KHR_INTEGER_DOT_PRODUCT", 
TVM_INFO_USE_SPIRV_KHR_INTEGER_DOT_PRODUCT},
       {"USE_TENSORRT_CODEGEN", TVM_INFO_USE_TENSORRT_CODEGEN},

Reply via email to