X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=Goalfile;h=ad820ec27b98a631c876d95eb9685f0ae1e40fd8;hb=4436477c429bac20787974b6c0f5b9845b77e84c;hp=0d94149c9d71bbe3759622b8242662585f439376;hpb=6b5ce5bb90c4652bd5b2dab6169be0cb0b7fe5ff;p=fedora-ocaml-rebuild.git diff --git a/Goalfile b/Goalfile index 0d94149..ad820ec 100644 --- a/Goalfile +++ b/Goalfile @@ -1,144 +1,59 @@ # See README. +include "fedora.gl" + let fedora-dir = "%HOME/d/fedora" -let branch = "master" -let side-tag = "f32-ocaml" -#let koji = "koji" -let koji = "koji -p riscv64" -#let fedpkg = "fedpkg" -let fedpkg = "fedpkg --user-config %HOME/d/fedora-ocaml-rebuild/fedpkg-user-config" +let fedora-branch = "rawhide" +#let fedora-branch = "f34" +let fedora-tag = "f41-build-side-91297" # The magic string that must appear in %changelog when the # package has been rebuilt. -let rebuild-name = "OCaml 4.09.0 for riscv64" +let fedora-rebuild-name = "OCaml 5.2.0 ppc64le fix" -# Packages that are blocked. Any dependent packages are also blocked -# automatically. -let blocked = [ "ocaml-camlp4" ] +# %fedora-retry-failed: +# If set to 1 then failed builds are retried automatically. +# If set to 0 then failed builds must be manually restarted. +# Normally you want this to be 0. +let fedora-retry-failed = "0" # Packages that are ignored, which means they are treated as if # they have been rebuilt. -#let ignored = [ "ocaml-srpm-macros", "ocaml" ] -let ignored = [ "ocaml-srpm-macros" ] - -# All OCaml-related source package names -let other-packages = [ - "alt-ergo", "apron", "brltty", "coccinelle", "coq", - "frama-c", "gappalib-coq", "graphviz", "hevea", "hivex", - "libguestfs", "opam", "plplot", "virt-top", "virt-v2v", - "why3", "z3", - "flocq" # no OCaml code, but needs to be rebuilt after Coq +let fedora-ignored = [ + "ocaml-srpm-macros", "ocaml", ] -pure function get-source-packages () = { - cd %fedora-dir - echo '[' - for f in ocaml* %other-packages; do - [ -f $f/%branch/$f.spec ] && echo "*built-in-koji(\"$f\")," - done - echo ']' -} -let source-packages = get-source-packages () - -# Main goal: Rebuild all packages. -goal all = : source-packages ; - -# Check if the source package has been built in Koji. -tactic *built-in-koji (pkg) = { - cd %fedora-dir/%pkg/%branch - koji=%koji - specfile=%pkg.spec - - # Packages which are ignored are treated as if they were rebuilt already. - for p in %ignored; do - if [ %pkg = "$p" ]; then exit 0; fi - done - - # If the specfile doesn't have the magic string then the - # package definitely needs to be rebuilt. - grep -sq %rebuild-name $specfile || exit 99 - - # Else we must check Koji itself. - # Koji sends some messages to stderr. - nvr=$(fedpkg verrel) - buildinfo=$($koji buildinfo $nvr 2>&1) - - # No build at all, needs rebuild. - echo "$buildinfo" | grep -sq "No such build" && exit 99 - # Exists a build, find out what state it is in. - state=$(echo "$buildinfo" | grep ^State: | awk '{print $2}') - taskid=$(echo "$buildinfo" | grep ^Task: | awk '{print $2}') +# Include the full list of packages for either Fedora or ELN. +include "./fedora-packages.gl" +#include "./eln-packages.gl" - case "$state" in - COMPLETE) - # Complete so we don't need to rebuild. - exit 0 ;; - FAILED) - # Failed builds must be examined and fixed manually. - exit 1 ;; - BUILDING) - # Cancel the build, we will resubmit it. - $koji cancel $taskid - exit 99 ;; - CANCELED|DELETED) - # Do a rebuild. - exit 99 ;; - esac - # Don't know what happened there, so fail. - exit 1 -} - -goal rebuild (pkg) = -*built-in-koji ("%pkg") : source-dependencies (pkg) { - cd %fedora-dir/%pkg/%branch - fedpkg=%fedpkg - koji=%koji - specfile=%pkg.spec - - # We have to wait for the dependencies to become available - # before we can start the new build. - for p in $($koji latest-build %< | awk '{print $1}'); do - $koji --quiet wait-repo side-tag - done - - # If the specfile doesn't have the magic string then add - # that now. - if ! grep -sq %rebuild-name $specfile; then - rpmdev-bumpspec -c "- "%rebuild-name *.spec - else - rpmdev-bumpspec -c "- Bump release and rebuild." *.spec - fi - $fedpkg commit -c - $fedpkg push - $fedpkg build -} - -# Get the source package names for a particular package. -# Note this is not merely the BuildRequires, since those are -# the binary packages. Also this will only find packages -# which are in the list of source-packages. -pure function source-dependencies (pkg) = @{ - specfile=%fedora-dir/%pkg/%branch/%pkg.spec - - echo -n Dependencies of %pkg: >&2 - - echo '[' - for r in $(rpmspec -q --buildrequires $specfile 2>/dev/null | - awk '{print $1}'); do - # Now we examine each *other* source package to see - # if any will create this dependency when they build. - for p in %source-packages; do - if [ "$p" != %pkg ] && \ - rpmspec -q --provides %fedora-dir/$p/%branch/$p.spec 2>/dev/null | - awk '{print $1}' | - grep -sq "^$r\$" - then - echo "*built-in-koji(\"$p\")," - echo -n '' $p >&2 +# Get the list of source packages. +pure function get-source-packages () returning strings = { + cd %fedora-dir + for pkg in %packages; do + spec=$pkg/%fedora-branch/$pkg.spec + if [ -f $spec ]; then + # Check that the spec file excludes i686. + # Only implement this check for ocaml-* packages, as the + # other packages are more complicated. + if [[ "$spec" =~ ^ocaml ]] && + ! rpmspec -P $spec | grep -sq 'ExcludeArch:.*i386' ; then + echo "ERROR: $pkg does not ExcludeArch: %%{ix86}" >&2 + exit 1 fi - done + # OK to rebuild this package. + echo "$pkg" + elif [ -f $pkg/%fedora-branch/dead.package ]; then + echo "WARNING: $pkg: is a dead package, ignored" >&2 + else + echo "ERROR: $pkg: package is not checked out locally" >&2 + # This does NOT exit the script, why??? + exit 1 + fi done - echo ']' - echo >&2 } +let fedora-source-packages = get-source-packages () + +# Main goal: Rebuild all packages in Koji. +goal all = : wrap ("is-koji-built", fedora-source-packages)