llvm/Makefile

174 lines
5.9 KiB
Makefile
Raw Permalink Normal View History

[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
.DEFAULT_GOAL=help
# See ~/.config/mock/<CONFIG>.cfg or /etc/mock/<CONFIG>.cfg
# Tweak this to centos-stream-9-x86_64 to build for CentOS
MOCK_CHROOT?=fedora-rawhide-x86_64
MOCK_OPTS?=
MOCK_OPTS_RELEASE?=--no-clean --no-cleanup-after $(MOCK_OPTS)
MOCK_OPTS_SNAPSHOT?=$(MOCK_OPTS_RELEASE) --with snapshot_build $(MOCK_OPTS)
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
YYYYMMDD=$(shell date +%Y%m%d)
SOURCEDIR=$(shell pwd)
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
SPEC=llvm.spec
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
# When nothing is given, this will be determined based on
# release or snapshot builds.
SRPM_PATH?=
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
######### Get sources
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
.PHONY: get-sources-snapshot
## Downloads all sources we need for a snapshot build.
get-sources-snapshot:
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
YYYYMMDD=$(YYYYMMDD) ./.copr/snapshot-info.sh > $(SOURCEDIR)/version.spec.inc
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
spectool -g --define "_sourcedir $(SOURCEDIR)" --define "_with_snapshot_build 1" $(SPEC)
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
.PHONY: get-sources-release
## Downloads all sources we need for a release build.
get-sources-release:
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
spectool -g --define "_sourcedir $(SOURCEDIR)" $(SPEC)
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
######### Build SRPM
merge llvm, clang, compiler-rt and libomp repos * %check: export LD_LIBRARY_PATH because runtimes use external cmake projects that wouldn't find libclang++.so * %check: use LLVM's LIT_XFAIL to mark tests that are expected to fail and don't just delete them * clang: bring over *.patch files * clang: remove build requires tags from clang package that are already defined by main llvm package * clang: remove duplicates found in llvm globals and use %{pkg_datadir} instead of %{install_datadir} * clang: rename and use pkg_name -> pkg_name_clang * clang: use %{pkg_name_clang} instead of %{name} * compiler-rt and libomp: wrap in %if %{without compat_build} * libomp: also build libomp for s390x (See https://github.com/llvm/llvm-project/pull/66081) * libomp: exclude libomp-devel on s390x just like libomp itself * libomp: introduce pkg_name_libomp and cleanup the globals * libomp: remove gdb-plugin (NEED TO CONFIRM IF THIS IS REALLY TRUE) * libomp: filter out flaky libomp test: ompt/teams/distribute_dispatch.c * llvm: add BuildRequires: graphviz to llvm-doc * llvm: use %{pkg_name_llvm} instead of %{name} * make: added temporary Makefile so I can more easily run srpm or rpm builds locally * make: Added local-tmt-vm target (not really useful yet) * rpm: for non-RHEL add prefix like "Jan 05 16:17:06" to every log line This should help in finding out how long things take to build/install/... * rpm: fully specify %files for top-level packages * rpm: make all packages fully qualified * rpm: obsolete llvm-snapshot-builder * rpm: remove BuildRequires: python3-lit because we have it in-tree * rpm: remove BuildRequires: tags for clang and llvm specifics as we're building in-tree * rpm: rename %llvm_srcdir -> %srcdir_llvm * rpm: rename %pkg_name -> %pkg_name_llvm * rpm: use full qualified name in %description * rpm: use region comments in spec file to group by package. This allows editors to fold text to get a better overview * rpmlint: update rc file to reflect clang and compiler-rt (libomp has no rpmlint rc file) * use python-lit from within tree
2023-10-12 09:15:14 +00:00
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
.PHONY: srpm-release
## Builds an SRPM that can be used for a release build.
srpm-release: get-sources-release
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
rpmbuild \
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
--define "_rpmdir $(SOURCEDIR)" \
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
--define "_sourcedir $(SOURCEDIR)" \
--define "_specdir $(SOURCEDIR)" \
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
--define "_srcrpmdir $(SOURCEDIR)" \
--define "_builddir $(SOURCEDIR)" \
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
-bs $(SPEC)
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
.PHONY: srpm-snapshot
## Builds an SRPM that can be used for a snapshot build.
srpm-snapshot: get-sources-snapshot
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
rpmbuild \
--with=snapshot_build \
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
--define "_rpmdir $(SOURCEDIR)" \
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
--define "_sourcedir $(SOURCEDIR)" \
--define "_specdir $(SOURCEDIR)" \
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
--define "_srcrpmdir $(SOURCEDIR)" \
--define "_builddir $(SOURCEDIR)" \
-bs $(SPEC)
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
######### Scrub mock chroot and cache
.PHONY: scrub-chroot
## Completely remove the fedora chroot and cache.
scrub-chroot:
mock -r $(MOCK_CHROOT) --scrub all
######### Do a mock build
.PHONY: mockbuild-release
## Start a mock build of the release SRPM.
mockbuild-release: srpm-release get-srpm-release
mock -r $(MOCK_CHROOT) $(MOCK_OPTS_RELEASE) $(srpm_path)
.PHONY: mockbuild-snapshot
## Start a mock build of the snapshot SRPM.
mockbuild-snapshot: srpm-snapshot get-srpm-snapshot
mock -r $(MOCK_CHROOT) $(MOCK_OPTS_SNAPSHOT) $(srpm_path)
######### Edit-last-failing-script
.PHONY: edit-last-failing-script
## Opens the last failing or running script from mock in your editor
## of choice for you to edit it and later re-run it in mock with:
## "make mockbuild-rerun-last-script-...".
edit-last-failing-script:
$$EDITOR /var/lib/mock/$(MOCK_CHROOT)/root/var/tmp/rpm-tmp.*
######### Re-run the last failing script from mock
.PHONY: mockbuild-rerun-last-script
## Re-runs the last failing or running script of your release/mock mockbuild.
mockbuild-rerun-last-script:
mock --root=$(MOCK_CHROOT) --shell 'sh -e /var/tmp/rpm-tmp.*'
.PHONY: help
# Based on https://gist.github.com/rcmachado/af3db315e31383502660
## Display this help text.
help:/
$(info Available targets)
$(info -----------------)
@awk '/^[a-zA-Z\-0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
if (helpMessage) { \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
gsub(/##/, "\n ", helpMessage); \
} else { \
helpMessage = "(No documentation)"; \
} \
printf "%-37s - %s\n", helpCommand, helpMessage; \
lastLine = "" \
} \
{ hasComment = match(lastLine, /^## (.*)/); \
if(hasComment) { \
lastLine=lastLine$$0; \
} \
else { \
lastLine = $$0 \
} \
}' $(MAKEFILE_LIST)
######### Deprecated targets
Prepare non-snapshot builds Remove version.spec.inc from git ================================ We no longer track `version.spec.inc` in git. This is useful for development. If we build a snapshot, the file is required but if we build a `release` build (see below), then we don't include it. Make improvements ================= We distinguish between `snapshot-` and `release-` builds now in the `Makefile`. These old targets are mapped to their new counterparts and a deprecation warning is shown: * `setup` -> `snapshot-setup` * `local-rpm` -> `snapshot-rpm` * `local-srpm` -> `snapshot-srpm` * `local-prep` -> `snapshot-prep` * `local-clean` -> `snapshot-clean` We also have these new Make targets that run the build process with a release tarball instead: * `release-setup` * `release-rpm` * `release-srpm` * `release-prep` * `release-clean` The targets `local-list-check` and `local-tmt-vm` have been commented out because I think they were not needed. I just kept them for future reference of research done in those areas. All builds described by the `Makefile` are still local and no `mock` is involved. I find this the easiest to debug. Toggle default bcond state for snapshot_build ============================================= We want to be able to build non-snapshot releases with this repo. That's why be default the build condition `snapshot_build` is off. So only when you explicitly enable `--with=snapshot_build` or define `--define "_with_snapshot_build 1"` you'll be able to build a snapshot. If however the build happens in Copr with a namespace that begins with `fedora-llvm-team/llvm-snapshots-`, then the build condition is ON by default and there's no need to enable it explicitly with `--with=snapshot_build`. Things related to release update ================================ * Add llvm-project tarball and signature to sources * Fix: error: source 1001 defined multiple times * Fix: error: source 1006 defined multiple times * Fix missing newline * Conditionally apply 0001-Always-build-shared-libs-for-LLD.patch * Only enable offload runtime in snapshot mode Misc. ===== * Add missing prep dependency
2024-05-17 09:27:48 +00:00
[make] Use mock instead of rpmbuild I always wanted to use `mock` instead of `rpmbuild` for building release and snapshot builds. I disliked `mock` for a very particular reason. When a build failed and I wanted to go in and change the last running script and re-run it, I thought this wasn't possible. Little did I know. Here are the make targets and what they do now: ``` Available targets ----------------- get-sources-snapshot - Downloads all sources we need for a snapshot build. get-sources-release - Downloads all sources we need for a release build. srpm-release - Builds an SRPM that can be used for a release build. srpm-snapshot - Builds an SRPM that can be used for a snapshot build. scrub-chroot - Completely remove the fedora chroot and cache. mockbuild-release - Start a mock build of the release SRPM. mockbuild-snapshot - Start a mock build of the snapshot SRPM. edit-last-failing-script - Opens the last failing or running script from mock in your editor of choice for you to edit it and later re-run it in mock with: "make mockbuild-rerun-last-script-...". mockbuild-rerun-last-script - Re-runs the last failing or running script of your release/mock mockbuild. help - Display this help text. get-llvm-version-release - Determines the LLVM version given in the llvm.spec file. get-llvm-version-snapshot - Determines the LLVM version given in the version.spec.inc file. get-spec-file-release - Parses the spec file for the Release: tag get-srpm-release - Determines the name of the SRPM used for release builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". get-srpm-snapshot - Determines the name of the SRPM used for snapshot builds Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm". ``` When you want to build a release build for fedora you can do so by running `make mockbuild-release` it will download the sources for you and create an SRPM that it will pass to `mock` for the final build. To build for `centos` you can use `make mockbuild-release MOCK_CHROOT=centos-stream-9-x86_64`.
2024-11-09 16:54:21 +00:00
# Map deprecated targets to new targets
.PHONY: snapshot-srpm release-srpm
snapshot-srpm release-srpm:
$(eval mapped_target:=$(subst snapshot-srpm,srpm-snapshot,$(MAKECMDGOALS)))
$(eval mapped_target:=$(subst release-srpm,srpm-release,$(mapped_target)))
$(info WARNING: "$(MAKECMDGOALS)" is deprecated. Instead running "$(mapped_target)")
$(MAKE) $(mapped_target)
######### Version/Release helper targets to build name of SRPM
.PHONY: get-llvm-version-release
## Determines the LLVM version given in the llvm.spec file.
get-llvm-version-release:
$(eval llvm_version_release:=$(shell grep -ioP "%global\s+(maj|min|patch)_ver[^0-9]\K[0-9]+" $(SPEC) | paste -sd'.'))
$(info LLVM Release Version: $(llvm_version_release))
@echo > /dev/null
.PHONY: get-llvm-version-snapshot
## Determines the LLVM version given in the version.spec.inc file.
get-llvm-version-snapshot:
$(eval llvm_version_snapshot:=$(shell grep -ioP "%global\s+(maj|min|patch)_ver[^0-9]\K[0-9]+" version.spec.inc | paste -sd'.'))
$(info LLVM Snapshot Version: $(llvm_version_snapshot))
@echo > /dev/null
.PHONY: get-spec-file-release
## Parses the spec file for the Release: tag
get-spec-file-release:
$(eval spec_file_release:=$(shell grep -ioP '^Release:\s*\K[0-9]+' $(SPEC)))
$(info LLVM Spec file Release: $(spec_file_release))
@echo > /dev/null
.PHONY: get-srpm-release
## Determines the name of the SRPM used for release builds
## Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm".
get-srpm-release: get-llvm-version-release get-spec-file-release
ifeq ($(SRPM_PATH),)
$(eval srpm_path:=llvm-$(llvm_version_release)-$(spec_file_release).*.src.rpm)
else
$(eval srpm_path:=$(SRPM_PATH))
endif
$(info LLVM SRPM Release: $(srpm_path))
@echo > /dev/null
.PHONY: get-srpm-snapshot
## Determines the name of the SRPM used for snapshot builds
## Can be overriden by giving "make ... SRPM_PATH=foo.src.rpm".
get-srpm-snapshot: get-llvm-version-snapshot get-spec-file-release
ifeq ($(SRPM_PATH),)
$(eval yyyymmdd:=$(shell grep -ioP "%global\s+llvm_snapshot_yyyymmdd\s+\K[0-9]+" version.spec.inc))
$(eval git_short:=$(shell grep -ioP "%global\s+llvm_snapshot_git_revision_short\s+\K[a-zA-Z0-9]+" version.spec.inc))
$(eval srpm_path:=llvm-$(llvm_version_snapshot)~pre$(yyyymmdd).g$(git_short)-$(spec_file_release).*.src.rpm)
else
$(eval srpm_path:=$(SRPM_PATH))
endif
$(info LLVM SRPM Snapshot: $(srpm_path))
@echo > /dev/null