diff --git a/tools/buildbot/bootstrap.pl b/tools/buildbot/bootstrap.pl index df7e995e..71ed1a65 100755 --- a/tools/buildbot/bootstrap.pl +++ b/tools/buildbot/bootstrap.pl @@ -45,6 +45,7 @@ if ($^O eq "linux") else { print CONF "BuilderPath = " . $ENV{'MSVC8'} . "\n"; + print CONF "PDBLog = $root\\OUTPUT\\pdblog.txt\n"; } close(CONF); diff --git a/tools/buildbot/helpers.pm b/tools/buildbot/helpers.pm index c1b5de72..37bf32c5 100644 --- a/tools/buildbot/helpers.pm +++ b/tools/buildbot/helpers.pm @@ -8,14 +8,12 @@ package Build; our $SVN = "/usr/bin/svn"; our $SVN_USER = 'dvander'; our $SVN_ARGS = ''; -our $SVN_VERSION = "/usr/bin/svnversion"; sub Revision { my ($str)=(@_); - my $dir = $SVN_VERSION; - - my $data = Command($dir . ' -c ' . $str); + + my $data = Command('svnversion -c ' . $str); if ($data =~ /(\d+):(\d+)/) { return $2; @@ -26,6 +24,17 @@ sub Revision } } +sub ProductVersion +{ + my ($file) = (@_); + my ($version); + open(FILE, $file) or die "Could not open $file: $!\n"; + $version = ; + close(FILE); + chomp $version; + return $version; +} + sub Delete { my ($str)=(@_); @@ -114,3 +123,4 @@ sub SVN_Add chdir($dir); } +return 1; \ No newline at end of file diff --git a/tools/buildbot/master.cfg b/tools/buildbot/master.cfg index e6d54338..d2bb0cdb 100755 --- a/tools/buildbot/master.cfg +++ b/tools/buildbot/master.cfg @@ -42,7 +42,7 @@ c['slavePortnum'] = 0000 # put here: there are several in buildbot/changes/*.py to choose from. from buildbot.changes.pb import PBChangeSource -c['change_source'] = PBChangeSource(prefix = '/am/sourcemod/') +c['change_source'] = PBChangeSource() # For example, if you had CVSToys installed on your repository, and your # CVSROOT/freshcfg file had an entry like this: @@ -114,8 +114,11 @@ from buildbot.steps.transfer import FileDownload from buildbot.steps.source import SVN from buildbot.process.properties import WithProperties from buildbot.steps.python_twisted import Trial +from buildbot import locks -def create_factory(sep): +pdb_lock = locks.MasterLock("symbolstore") + +def create_factory(sep, os): f1 = factory.BuildFactory() f1.addStep(SVN(baseURL = "svn://svn.alliedmods.net/am/sourcemod/", mode = "copy" @@ -144,10 +147,19 @@ def create_factory(sep): description = "packaging", descriptionDone = "uploaded" )) + if os == "win32": + f1.addStep(ShellCommand( + haltOnFailure = 1, + locks = [pdb_lock], + name = "symstore", + command = ["tools" + sep + "buildbot" + sep + "symstore.pl"], + description = "symstore", + descriptionDone = "symstore" + )) return f1 -facWin = create_factory("\\") -facLinux = create_factory("/") +facWin = create_factory("\\", "win32") +facLinux = create_factory("/", "linux") buildLinuxStable = { 'name': 'linux-stable', diff --git a/tools/buildbot/package.pl b/tools/buildbot/package.pl index 99e33b68..9d09f90c 100755 --- a/tools/buildbot/package.pl +++ b/tools/buildbot/package.pl @@ -31,8 +31,7 @@ chdir(Build::PathFormat('../../OUTPUT/base')); my ($version); -$version = `cat ../../product.version`; -chomp $version; +$version = Build::ProductVersion(Build::PathFormat('../../product.version')); $version .= '.' . Build::Revision('../..'); my ($filename); diff --git a/tools/buildbot/symstore.pl b/tools/buildbot/symstore.pl new file mode 100644 index 00000000..891b2b57 --- /dev/null +++ b/tools/buildbot/symstore.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +use File::Basename; + +my ($myself, $path) = fileparse($0); +chdir($path); + +require 'helpers.pm'; + +chdir('..'); +chdir('..'); + +our $SSH = 'ssh -i ../../smpvkey'; + +open(PDBLOG, 'OUTPUT/pdblog.txt') or die "Could not open pdblog.txt: $!\n"; + +#Sync us up with the main symbol store +rsync('sourcemod@alliedmods.net:~/public_html/symbols/', '..\\..\\symstore'); + +#Get version info +my ($version); +$version = Build::ProductVersion(Build::PathFormat('product.version')); +$version .= '.' . Build::Revision('.'); + +my ($line); +while () +{ + $line = $_; + $line =~ s/\.pdb/\*/; + chomp $line; + Build::Command("symstore add /r /f \"$line\" /s ..\\..\\symstore /t \"SourceMod\" /v \"$version\" /c \"buildbot\""); +} + +close(PDBLOG); + +#Now that we're done, rsync back. +rsync('../../symstore/', 'sourcemod@alliedmods.net:~/public_html/symbols'); + +sub rsync +{ + my ($from, $to) = (@_); + + Build::Command('rsync -av --delete -e="' . $SSH . '" ' . $from . ' ' . $to); +}