Skip to content

libllvm: add package.#6948

Merged
star-hengxing merged 8 commits into
xmake-io:devfrom
Redbeanw44602:add/libllvm
Jun 12, 2025
Merged

libllvm: add package.#6948
star-hengxing merged 8 commits into
xmake-io:devfrom
Redbeanw44602:add/libllvm

Conversation

@Redbeanw44602
Copy link
Copy Markdown
Contributor

@Redbeanw44602 Redbeanw44602 commented Apr 20, 2025

Differs from xmake-repo/llvm

  1. This package is provided as a library, not a toolchain.
  2. Real support for 19.1.7
  3. More extensive cross-compilation support.

Packaging principles

Keep llvm-project as default as possible, that is, keep xrepo as little as possible without making choices for the user.

Should splitting packages?

I discussed splitting the package with @star-hengxing in the telegram group, but I later thought that LLVM was more like a whole, so I didn't split it. If there are more opinions, we can discuss it.

@Redbeanw44602
Copy link
Copy Markdown
Contributor Author

Redbeanw44602 commented Apr 20, 2025

Possible test failures

I have run the same tests in my own repo and based on my experience, the following test will not pass, but it actually works.

  • android (linux, ndk_r22) 4 tests failed. This version of ndk creates huge library files that fill up the disk when building, causing failures. By the way, even if you clean the runner disk space, the compilation cannot be completed. It will eventually be killed due to excessive usage. ndk r22 is really worst!
  • freebsd The compilation cannot be completed. In fact, the memory size given by xrepo to the freebsd vm is unreasonable. Ubuntu runner provides 16g of memory while freebsd only has 4g. It will be killed due to oom during tblgen. (resolved in lzma: update to 24.09 #6967)

@star-hengxing star-hengxing requested a review from Copilot May 8, 2025 08:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new package "libllvm" that provides LLVM as a library with extended cross-compilation support and real support for version 19.1.7.

  • Adds configuration and build instructions for the LLVM library package.
  • Implements cross-compilation logic for Android and iOS.
  • Provides helper functions via a new constants module to manage project and runtime library lists.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/l/libllvm/xmake.lua Introduces package configuration, dependency management, and CMake build integration.
packages/l/libllvm/constants.lua Provides helper functions to retrieve lists of LLVM-related projects and libraries.

Comment thread packages/l/libllvm/xmake.lua
Comment thread packages/l/libllvm/xmake.lua Outdated
Redbeanw44602 and others added 2 commits May 9, 2025 00:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Redbeanw44602
Copy link
Copy Markdown
Contributor Author

The import of DIA SDK (windows-only) has a little problem, waiting:
xmake-io/xmake#6452
xmake-io/xmake#6453

Comment thread packages/l/libllvm/xmake.lua Outdated
Comment thread packages/l/libllvm/xmake.lua
Comment thread packages/l/libllvm/xmake.lua Outdated
Comment thread packages/l/libllvm/xmake.lua Outdated
Comment thread packages/l/libllvm/xmake.lua Outdated
@Redbeanw44602
Copy link
Copy Markdown
Contributor Author

Can someone merge #7175 first? This saves one test.

@Redbeanw44602
Copy link
Copy Markdown
Contributor Author

Redbeanw44602 commented May 28, 2025

Looks like xmake-io/xmake@d98c1ab broke this package, we need to undefine BUILD_SHARED_LIBS.

Comment thread packages/l/libllvm/xmake.lua Outdated
@star-hengxing
Copy link
Copy Markdown
Contributor

Looks like xmake-io/xmake@d98c1ab broke this package, we need to undefine BUILD_SHARED_LIBS.

import("package.tools.cmake")

local opt = {}
opt.envs = cmake.buildenvs(package)
opt.envs.CMAKE_BUILD_TYPE = nil
cmake.install(package, configs, opt)

@Redbeanw44602
Copy link
Copy Markdown
Contributor Author

Thanks for your reply. But this doesn't seem to work, except modifying the xmake source code, we can't undefine that variable.🙁

But... I found that simply keeping BUILD_SHARED_LIBS=OFF seemed to work as expected, so now I run a test.

@Redbeanw44602
Copy link
Copy Markdown
Contributor Author

I think the package is ready to merge, all the tests failing are with code 143.

actions/runner-images#6680

@luadebug
Copy link
Copy Markdown
Member

luadebug commented Jun 3, 2025

[660/4518] This one is very huge?
I am sorry, that I am unsure that producing very long build package is okay without splitting it into smaller parts. :/

@Redbeanw44602
Copy link
Copy Markdown
Contributor Author

Redbeanw44602 commented Jun 3, 2025

[660/4518] This one is very huge?

When a job is interrupted by github, the log may not be dumped completely.

Try viewing the raw logs and you'll get:

Failed to generate URL to download logs.

So, it is hard to determine what caused the job to be interrupted. If you run it on local machine (same environment), it will succeed.

@luadebug
Copy link
Copy Markdown
Member

luadebug commented Jun 3, 2025

#7286
Github CI Worker has been promoted from win2019 to win2025.

@star-hengxing star-hengxing requested a review from waruqi June 10, 2025 07:21
@star-hengxing star-hengxing merged commit 0b513b9 into xmake-io:dev Jun 12, 2025
61 of 73 checks passed
@Redbeanw44602 Redbeanw44602 deleted the add/libllvm branch June 12, 2025 09:55
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.

4 participants