phase1: consistent step styling
authorThibaut VARÈNE <hacks@slashdirt.org>
Tue, 25 Oct 2022 20:09:55 +0000 (22:09 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 15 May 2023 15:36:01 +0000 (17:36 +0200)
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
phase1/master.cfg

index 61de307210931a251c89e29a0a313fa07bda7221..e6da9110d9bc556a3fb4b62668548bb82c19ad9c 100644 (file)
@@ -559,46 +559,47 @@ for target in targets:
                descriptionDone = "Shared work directory set up",
                command = 'test -L "$PWD" || (mkdir -p ../shared-workdir && rm -rf "$PWD" && ln -s shared-workdir "$PWD")',
                workdir = ".",
-               haltOnFailure = True))
+               haltOnFailure = True,
+       ))
 
        # find number of cores
        factory.addStep(SetPropertyFromCommand(
                name = "nproc",
                property = "nproc",
                description = "Finding number of CPUs",
-               command = ["nproc"]))
+               command = ["nproc"],
+       ))
 
        # find gcc and g++ compilers
        factory.addStep(FileDownload(
                name = "dlfindbinpl",
                mastersrc = scripts_dir + '/findbin.pl',
                workerdest = "../findbin.pl",
-               mode = 0o755))
+               mode = 0o755,
+       ))
 
        factory.addStep(SetPropertyFromCommand(
                name = "gcc",
                property = "cc_command",
                description = "Finding gcc command",
-               command = [
-                       "../findbin.pl", "gcc", "", "",
-               ],
-               haltOnFailure = True))
+               command = ["../findbin.pl", "gcc", "", ""],
+               haltOnFailure = True,
+       ))
 
        factory.addStep(SetPropertyFromCommand(
                name = "g++",
                property = "cxx_command",
                description = "Finding g++ command",
-               command = [
-                       "../findbin.pl", "g++", "", "",
-               ],
-               haltOnFailure = True))
+               command = ["../findbin.pl", "g++", "", ""],
+               haltOnFailure = True,
+       ))
 
        # see if ccache is available
        factory.addStep(SetPropertyFromCommand(
                name = "ccache",
                property = "ccache_command",
-               command = ["which", "ccache"],
                description = "Testing for ccache command",
+               command = ["which", "ccache"],
                haltOnFailure = False,
                flunkOnFailure = False,
                warnOnFailure = False,
@@ -627,7 +628,7 @@ for target in targets:
                name = "fetchrefs",
                description = "Fetching Git remote refs",
                command = ["git", "fetch", "origin", Interpolate("+refs/heads/%(prop:branch)s:refs/remotes/origin/%(prop:branch)s")],
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        # switch to tag
@@ -645,18 +646,21 @@ for target in targets:
                name = "gitverify",
                description = "Ensure that Git HEAD is pointing to a branch or tag",
                command = 'git rev-parse --abbrev-ref HEAD | grep -vxqF HEAD || git show-ref --tags --dereference 2>/dev/null | sed -ne "/^$(git rev-parse HEAD) / { s|^.*/||; s|\\^.*||; p }" | grep -qE "^v[0-9][0-9]\\."',
-               haltOnFailure = True))
+               haltOnFailure = True,
+       ))
 
        factory.addStep(ShellCommand(
                name = "rmtmp",
                description = "Remove tmp folder",
-               command=["rm", "-rf", "tmp/"]))
+               command=["rm", "-rf", "tmp/"],
+       ))
 
        # feed
        factory.addStep(ShellCommand(
                name = "rmfeedlinks",
                description = "Remove feed symlinks",
-               command=["rm", "-rf", "package/feeds/"]))
+               command=["rm", "-rf", "package/feeds/"],
+       ))
 
        factory.addStep(StringDownload(
                name = "ccachecc",
@@ -688,7 +692,7 @@ for target in targets:
                description = "Installing feeds",
                command=["./scripts/feeds", "install", "-a"],
                env = MakeEnv(tryccache=True),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        # seed config
@@ -696,27 +700,27 @@ for target in targets:
                name = "dlconfigseed",
                s = Interpolate("%(kw:seed)s\n", seed=GetConfigSeed),
                workerdest = ".config",
-               mode = 0o644
+               mode = 0o644,
        ))
 
        # configure
        factory.addStep(ShellCommand(
                name = "newconfig",
                descriptionDone = ".config seeded",
-               command = Interpolate("printf 'CONFIG_TARGET_%(kw:target)s=y\\nCONFIG_TARGET_%(kw:target)s_%(kw:subtarget)s=y\\nCONFIG_SIGNED_PACKAGES=%(kw:usign:#?|y|n)s\\n' >> .config", target=ts[0], subtarget=ts[1], usign=GetUsignKey)
+               command = Interpolate("printf 'CONFIG_TARGET_%(kw:target)s=y\\nCONFIG_TARGET_%(kw:target)s_%(kw:subtarget)s=y\\nCONFIG_SIGNED_PACKAGES=%(kw:usign:#?|y|n)s\\n' >> .config", target=ts[0], subtarget=ts[1], usign=GetUsignKey),
        ))
 
        factory.addStep(ShellCommand(
                name = "delbin",
                description = "Removing output directory",
-               command = ["rm", "-rf", "bin/"]
+               command = ["rm", "-rf", "bin/"],
        ))
 
        factory.addStep(ShellCommand(
                name = "defconfig",
                description = "Populating .config",
                command = ["make", "defconfig"],
-               env = MakeEnv()
+               env = MakeEnv(),
        ))
 
        # check arch - exit early if does not exist - NB: some targets do not define CONFIG_TARGET_target_subtarget
@@ -737,7 +741,8 @@ for target in targets:
                name = "libc",
                property = "libc",
                description = "Finding libc suffix",
-               command = ["sed", "-ne", '/^CONFIG_LIBC=/ { s!^CONFIG_LIBC="\\(.*\\)"!\\1!; s!^musl$!!; s!.\\+!-&!p }', ".config"]))
+               command = ["sed", "-ne", '/^CONFIG_LIBC=/ { s!^CONFIG_LIBC="\\(.*\\)"!\\1!; s!^musl$!!; s!.\\+!-&!p }', ".config"],
+       ))
 
        # install build key
        factory.addStep(StringDownload(
@@ -772,7 +777,7 @@ for target in targets:
                command = 'mkdir -p ../dl && rm -rf "build/dl" && ln -s ../../dl "build/dl"',
                workdir = Property("builddir"),
                logEnviron = False,
-               want_stdout = False
+               want_stdout = False,
        ))
 
        # prepare tar
@@ -782,7 +787,7 @@ for target in targets:
                descriptionDone = "GNU tar built and installed",
                command = ["make", Interpolate("-j%(prop:nproc:-1)s"), "tools/tar/compile", "V=s"],
                env = MakeEnv(tryccache=True),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        # populate dl
@@ -799,7 +804,7 @@ for target in targets:
        factory.addStep(ShellCommand(
                name = "cleanbase",
                description = "Cleaning base-files",
-               command=["make", "package/base-files/clean", "V=s"]
+               command=["make", "package/base-files/clean", "V=s"],
        ))
 
        # build
@@ -809,7 +814,7 @@ for target in targets:
                descriptionDone = "Tools built and installed",
                command = ["make", Interpolate("-j%(prop:nproc:-1)s"), "tools/install", "V=s"],
                env = MakeEnv(tryccache=True),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -818,7 +823,7 @@ for target in targets:
                descriptionDone = "Toolchain built and installed",
                command=["make", Interpolate("-j%(prop:nproc:-1)s"), "toolchain/install", "V=s"],
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -827,7 +832,7 @@ for target in targets:
                descriptionDone = "Kmods built",
                command=["make", Interpolate("-j%(prop:nproc:-1)s"), "target/compile", "V=s", "IGNORE_ERRORS=n m", "BUILD_LOG=1"],
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        # find kernel version
@@ -836,14 +841,14 @@ for target in targets:
                property = "kernelversion",
                description = "Finding the effective Kernel version",
                command = "make --no-print-directory -C target/linux/ val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | xargs printf '%s-%s-%s\\n'",
-               env = { 'TOPDIR': Interpolate("%(prop:builddir)s/build") }
+               env = { 'TOPDIR': Interpolate("%(prop:builddir)s/build") },
        ))
 
        factory.addStep(ShellCommand(
                name = "pkgclean",
                description = "Cleaning up package build",
                descriptionDone = "Package build cleaned up",
-               command=["make", "package/cleanup", "V=s"]
+               command=["make", "package/cleanup", "V=s"],
        ))
 
        factory.addStep(ShellCommand(
@@ -852,7 +857,7 @@ for target in targets:
                descriptionDone = "Packages built",
                command=["make", Interpolate("-j%(prop:nproc:-1)s"), "package/compile", "V=s", "IGNORE_ERRORS=n m", "BUILD_LOG=1"],
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -861,7 +866,7 @@ for target in targets:
                descriptionDone = "Packages installed",
                command=["make", Interpolate("-j%(prop:nproc:-1)s"), "package/install", "V=s"],
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -870,7 +875,7 @@ for target in targets:
                descriptionDone = "Packages indexed",
                command=["make", Interpolate("-j%(prop:nproc:-1)s"), "package/index", "V=s", "CONFIG_SIGNED_PACKAGES="],
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -879,7 +884,7 @@ for target in targets:
                descriptionDone = "Images built and installed",
                command=["make", Interpolate("-j%(prop:nproc:-1)s"), "target/install", "V=s"],
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -887,7 +892,7 @@ for target in targets:
                description = "Generating config.buildinfo, version.buildinfo and feeds.buildinfo",
                command = "make -j1 buildinfo V=s || true",
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -895,7 +900,7 @@ for target in targets:
                description = "Generating profiles.json in target folder",
                command = "make -j1 json_overview_image_info V=s || true",
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -904,7 +909,7 @@ for target in targets:
                descriptionDone = "Checksums calculated",
                command=["make", "-j1", "checksum", "V=s"],
                env = MakeEnv(),
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -995,7 +1000,7 @@ for target in targets:
                name = "dirprepare",
                descriptionDone = "Upload directory structure prepared",
                command = ["mkdir", "-p", Interpolate("tmp/upload/%(kw:prefix)stargets/%(kw:target)s/%(kw:subtarget)s", target=ts[0], subtarget=ts[1], prefix=GetVersionPrefix)],
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -1003,7 +1008,7 @@ for target in targets:
                descriptionDone = "Repository symlink prepared",
                command = ["ln", "-s", "-f", Interpolate("../packages-%(kw:basever)s", basever=util.Transform(GetBaseVersion, Property("branch"))), Interpolate("tmp/upload/%(kw:prefix)spackages", prefix=GetVersionPrefix)],
                doStepIf = IsNoMasterBuild,
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -1060,7 +1065,7 @@ for target in targets:
                name = "dlrsync.sh",
                mastersrc = scripts_dir + '/rsync.sh',
                workerdest = "../rsync.sh",
-               mode = 0o755
+               mode = 0o755,
        ))
 
        # upload new files and update existing ones
@@ -1111,7 +1116,7 @@ for target in targets:
                description = "Finding source archives to upload",
                descriptionDone = "Source archives to upload found",
                command = "find dl/ -maxdepth 1 -type f -not -size 0 -not -name '.*' -not -name '*.hash' -not -name '*.dl' -newer .config -printf '%f\\n' > sourcelist",
-               haltOnFailure = True
+               haltOnFailure = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -1135,7 +1140,7 @@ for target in targets:
                haltOnFailure = False,
                flunkOnFailure = False,
                warnOnFailure = False,
-               alwaysRun = True
+               alwaysRun = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -1146,7 +1151,7 @@ for target in targets:
                haltOnFailure = False,
                flunkOnFailure = False,
                warnOnFailure = False,
-               alwaysRun = True
+               alwaysRun = True,
        ))
 
        factory.addStep(ShellCommand(
@@ -1169,7 +1174,7 @@ for target in targets:
                description = "Triggering %s build" % target,
                schedulerNames = [ "trigger_%s" % target ],
                set_properties = { "reason": Property("reason"), "tag": TagPropertyValue },
-               doStepIf = IsTargetSelected(target)
+               doStepIf = IsTargetSelected(target),
        ))