Bugfixes to buildbot scripts, added symstore script.
Removed soon-to-be-outdated fetchdlls program. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402512
This commit is contained in:
parent
d6a9cb427f
commit
5caeebf807
@ -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);
|
||||
|
||||
|
@ -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 = <FILE>;
|
||||
close(FILE);
|
||||
chomp $version;
|
||||
return $version;
|
||||
}
|
||||
|
||||
sub Delete
|
||||
{
|
||||
my ($str)=(@_);
|
||||
@ -114,3 +123,4 @@ sub SVN_Add
|
||||
chdir($dir);
|
||||
}
|
||||
|
||||
return 1;
|
@ -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);
|
||||
|
44
tools/buildbot/symstore.pl
Executable file
44
tools/buildbot/symstore.pl
Executable file
@ -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 (<PDBLOG>)
|
||||
{
|
||||
$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);
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fetchdlls", "fetchdlls.vcproj", "{3C1C562B-1080-445F-A632-EA9EC9793389}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{3C1C562B-1080-445F-A632-EA9EC9793389}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3C1C562B-1080-445F-A632-EA9EC9793389}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3C1C562B-1080-445F-A632-EA9EC9793389}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3C1C562B-1080-445F-A632-EA9EC9793389}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,196 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="fetchdlls"
|
||||
ProjectGUID="{3C1C562B-1080-445F-A632-EA9EC9793389}"
|
||||
RootNamespace="fetchdlls"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfATL="0"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="dbghelp.lib"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="dbghelp.lib"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\main.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,192 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <DbgHelp.h>
|
||||
|
||||
void mdmp_string(void *mdmp, RVA addr, char *buffer, size_t maxlength)
|
||||
{
|
||||
int len;
|
||||
MINIDUMP_STRING *str;
|
||||
|
||||
str = (MINIDUMP_STRING *)((char *)mdmp + addr);
|
||||
len = WideCharToMultiByte(CP_UTF8,
|
||||
0,
|
||||
str->Buffer,
|
||||
str->Length / sizeof(WCHAR),
|
||||
buffer,
|
||||
maxlength,
|
||||
NULL,
|
||||
NULL);
|
||||
buffer[len] = '\0';
|
||||
}
|
||||
|
||||
int find_revision(const char *version, MINIDUMP_MODULE *module, const char *name)
|
||||
{
|
||||
FILE *fp;
|
||||
char msg[255];
|
||||
size_t i, len;
|
||||
char path[255];
|
||||
char buffer[3000];
|
||||
int last_revision;
|
||||
|
||||
len = _snprintf(path, sizeof(path), "%s", name);
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (path[i] == '\\')
|
||||
{
|
||||
path[i] = '/';
|
||||
}
|
||||
}
|
||||
|
||||
DeleteFile("_svnlog.txt");
|
||||
_snprintf(buffer,
|
||||
sizeof(buffer),
|
||||
"svn log svn://svn.alliedmods.net/svnroot/Packages/sourcemod/sourcemod-%d.%d/windows/base/addons/sourcemod/%s > _svnlog.txt",
|
||||
(module->VersionInfo.dwFileVersionMS >> 16),
|
||||
(module->VersionInfo.dwFileVersionMS & 0xFFFF),
|
||||
path);
|
||||
system(buffer);
|
||||
|
||||
if ((fp = fopen("_svnlog.txt", "rt")) == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
_snprintf(msg,
|
||||
sizeof(msg),
|
||||
"sourcemod-%s",
|
||||
version);
|
||||
|
||||
while (fgets(buffer, sizeof(buffer), fp) != NULL)
|
||||
{
|
||||
if (buffer[0] == 'r')
|
||||
{
|
||||
last_revision = atoi(&buffer[1]);
|
||||
}
|
||||
else if (strstr(buffer, msg) != NULL)
|
||||
{
|
||||
fclose(fp);
|
||||
|
||||
_snprintf(buffer,
|
||||
sizeof(buffer),
|
||||
"svn export -q -r %d svn://svn.alliedmods.net/svnroot/Packages/sourcemod/sourcemod-%d.%d/windows/base/addons/sourcemod/%s",
|
||||
last_revision,
|
||||
(module->VersionInfo.dwFileVersionMS >> 16),
|
||||
(module->VersionInfo.dwFileVersionMS & 0xFFFF),
|
||||
path);
|
||||
system(buffer);
|
||||
|
||||
return last_revision;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int rev;
|
||||
ULONG32 m;
|
||||
LPVOID mdmp;
|
||||
HANDLE hFile;
|
||||
const char *name;
|
||||
ULONG stream_size;
|
||||
char name_buf[255];
|
||||
HANDLE hFileMapping;
|
||||
MINIDUMP_MODULE *module;
|
||||
MINIDUMP_DIRECTORY *dir;
|
||||
MINIDUMP_MODULE_LIST *modules;
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
fprintf(stderr, "Usage: <build> <mdmp>\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if ((hFile = CreateFile(argv[2],
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL))
|
||||
== INVALID_HANDLE_VALUE)
|
||||
{
|
||||
fprintf(stderr, "Could not open file (error %d)\n", GetLastError());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
hFileMapping = CreateFileMapping(
|
||||
hFile,
|
||||
NULL,
|
||||
PAGE_READONLY,
|
||||
0,
|
||||
0,
|
||||
NULL);
|
||||
if (hFileMapping == NULL)
|
||||
{
|
||||
fprintf(stderr, "Could not open file mapping (error %d)\n", GetLastError());
|
||||
CloseHandle(hFile);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
mdmp = MapViewOfFile(hFileMapping,
|
||||
FILE_MAP_READ,
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
if (mdmp == NULL)
|
||||
{
|
||||
fprintf(stderr, "Could not create map view (error %d)\n", GetLastError());
|
||||
CloseHandle(hFileMapping);
|
||||
CloseHandle(hFile);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (!MiniDumpReadDumpStream(mdmp,
|
||||
ModuleListStream,
|
||||
&dir,
|
||||
(void **)&modules,
|
||||
&stream_size))
|
||||
{
|
||||
fprintf(stderr, "Could not read the module list stream.\n");
|
||||
UnmapViewOfFile(mdmp);
|
||||
CloseHandle(hFileMapping);
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
|
||||
for (m = 0; m < modules->NumberOfModules; m++)
|
||||
{
|
||||
module = &modules->Modules[m];
|
||||
|
||||
mdmp_string(mdmp, module->ModuleNameRva, name_buf, sizeof(name_buf));
|
||||
|
||||
if ((name = strstr(name_buf, "sourcemod\\")) != NULL)
|
||||
{
|
||||
name += 10;
|
||||
fprintf(stdout,
|
||||
"looking for: %s (%d.%d.%d.%d of build %s)... ",
|
||||
name,
|
||||
(module->VersionInfo.dwFileVersionMS >> 16),
|
||||
(module->VersionInfo.dwFileVersionMS & 0xFFFF),
|
||||
(module->VersionInfo.dwFileVersionLS >> 16),
|
||||
(module->VersionInfo.dwFileVersionLS & 0xFFFF),
|
||||
argv[1]
|
||||
);
|
||||
fflush(stdout);
|
||||
if ((rev = find_revision(argv[1], module, name)) == -1)
|
||||
{
|
||||
fprintf(stdout, "not found :(\n");
|
||||
continue;
|
||||
}
|
||||
fprintf(stdout, "downloaded! (pkgrev %d)\n", rev);
|
||||
}
|
||||
}
|
||||
|
||||
UnmapViewOfFile(mdmp);
|
||||
CloseHandle(hFileMapping);
|
||||
CloseHandle(hFile);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user