llvm-snapshots

Everything to build LLVM snapshots for Fedora/RHEL/CentOS Stream

https://github.com/fedora-llvm-team/llvm-snapshots

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary

Keywords

centos-stream clang compiler copr fedora llvm pgo rhel rpms snapshots
Last synced: 6 months ago · JSON representation ·

Repository

Everything to build LLVM snapshots for Fedora/RHEL/CentOS Stream

Basic Info
Statistics
  • Stars: 24
  • Watchers: 5
  • Forks: 11
  • Open Issues: 32
  • Releases: 2
Topics
centos-stream clang compiler copr fedora llvm pgo rhel rpms snapshots
Created about 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Citation Security

README.adoc

:toc:
:toc-placement: preamble
:sectnums:
:experimental:
:showtitle:
:homepage: https://github.com/fedora-llvm-team/llvm-snapshots

image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/fedora-copr-build.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/fedora-copr-build.yml"]
image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/check-snapshots.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/check-snapshots.yml"]
image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/python-format-and-tests.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/python-format-and-tests.yml"]
image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/update-build-time-diagrams.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/update-build-time-diagrams.yml"]
image:https://img.shields.io/badge/code%20style-black-000000.svg[link="https://github.com/psf/black"]
link:https://fedora-llvm-team.github.io/llvm-snapshots/index.html[Build time Diagrams]
image:https://coveralls.io/repos/github/fedora-llvm-team/llvm-snapshots/badge.svg[link="https://coveralls.io/github/fedora-llvm-team/llvm-snapshots"]

== Maintaining the LLVM Snapshots for Fedora
Konrad Kleine 

This document is supposed to give you an idea of what goes into maintaining the
LLVM snapshots for Fedora. Don't feel like you have read this document from top
to bottom but instead consider it a reference. There is an <> section at the botton that probably contains many
answers. Feel free to add your own there.

This is home for the generation of daily

* link:https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots/monitor/[Fedora LLVM snapshot RPMs]
** See link:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/fedora-copr-build.yml[fedora-copr-build] workflow

=== Getting the latest snapshot

We need a bit of post-configuration after enabling the copr repository for this project.

----
$ dnf -y install jq envsubst
$ dnf -y install --skip-broken 'dnf-command(copr)' 'dnf5-command(copr)'
$ dnf -y copr enable @fedora-llvm-team/llvm-snapshots
$ repo_file=$(dnf repoinfo --json *llvm-snapshots* | jq -r ".[0].repo_file_path")
$ distname=$(rpm --eval "%{?fedora:fedora}%{?rhel:rhel}") envsubst '$distname' < $repo_file > /tmp/new_repo_file
$ cat /tmp/new_repo_file > $repo_file
----

Then install `clang` or some of the other packages.

== Tips on contributing

This project uses `pre-commit` to validate that certain files (e.g. fmf or python) are not broken. Please install `pre-commit` using `pip install pre-commit` as described link:https://pre-commit.com/#install[here]. Then navigate to your clone of this project and install the git hook scripts using `cd ~/llvm-snapshots && pre-commit install`. This will run pre-commit on every `git commit`.

== Process overview [[overview]]

We build LLVM snapshots on a daily basis on Copr and create a github issue in this very repository for every day to keep track of the build and testing status. The link:https://github.com/fedora-llvm-team/llvm-snapshots/blob/816d4e061e748c82f15ca3d1c772d93814a91afe/.github/workflows/check-snapshots.yml#L40[maintainer] changes on a monthly basis and will be assigned to the issue.

For a while now we've switched from standalone builds to the building everything from a single link:https://src.fedoraproject.org/rpms/llvm/tree/rawhide[dist git repo] with the working title "big-merge" on the **Fedora Package Source**. Before we used to have one spec file repository for all the llvm subprojects (clang, lld, lldb, etc.). Now we've taken it one step further and build the snapshots directly out of the `rawhide` branch.

Our snapshot builds are done under our link:https://copr.fedorainfracloud.org/groups/g/fedora-llvm-team/coprs/[group account] on Fedora Copr. There build for all supported Fedora version and some RHEL versions.

We carefully create a new copr project for each day. These projects are called incubator projects. Only if all packages for all operating systems and architectures in an incubator project were successfully built without errors, we will promote it to be the next "official" snapshot link:https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots/[here].

For each chroot (except i386) we will also run testing-farm tests and report them in the daily issue. Some of these tests run on Red Hat internal hardware and are only reachable within the VPN. We try our best to utilize github labels to reflect the current state of builds and tests for each chroot.

NOTE: For now we "promote" a daily snapshot to the next "official" snapshot **without** having run testing-farm tests. This might change in the future.

That is the reason why sometimes it can take days until a new version of LLVM will be published here. If you're interested in the version for a particular day, feel free to open https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-big-merge-YYYYMMDD/ (replace YYYYMMDD with the date you desire). Notice, that we cannot keep the invdividual incubator projects around forever.

== Find out about the health of snapshots

Go to the Fedora Copr project and look for anything red in the monitor for today (see <>).

== How to fix an error in a package build for a specific OS/arch combination?

Suppose you want to work on the `llvm` package with nothing checkout locally, yet.

1. Export your Fedora Account System username so you can copy and paste the commands below:
+
--
----
$ export FAS_USER=
----

NOTE: This is optional and only for copy pasting the below commands. Use the username to login in here: https://id.fedoraproject.org/login.
--

2. Clone the original source code's `rawhide` branch and navigate to that directory.
+
--
----
$ fedpkg clone llvm -b rawhide ~/dev/llvm-rpms/llvm

$ cd ~/dev/llvm-rpms/llvm
----
--

3. Go to https://src.fedoraproject.org/rpms/llvm and click the "fork" button in the top-right corner to create fork just for you. Then add it as a remote:
+
----
$ git remote add $FAS_USER \
    ssh://$FAS_USER@pkgs.fedoraproject.org/forks/$FAS_USER/rpms/llvm.git
----
+
You should have two git remote now: `origin` and one that is named after your FAS login.

4. Make your changes to `llvm` and commit them locally.
+
----
$ git add -p
$ git commit -m "My changes"
----

5. Push your local changes to a branch of your liking (e.g. `mybranch`) in your fork
+
----
$ git push $FAS_USER HEAD:mybranch
----

6. Create a pull-request for your changes so they can go into the `rawhide` branch by executing this and heading over to your browser:
+
----
$ xdg-open https://src.fedoraproject.org/fork/$FAS_USER/rpms/compiler-rt/diff/rawhide..mybranch
----

7. Wait for your changes to be approved and merged. Maybe ping someone from the team.
+
Then your changes will automatically be taken into account for the next daily build.

8. If you want to kick-off a build yourself, you can run:
+
--
----
$ copr build-package \
    --name llvm \
    -r fedora-rawhide-x86_64 \
    --timeout $((30*3600)) \
    @fedora-llvm-team/llvm-snapshots-big-merge-`date +%Y%m%d`
----

This will build the `llvm` package in today's Copr project with your changes as soon as they landed in the `rawhide` branch.
--


== Frequently Asked Questions [[faq]]

=== How can I clone `llvm`?

I cloned `llvm` with the appropriate tool (e.g. `fedpkg`, `centpkg` and `rhpkg`).

----
$ fedpkg clone llvm -b rawhide ~/src/llvm-rpms/llvm-rawhide #<1>
$ centpkg clone llvm -b c9s ~/src/llvm-rpms/llvm-centos #<2>
$ rhpkg clone llvm -b rhel-9-main ~/src/llvm-rpms/llvm-rhel #<3>
----
<1> This is for the regular fedora work on rawhide.
<2> This is for the work on CentOS stream.
<3> This is for the internal work on RHEL9.

=== How to sync with rawhide?

We do the snapshot work in the `rawhide` branch of fedora.

These are the benefits that we see:
* No special handling for contributors. They can just use rawhide.
* When making changes to the spec files for snapshots we can be sure that we’re not breaking rawhide because it is tested by Fedora CI.
* No complicated git merging with `big-merge` or `upstream-snapshot` branches that we've had in the past.
* Reverts are possible
* Smoother release process?
  * Just increment the `Version:` tag used in the non-snapshot part and consume the previously tested changes from the snapshots.

Of course there are some downsides as well:
* Possibly a lot of commit activity can happen in the `rawhide` branch that doesn’t change anything related to `rawhide` but only snapshots.
* A bit more if/else branches in the spec files.
* Duplicated patch files with slightly different content as they apply to each supported LLVM version.

We need `%if %{maj_ver} >= 20` conditions or alike for different LLVM versions (see link:https://src.fedoraproject.org/rpms/llvm/pull-request/286#_4__13[this PR] for example).

=== How do I find the monitor? [[monitor]]

You can find the snapshot monitor for LLVM Fedora builds on Copr here:

https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots/monitor/

The above link brings you to the latest "forked" build. It will only contain successful builds.

To find out where this build came from, take a look at the title of the project. There it should say something like:

>  ( forked from @fedora-llvm-team/llvm-snapshots-big-merge-20230221 )

Go to the project from which `@fedora-llvm-team/llvm-snapshots` was forked to find failing builds.

=== How do I run a local snapshot build?

----
$ git clone https://src.fedoraproject.org/rpms/llvm.git
$ cd llvm
$ make snapshot-rpm
----

= README
:icons: font

You might need to install missing dependencies. The build process itself probably takes quite some time.

You're going to find `results/YYYYMMDD/snapshot-rpm.log` with logging everything from this makefile target.

== Mass Rebuilds ==

This repository uses GitHub Actions to periodically perform rebuilds of selected
Fedora packages.  Once a mass rebuild is complete there is also automation
that will create a new issue with the results of the rebuild.

The rebuild process will attempt to automatically bisect the failures to a specific upstream
LLVM commit.

The rebuild can be started manually using the rebuilder.py script in
`.github/workflows/`

[source,console]
---
$ python3 rebuilder.py rebuild
---

You can also view the regression report once the rebuild is complete using
the same script.

[source,console]
---
$ python3 rebuilder.py get-regressions --start-date=
---

The start date should be the day the rebuild was started (In reality
it can be any date between when the last rebuild ended and the
new rebuild began).

Owner

  • Name: Fedora LLVM Team
  • Login: fedora-llvm-team
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Kleine"
  given-names: "Konrad"
- family-names: "Stellard"
  given-names: "Tom"
- family-names: "Popov"
  given-names: "Nikita"
- family-names: "Quites Machado Filho"
  given-names: "Tulio Magno"
- family-names: "Bäder"
  given-names: "Timm"
title: "LLVM Snapshots"
version: 2.0.0
date-released: 2024-04-01
url: "https://github.com/fedora-llvm-team/llvm-snapshots"

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 936
  • Total pull requests: 352
  • Average time to close issues: 10 days
  • Average time to close pull requests: 4 days
  • Total issue authors: 6
  • Total pull request authors: 9
  • Average comments per issue: 12.21
  • Average comments per pull request: 2.29
  • Merged pull requests: 213
  • Bot issues: 875
  • Bot pull requests: 121
Past Year
  • Issues: 601
  • Pull requests: 239
  • Average time to close issues: 8 days
  • Average time to close pull requests: 2 days
  • Issue authors: 5
  • Pull request authors: 9
  • Average comments per issue: 14.24
  • Average comments per pull request: 2.08
  • Merged pull requests: 149
  • Bot issues: 578
  • Bot pull requests: 69
Top Authors
Issue Authors
  • github-actions[bot] (874)
  • kwk (43)
  • nikic (10)
  • tstellar (4)
  • tuliom (3)
  • jchecahi (1)
Pull Request Authors
  • kwk (169)
  • dependabot[bot] (87)
  • github-actions[bot] (34)
  • tstellar (24)
  • tuliom (15)
  • nikic (13)
  • jchecahi (6)
  • tbaederr (2)
  • Sistemcat (2)
Top Labels
Issue Labels
strategy/big-merge (436) project/llvm (374) error/unknown (342) error/test (258) build_failed_on/fedora-rawhide-ppc64le (234) build_failed_on/fedora-rawhide-aarch64 (231) release/20.0.0 (226) build_failed_on/fedora-rawhide-s390x (217) build_failed_on/fedora-rawhide-x86_64 (212) build_failed_on/fedora-rawhide-i386 (185) build_failed_on/fedora-41-ppc64le (175) strategy/pgo (174) build_failed_on/rhel-8-s390x (170) build_failed_on/fedora-41-aarch64 (170) build_failed_on/fedora-41-x86_64 (168) os/fedora-rawhide (165) build_failed_on/fedora-40-i386 (163) build_failed_on/rhel-9-s390x (162) os/fedora-39 (162) build_failed_on/fedora-41-i386 (161) build_failed_on/fedora-40-s390x (160) os/fedora-38 (160) build_failed_on/fedora-40-ppc64le (157) tested_on/fedora-40-x86_64 (153) in_testing/fedora-rawhide-ppc64le (152) arch/ppc64le (149) release/21.0.0 (148) build_failed_on/fedora-40-aarch64 (148) build_failed_on/rhel-9-x86_64 (147) arch/i386 (145)
Pull Request Labels
python (100) dependencies (85) pip (69) dependabot (68) github/workflow (31) strategy/big-merge (27) project/llvm (25) release/20.0.0 (22) ci (20) error/unknown (17) build_failed_on/fedora-rawhide-aarch64 (17) build_failed_on/rhel-9-s390x (16) build_failed_on/fedora-rawhide-ppc64le (15) build_failed_on/fedora-39-s390x (15) build_failed_on/fedora-40-s390x (15) build_failed_on/rhel-9-aarch64 (15) tested_on/fedora-39-x86_64 (15) enhancement (14) build_failed_on/fedora-39-i386 (14) build_failed_on/fedora-39-aarch64 (14) build_failed_on/rhel-8-s390x (14) tested_on/fedora-40-x86_64 (14) build_failed_on/rhel-8-aarch64 (14) build_failed_on/fedora-40-x86_64 (14) build_failed_on/rhel-9-x86_64 (14) build_failed_on/fedora-40-aarch64 (14) build_failed_on/fedora-rawhide-x86_64 (14) build_failed_on/fedora-rawhide-s390x (14) build_failed_on/fedora-39-ppc64le (13) build_failed_on/fedora-39-x86_64 (13)

Dependencies

requirements.txt pypi
  • certifi ==2021.10.8
  • cffi ==1.15.0
  • charset-normalizer ==2.0.12
  • copr ==1.122
  • deprecated ==1.2.13
  • filelock ==3.8.0
  • future ==0.18.2
  • idna ==3.3
  • marshmallow ==3.14.1
  • munch ==2.5.0
  • pycparser ==2.21
  • pygithub ==1.55
  • pyjwt ==2.4.0
  • pynacl ==1.5.0
  • requests ==2.27.1
  • requests-toolbelt ==0.9.1
  • six ==1.16.0
  • urllib3 ==1.26.8
  • wrapt ==1.13.3
requirements.txt.in pypi
  • PyGithub ==1.55
  • copr ==1.122
.github/workflows/fedora-copr-build.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/generate-snapshot-tarballs.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/check-todays-snapshot.yml actions
  • actions/checkout v3 composite
.github/workflows/python-with-black.yml actions
  • actions/checkout v3 composite
  • psf/black stable composite
.github/workflows/tmt.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
.github/workflows/update-build-time-diagrams.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
build-stats/requirements.in pypi
  • copr *
  • copr-cli *
  • pandas *
  • plotly ==5.18.0
build-stats/requirements.txt pypi
  • certifi ==2023.7.22
  • charset-normalizer ==3.3.0
  • copr ==1.130
  • copr-cli ==1.110
  • filelock ==3.12.4
  • humanize ==4.8.0
  • idna ==3.4
  • jinja2 ==3.1.2
  • markupsafe ==2.1.3
  • munch ==4.0.0
  • numpy ==1.26.0
  • packaging ==23.2
  • pandas ==2.1.3
  • plotly ==5.18.0
  • python-dateutil ==2.8.2
  • pytz ==2023.3.post1
  • requests ==2.31.0
  • requests-toolbelt ==1.0.0
  • simplejson ==3.19.2
  • six ==1.16.0
  • tenacity ==8.2.3
  • tzdata ==2023.3
  • urllib3 ==1.26.18