phase1: maketag.sh: write version and version.date files as well
[buildbot.git] / phase1 / master.cfg
index adf3cff407e1182d7fd91cdeaf46867369a4eb92..a8d6737682c9a7839dddd0836b32fd7226fa8f05 100644 (file)
@@ -194,7 +194,7 @@ def IsCleanRequested(pattern):
 
 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
@@ -213,7 +213,7 @@ def GetBaseVersion(props):
 
 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
@@ -238,10 +238,19 @@ def GetCXX(props):
        else:
                return "g++"
 
+def GetCwd(props):
+       if props.hasProperty("builddir"):
+               return props["builddir"]
+       elif props.hasProperty("workdir"):
+               return props["workdir"]
+       else:
+               return "/"
+
 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)
@@ -374,7 +383,7 @@ for target in targets:
                description = "Tagging Git repository",
                command = [home_dir+'/maketag.sh', '-i', '-k', str(gpg_keyid or ''),
                           '-p', str(gpg_passfile or ''), '-v', WithProperties("%(tag:-)s")],
-               path = home_dir+'/source.git',
+               workdir = home_dir+'/source.git',
                env = {'GNUPGHOME': gpg_home},
                haltOnFailure = True,
                doStepIf = IsTaggingRequested,
@@ -499,6 +508,20 @@ for target in targets:
                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))
@@ -516,7 +539,7 @@ for target in targets:
        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
        ))
@@ -563,6 +586,12 @@ for target in targets:
                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",