Skip to content

Conversation

@vadorovsky
Copy link
Contributor

Include llvm-libunwind and libcxx in the LLVM-based cross environments,
so they are fully ready to build any package.

@vadorovsky vadorovsky marked this pull request as draft November 11, 2024 23:26
@@ -0,0 +1,55 @@
name: CI
Copy link
Member

Choose a reason for hiding this comment

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

Nice! I think @Arniiiii is interested in doing some work on this as well.

@vadorovsky
Copy link
Contributor Author

Depends on gentoo/gentoo#39280

@thesamesam I added a GitHub Actions workflow which should be able to test crossdev. But it seems like actions need to be enabled for this repo.

@thesamesam
Copy link
Member

I think it'll Just Work once it's merged.

@vadorovsky
Copy link
Contributor Author

Usually when I'm adding workflows to new repos, they start executing already in the PR introducing them. I would double-check if there is any setting to enable.

But if that doesn't work, I can try making an another PR, where I could start with testing GNU targets.

@vadorovsky vadorovsky marked this pull request as ready for review November 11, 2024 23:56
@vadorovsky vadorovsky marked this pull request as draft November 11, 2024 23:56
@thesamesam
Copy link
Member

Checking the settings is awkward because of how we have things setup. But right now, it looks to me the same as every other repo we have in gentoo. Please do make that other PR and I'll merge it.

@Arniiiii
Copy link

Depends on gentoo/gentoo#39280

@thesamesam I added a GitHub Actions workflow which should be able to test crossdev. But it seems like actions need to be enabled for this repo.

AFAIK you can enable GitHub actions for your fork somewhere in settings of your fork.

Nice! I think @Arniiiii is interested in doing some work on this as well.

Definitely ! Thanks for mentioning!

In current upstream we see checking next setups:
- aarch64-unknown-linux-gnu on openrc+gcc+glibc
- aarch64-unknown-linux-gnu on openrc+gcc+musl
- aarch64-unknown-linux-musl on openrc+gcc+glibc
- aarch64-unknown-linux-musl on openrc+gcc+musl

I think this is small amount of setups. Even your work on enabling cross-compiling with llvm via the crossdev script is not checked.

I guess there's a small problem with automatic testing of the project: checking valuable amount of targets requires a lot of time. I wrote a bash script for all of this, you can check at my fork: https://github.com/Arniiiii/crossdev/blob/master/test.bash . It took on a laptop with Intel's i7-13700HX at 4-5 GHz around 600 mins IIRC.

Now there's a problem: GitHub allows only 2000 mins of Linux CI/CD per month per user.

So only 1,2 or maybe 3 such checks can be done per month per user. That's not good.

AFAIK there's a relatively newly added feature in GitHub called self-hosted runners. Gitea, Forgejo, Gitlab have this feature and I can confirm it works there, but I haven't setup it on GitHub yet.

In a week or in a month I can provide a laptop with znver2 CPU with 12 threads and 16GB as a self-hosted runner. It can solve the problem at least partially. I guess after this it would be logically to consider what targets going to be checked and when ( at push or at merge or whenever).

@vadorovsky
Copy link
Contributor Author

@Arniiiii check out this PR #28 - I'm adding more architectures there. And we could discuss the details about CI there. 🙂

I don't think there is a limit of 2000 hours per month for free repos, or at least I wasn't able to find any information about that. According to https://docs.github.com/en/actions/administering-github-actions/usage-limits-billing-and-administration#usage-limits, the only limitation relevant to us is 6h limit per job - which we are not exceeding in any case so far.

@Arniiiii
Copy link

Arniiiii commented Nov 20, 2024

I don't think there is a limit of 2000 hours per month for free repos, or at least I wasn't able to find any information about that. According to https://docs.github.com/en/actions/administering-github-actions/usage-limits-billing-and-administration#usage-limits, the only limitation relevant to us is 6h limit per job - which we are not exceeding in any case so far.

Indeed. I was misled by their documentation at a github's CI/CD documentation page.

It seems for public repositories there's no such limit.

Then it seems that the only problem is to write a good enough CI script

@Arniiiii check out this PR #28 - I'm adding more architectures there. And we could discuss the details about CI there. 🙂

Indeed. I see you did a good job. I'm currently busy, maybe next weekends I can take a better look at what else can be done.

@vadorovsky vadorovsky force-pushed the full-llvm-toolchain branch 9 times, most recently from 71e83e5 to b83987f Compare November 29, 2024 10:39
@thesamesam
Copy link
Member

The CI failure at https://github.com/gentoo/crossdev/actions/runs/12083265774/job/33696034437?pr=24#step:3:3479 is really odd:

 >>> Emerging (3 of 9) dev-libs/libunistring-1.3::gentoo for /usr/aarch64-unknown-linux-gnu/
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
!!! Fetched file: libunistring-1.3.tar.xz VERIFY FAILED!
!!! Reason: Insufficient data for checksum verification
!!! Got:      
!!! Expected: BLAKE2B BLAKE2S MD5 RMD160 SHA1 SHA256 SHA3_256 SHA3_512 SHA512 WHIRLPOOL

>>> Failed to emerge dev-libs/libunistring-1.3 for /usr/aarch64-unknown-linux-gnu/, Log file:

I don't see how that can happen unless the tree is broken, but it wasn't. I committed that ebuild in 1e31a6372a27b3d2508a5b9fd357cc23b320989d and the Manifest was there, and nothing changed afterwards either.

@vadorovsky
Copy link
Contributor Author

I'm wondering if it has something to do to the fact I'm fetching my custom branch from github here:

# FIXME(vadorovsky): Remove once https://github.com/gentoo/gentoo/pull/39280 is
# merged.
run_in_container bash -c "curl -L https://github.com/vadorovsky/gentoo/archive/cross-llvm.tar.gz | tar -xzf - --strip-components 1 -C /var/db/repos/gentoo"

I'm doing this to test my changes from gentoo/gentoo#39280 - it contains the necessary changes to bootstrap the full LLVM toolchain with crossdev.

Let my try rebasing my branch, but I still don't understand the error. It would mean that this ebuild is somehow broken on my branch.

I'm wondering if I have to do something else apart from unpacking the tarball to /var/db/repos/gentoo.

@thesamesam
Copy link
Member

emerge-webrsync will use non-thin manifests, whereas yours will use thin.

@vadorovsky
Copy link
Contributor Author

I see. Any ideas how to use my branch correctly then? I would like to avoid emerging git and eselect-repository. But if it's really necessary, I can follow https://wiki.gentoo.org/wiki/Portage_with_Git

@thesamesam
Copy link
Member

I don't have a particularly good idea for now. Maybe have the CI script fetch from https://github.com/gentoo-mirror/gentoo (as a tarball) for now.

@vadorovsky
Copy link
Contributor Author

But baselayout doesn't do it for all systems. It does it when USE=-split-usr.

You probably need to add a --merged-usr flag to crossdev or perhaps better to just copy the host layout (but allowing an override may be a good idea if people want to bootstrap a non-merged-usr layout).

Good point. I will handle that in a separate PR.

@thesamesam
Copy link
Member

See #32 as well ofc.

@vadorovsky vadorovsky force-pushed the full-llvm-toolchain branch 5 times, most recently from 7355030 to 9039dc3 Compare September 15, 2025 06:54
@vadorovsky vadorovsky marked this pull request as ready for review September 15, 2025 07:55
@vadorovsky vadorovsky marked this pull request as draft September 16, 2025 06:19
Include llvm-libunwind and libcxx in the LLVM-based cross environments,
so they are fully ready to build any package.

Signed-off-by: Michal Rostecki <[email protected]>
@vadorovsky vadorovsky force-pushed the full-llvm-toolchain branch 2 times, most recently from cc34713 to 3ca3d30 Compare September 16, 2025 13:13
@vadorovsky vadorovsky closed this Sep 16, 2025
@vadorovsky vadorovsky reopened this Sep 16, 2025
That way we make sure that stage3 is up-to-date.

Signed-off-by: Michal Rostecki <[email protected]>
Add --llvm argument to the container_test.sh script. Use it on CI in
combination with the llvm stage3 image.

Signed-off-by: Michal Rostecki <[email protected]>
@vadorovsky vadorovsky marked this pull request as ready for review September 18, 2025 15:48
@vadorovsky
Copy link
Contributor Author

@thesamesam Finally, all jobs are green and the PR is ready for review

@vadorovsky
Copy link
Contributor Author

@alfredfo @thesamesam Sorry for pinging again. Does this PR look good to you? Given that the LLVM support is broken on master (it's practically impossible to bootstrap a sysroot capable of building any package) and the CI is green, it would be nice if we can get this in.

@alfredfo
Copy link
Contributor

alfredfo commented Oct 7, 2025

@vadorovsky looks good but haven't tested, I'd wait for Sam :)

gentoo-bot pushed a commit that referenced this pull request Oct 8, 2025
Include llvm-libunwind and libcxx in the LLVM-based cross environments,
so they are fully ready to build any package.

Bug: https://bugs.gentoo.org/915048
Closes: https://bugs.gentoo.org/941140
Closes: https://bugs.gentoo.org/942214
Signed-off-by: Michal Rostecki <[email protected]>
Part-of: #24
Signed-off-by: Sam James <[email protected]>
gentoo-bot pushed a commit that referenced this pull request Oct 8, 2025
That way we make sure that stage3 is up-to-date.

Signed-off-by: Michal Rostecki <[email protected]>
Part-of: #24
Signed-off-by: Sam James <[email protected]>
@gentoo-bot gentoo-bot closed this in 2a853ce Oct 8, 2025
@thesamesam
Copy link
Member

Thanks! Merged with some Bug tags added.

vadorovsky added a commit to exein-io/icedragon that referenced this pull request Oct 24, 2025
It supports full bootstrap of musl-llvm sysroots without any additional
hacks, see: gentoo/crossdev#24
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