Skip to content

Conversation

@cbalint13
Copy link
Contributor

@cbalint13 cbalint13 commented Aug 28, 2025

This PR adds the missing URL for cmake's extrenal project (auto)-builder for libbacktrace.
Not sure about releng FFI intention/migration, but I added the last seen upstream URL in PR#18226


  • The error message, when the local system does not have a pre-installed libbacktrace:
-- Git found: /usr/bin/git
-- Found TVM_GIT_COMMIT_HASH=335bc164b2539e18523e82c53f2808f184ec0ae2
-- Found TVM_GIT_COMMIT_TIME=2025-08-27 20:27:50 -0700
-- CMAKC_C_COMPILER="/usr/bin/gcc"
CMake Error at /usr/share/cmake/Modules/ExternalProject/shared_internal_commands.cmake:1323 (message):
  No download info given for 'project_libbacktrace' and its source directory:

   /home/cbalint/rpmbuild/BUILD/tvm-0.21.0-build/tvm/ffi/cmake/Utils/../../3rdparty/libbacktrace

  is not an existing non-empty directory.  Please specify one of:

   * SOURCE_DIR with an existing non-empty directory
   * DOWNLOAD_COMMAND
   * URL
   * GIT_REPOSITORY
   * SVN_REPOSITORY
   * HG_REPOSITORY
   * CVS_REPOSITORY and CVS_MODULE
Call Stack (most recent call first):
  /usr/share/cmake/Modules/ExternalProject.cmake:3041 (_ep_add_download_command)
  ffi/cmake/Utils/AddLibbacktrace.cmake:34 (ExternalProject_Add)
  ffi/cmake/Utils/AddLibbacktrace.cmake:67 (_libbacktrace_compile)
  ffi/CMakeLists.txt:29 (include)

UPDATE:

Due to MaCOS CI failure, replaced to uptream repo latest instead (repushed this PR).
Seems that upstream libbacktrace already contain the single patch from tlc-pack.

[ 95%] No patch step for 'project_libbacktrace'
[ 95%] Performing configure step for 'project_libbacktrace'
Invalid configuration `arm64-apple-darwin20.0.0': machine `arm64-apple' not recognized

@cbalint13 cbalint13 force-pushed the ffi-libbacktrace-git-url branch from fdf72c1 to 95da9f6 Compare August 28, 2025 12:42
@cbalint13
Copy link
Contributor Author

At this point (CI not fully finished) MACOS is green now with upstream backtrace.
I cross reference this with efforts in #18239 .

@cbalint13 cbalint13 merged commit dd1e3f8 into apache:main Aug 28, 2025
17 of 18 checks passed
@cbalint13 cbalint13 deleted the ffi-libbacktrace-git-url branch August 28, 2025 14:54
@tqchen
Copy link
Member

tqchen commented Aug 28, 2025

actually we may not need this as long as the bakctrace is intialize by git submodule update --init

@cbalint13
Copy link
Contributor Author

cbalint13 commented Aug 28, 2025

@tqchen

actually we may not need this as long as the bakctrace is intialize by git submodule update --init

It looked (and still looks) gone for me, like this:

$ git clone --depth 1 https://github.com/apache/tvm tvm.test
{...}
Receiving objects: 100% (4029/4029), 7.46 MiB | 12.91 MiB/s, done.
Resolving deltas: 100% (1008/1008), done.

$ cd tvm.test
$ git submodule update --init --depth 1 3rdparty/libbacktrace
error: pathspec '3rdparty/libbacktrace' did not match any file(s) known to git

Ahh, it changed home (i did not noticed this) ...

$ git submodule update --init | grep libbacktrace
Cloning into '/home/cbalint/work/GITHUB/tvm.test/ffi/3rdparty/libbacktrace'...

I am sorry then, you are right !

I maintain since 4-5 years aautomated rpm packagebuild that use that path desribed earlier (selective explicit path):
https://download.copr.fedorainfracloud.org/results/rezso/ML/fedora-rawhide-x86_64/09460091-tvm/tvm.spec


But beside that, if we now reached here accidentally (and fixed MacOS build) IMHO it is easier and cleaner to maintain from cmake "way" than from "git submodule" way. The advantage with cmake is that it can download source conditionally on the case it cannot be found locally (precompiled).

This can be reverted if you decide.

@tqchen
Copy link
Member

tqchen commented Aug 28, 2025

one issue was that the autodownload can cause issues for repeated compilation (@MasterJH5574 reported that even if there is no source change, libbacktrace may get recompiled). also when we ship pip ideally there should be not extra download. would be good to revert this for now.

@tqchen
Copy link
Member

tqchen commented Aug 28, 2025

but it is probbaly good idea to update libbacktrace to use upstream instead in git submodule

MasterJH5574 added a commit that referenced this pull request Aug 28, 2025
MasterJH5574 pushed a commit that referenced this pull request Aug 29, 2025
* Revert the URL out from cmake for libbacktrace
* Switch git submodule to upstream HEAD instead

As per discussed here #18246 (comment),
this reverts in favour of git submodule way.

As per finding in the same discuss the upstream [already](https://github.com/ianlancetaylor/libbacktrace/blob/793921876c981ce49759114d7bb89bb89b2d3a2d/macho.c#L1273-L1275) incorporates [the one patch](ianlancetaylor/libbacktrace@master...tlc-pack:libbacktrace:master) used, and MacOS works fine.
tqchen pushed a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
…he#18249)

* Revert the URL out from cmake for libbacktrace
* Switch git submodule to upstream HEAD instead

As per discussed here apache#18246 (comment),
this reverts in favour of git submodule way.

As per finding in the same discuss the upstream [already](https://github.com/ianlancetaylor/libbacktrace/blob/793921876c981ce49759114d7bb89bb89b2d3a2d/macho.c#L1273-L1275) incorporates [the one patch](ianlancetaylor/libbacktrace@master...tlc-pack:libbacktrace:master) used, and MacOS works fine.
tqchen pushed a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
…he#18249)

* Revert the URL out from cmake for libbacktrace
* Switch git submodule to upstream HEAD instead

As per discussed here apache#18246 (comment),
this reverts in favour of git submodule way.

As per finding in the same discuss the upstream [already](https://github.com/ianlancetaylor/libbacktrace/blob/793921876c981ce49759114d7bb89bb89b2d3a2d/macho.c#L1273-L1275) incorporates [the one patch](ianlancetaylor/libbacktrace@master...tlc-pack:libbacktrace:master) used, and MacOS works fine.
tqchen pushed a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
tqchen pushed a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
…he#18249)

* Revert the URL out from cmake for libbacktrace
* Switch git submodule to upstream HEAD instead

As per discussed here apache#18246 (comment),
this reverts in favour of git submodule way.

As per finding in the same discuss the upstream [already](https://github.com/ianlancetaylor/libbacktrace/blob/793921876c981ce49759114d7bb89bb89b2d3a2d/macho.c#L1273-L1275) incorporates [the one patch](ianlancetaylor/libbacktrace@master...tlc-pack:libbacktrace:master) used, and MacOS works fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants