def IsTaggingRequested(step):
val = step.getProperty("tag")
- if val and re.match("^[0-9]+\.[0-9]+\.[0-9]+$", val):
+ if val and re.match("^[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", val):
return True
else:
return False
def GetVersionPrefix(props):
basever = GetBaseVersion(props)
- if props.hasProperty("tag") and re.match("^[0-9]+\.[0-9]+\.[0-9]+$", props["tag"]):
+ if props.hasProperty("tag") and re.match("^[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", props["tag"]):
return "%s/" % props["tag"]
elif basever != "master":
return "%s-SNAPSHOT/" % basever
else:
return "g++"
+def GetCwd(props):
+ if props.hasProperty("builddir"):
+ return props["builddir"]
+ elif props.hasProperty("workdir"):
+ return props["workdir"]
+ else:
+ return "/"
+
+def GetNextBuild(builder, requests):
+ for r in requests:
+ if r.properties and r.properties.hasProperty("tag"):
+ return r
+ return requests[0]
+
def MakeEnv(overrides=None):
env = {
'CC': WithProperties("%(cc)s", cc=GetCC),
- 'CXX': WithProperties("%(cxx)s", cxx=GetCXX)
+ 'CXX': WithProperties("%(cxx)s", cxx=GetCXX),
+ 'CCACHE_BASEDIR': WithProperties("%(cwd)s", cwd=GetCwd)
}
if overrides is not None:
env.update(overrides)
factory.addStep(ShellCommand(
name = "switchbranch",
description = "Checking out Git branch",
- command = "if [ -d .git ]; then git checkout '%s'; else exit 0; fi" % repo_branch,
+ command = "if [ -d .git ]; then git fetch && git checkout '%s'; else exit 0; fi" % repo_branch,
haltOnFailure = True,
doStepIf = IsNoTaggingRequested
))
description = "Finding libc suffix",
command = ["sed", "-ne", '/^CONFIG_LIBC=/ { s!^CONFIG_LIBC="\\(.*\\)"!\\1!; s!^musl$!!; s!.\\+!-&!p }', ".config"]))
+ # ccache helper
+ factory.addStep(FileDownload(
+ mastersrc = "ccache.sh",
+ slavedest = "ccache.sh",
+ mode = 0755
+ ))
+
+ # ccache prepare
+ factory.addStep(ShellCommand(
+ name = "prepccache",
+ description = "Preparing ccache",
+ command = ["./ccache.sh"]
+ ))
+
# install build key
factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="key-build", mode=0600))
factory.addStep(FileDownload(mastersrc=home_dir+'/key-build.pub', slavedest="key-build.pub", mode=0600))
factory.addStep(ShellCommand(
name = "dltar",
description = "Building GNU tar",
- command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "tools/tar/install", "V=s"],
+ command = ["make", WithProperties("-j%(jobs)d", jobs=GetNumJobs), "tools/tar/compile", "V=s"],
env = MakeEnv(),
haltOnFailure = True
))
haltOnFailure = True
))
+ factory.addStep(ShellCommand(
+ name = "pkgclean",
+ description = "Cleaning up package build",
+ command=["make", "package/cleanup", "V=s"]
+ ))
+
factory.addStep(ShellCommand(
name = "pkgbuild",
description = "Building packages",
factory.addStep(ShellCommand(
name = "dirupload",
description = "Uploading directory structure",
- command = ["rsync", "-avz", "tmp/upload/", "%s/" %(rsync_bin_url)],
+ command = ["rsync", "-4", "-avz", "tmp/upload/", "%s/" %(rsync_bin_url)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = True,
logEnviron = False
factory.addStep(ShellCommand(
name = "targetupload",
description = "Uploading target files",
- command=["rsync", "--progress", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]),
+ command=["rsync", "-4", "--progress", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]),
"-avz", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])),
WithProperties("%s/%%(prefix)stargets/%s/%s/" %(rsync_bin_url, ts[0], ts[1]), prefix=GetVersionPrefix)],
env={'RSYNC_PASSWORD': rsync_bin_key},
factory.addStep(ShellCommand(
name = "sourceupload",
description = "Uploading source archives",
- command=["rsync", "--progress", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "dl/", "%s/" %(rsync_src_url)],
+ command=["rsync", "-4", "--progress", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "dl/", "%s/" %(rsync_src_url)],
env={'RSYNC_PASSWORD': rsync_src_key},
haltOnFailure = True,
logEnviron = False
factory.addStep(ShellCommand(
name = "packageupload",
description = "Uploading package files",
- command=["rsync", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "bin/packages/", "%s/packages/" %(rsync_bin_url)],
+ command=["rsync", "-4", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "bin/packages/", "%s/packages/" %(rsync_bin_url)],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = False,
logEnviron = False
factory.addStep(ShellCommand(
name = "upload",
description = "Uploading logs",
- command=["rsync", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "logs/", "%s/logs/%s/%s/" %(rsync_bin_url, ts[0], ts[1])],
+ command=["rsync", "-4", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "logs/", "%s/logs/%s/%s/" %(rsync_bin_url, ts[0], ts[1])],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = False,
alwaysRun = True,
from buildbot.config import BuilderConfig
- c['builders'].append(BuilderConfig(name=target, slavenames=slaveNames, factory=factory))
+ c['builders'].append(BuilderConfig(name=target, slavenames=slaveNames, factory=factory, nextBuild=GetNextBuild))
####### STATUS TARGETS