Skip to content

Commit

Permalink
WIP: Introduce epel 8/9 and centos-stream 8/9
Browse files Browse the repository at this point in the history
chroots and compat packages for llvm and clang
  • Loading branch information
kwk committed Jan 20, 2022
1 parent d1ec540 commit cc9d02d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/fedora-copr-build.yml
Expand Up @@ -62,6 +62,10 @@ jobs:
fedora-rawhide-ppc64le \
fedora-rawhide-x86_64 \
fedora-rawhide-i386 \
centos-stream-8-x86_64 \
centos-stream-9-x86_64 \
epel-8-x86_64 \
epel-9-x86_64 \
--yyyymmdd "$(date +%Y%m%d)" \
--ownername "@fedora-llvm-team" \
--projectname "llvm-snapshots" \
Expand Down
49 changes: 48 additions & 1 deletion fedora-copr/build.py
Expand Up @@ -53,7 +53,11 @@ def __init__(self, ownername: str, projectname: str):
"fedora-35-aarch64",
"fedora-35-s390x",
"fedora-35-ppc64le",
"fedora-35-i386"
"fedora-35-i386",
"centos-stream-8-x86_64",
"centos-stream-9-x86_64",
"epel-8-x86_64",
"epel-9-x86_64",
]
self.__chroots = None

Expand Down Expand Up @@ -170,12 +174,27 @@ def __build_package(self, package_name: str, chroots: list[str], build_after_id:
# TODO(kwk): Oh boy, this sucks.
new_chroots = set(chroots)
for chroot in chroots:
if package_name.startswith("compat-llvm"):
p = package_name.removeprefix("compat-llvm")
elif package_name.startswith("compat-clang"):
p = package_name.removeprefix("compat-clang")



if (package_name == "compat-llvm-fedora-34" or package_name == "compat-clang-fedora-34" ) and not chroot.startswith("fedora-34-"):
new_chroots.remove(chroot)
if (package_name == "compat-llvm-fedora-35" or package_name == "compat-clang-fedora-35" ) and not chroot.startswith("fedora-35-"):
new_chroots.remove(chroot)
if (package_name == "compat-llvm-fedora-rawhide" or package_name == "compat-clang-fedora-rawhide" ) and not chroot.startswith("fedora-rawhide-"):
new_chroots.remove(chroot)
if (package_name == "compat-llvm-centos-stream-8" or package_name == "compat-clang-centos-stream-8" ) and not chroot.startswith("centos-stream-8"):
new_chroots.remove(chroot)
if (package_name == "compat-llvm-centos-stream-9" or package_name == "compat-clang-centos-stream-9" ) and not chroot.startswith("centos-stream-9"):
new_chroots.remove(chroot)
if (package_name == "compat-llvm-epel-8" or package_name == "compat-clang-epel-8" ) and not chroot.startswith("epel-8"):
new_chroots.remove(chroot)
if (package_name == "compat-llvm-epel-9" or package_name == "compat-clang-epel-9" ) and not chroot.startswith("epel-9"):
new_chroots.remove(chroot)
if new_chroots == set():
return dict()

Expand Down Expand Up @@ -233,6 +252,26 @@ def build_all(self, chroots: list[str], with_compat:bool=False, wait_on_build_id
llvm_compat_build = self.__build_package("compat-llvm-fedora-rawhide", [chroot], build_after_id=python_lit_build.id)
if llvm_compat_build != dict():
clang_compat_build = self.__build_package("compat-clang-fedora-rawhide", [chroot], build_after_id=llvm_compat_build.id)

if llvm_compat_build == dict():
llvm_compat_build = self.__build_package("compat-llvm-centos-stream-8", [chroot], build_after_id=python_lit_build.id)
if llvm_compat_build != dict():
clang_compat_build = self.__build_package("compat-clang-centos-stream-8", [chroot], build_after_id=llvm_compat_build.id)

if llvm_compat_build == dict():
llvm_compat_build = self.__build_package("compat-llvm-centos-stream-9", [chroot], build_after_id=python_lit_build.id)
if llvm_compat_build != dict():
clang_compat_build = self.__build_package("compat-clang-centos-stream-9", [chroot], build_after_id=llvm_compat_build.id)

if llvm_compat_build == dict():
llvm_compat_build = self.__build_package("compat-llvm-epel-8", [chroot], build_after_id=python_lit_build.id)
if llvm_compat_build != dict():
clang_compat_build = self.__build_package("compat-clang-epel-8", [chroot], build_after_id=llvm_compat_build.id)

if llvm_compat_build == dict():
llvm_compat_build = self.__build_package("compat-llvm-epel-9", [chroot], build_after_id=python_lit_build.id)
if llvm_compat_build != dict():
clang_compat_build = self.__build_package("compat-clang-epel-9", [chroot], build_after_id=llvm_compat_build.id)


llvm_build = self.__build_package("llvm", [chroot], build_after_id=llvm_compat_build.id if with_compat else python_lit_build.id)
Expand Down Expand Up @@ -316,9 +355,17 @@ def main(args) -> None:
"compat-llvm-fedora-rawhide",
"compat-llvm-fedora-35",
"compat-llvm-fedora-34",
"compat-llvm-centos-stream-8",
"compat-llvm-centos-stream-9",
"compat-llvm-epel-8",
"compat-llvm-epel-9",
"compat-clang-fedora-rawhide",
"compat-clang-fedora-35",
"compat-clang-fedora-34",
"compat-clang-centos-stream-8",
"compat-clang-centos-stream-9",
"compat-clang-epel-8",
"compat-clang-epel-9",
"llvm",
"compiler-rt",
"lld",
Expand Down
4 changes: 2 additions & 2 deletions fedora-copr/create-spec-file.sh
Expand Up @@ -165,7 +165,7 @@ create_spec_file() {
# Checkout OS-dependent branch from upstream if building compat package
local branch="upstream/upstream-snapshot"
case $orig_package_name in
"compat-llvm-fedora-34" | "compat-clang-fedora-34")
"compat-llvm-fedora-34" | "compat-clang-fedora-34" | "compat-llvm-epel-8" )
branch="fork/f34"
;;
"compat-llvm-fedora-35" | "compat-clang-fedora-35")
Expand Down Expand Up @@ -205,7 +205,7 @@ while [ $# -gt 0 ]; do
# name begins with "compat-". The project's name is manually
# cleaned from the "compat-" prefix and the "-fedora-XX" suffix.
case "$proj" in
"compat-llvm-fedora-34" | "compat-llvm-fedora-35" | "compat-llvm-fedora-rawhide")
"compat-llvm-fedora-34" | "compat-llvm-fedora-35" | "compat-llvm-fedora-rawhide" | "compat-llvm-epel-8" )
proj="llvm"
opt_build_compat_packages="1"
;;
Expand Down

0 comments on commit cc9d02d

Please sign in to comment.