# HG changeset patch # User Evgeniy.Koshkin # Date 1393837104 -14400 # Node ID a5f3d4f24843c88dce432c14b387640342398446 # Parent fd2005a04e4e6fcbe9cb5aae8048d1133d212e12 fixed TW-34285 - bundled new version of JetBrains.CommandLine.Symbols.exe; passed list of files via file diff -r fd2005a04e4e -r a5f3d4f24843 .idea/modules.xml --- a/.idea/modules.xml Thu Feb 27 20:30:21 2014 +0400 +++ b/.idea/modules.xml Mon Mar 03 12:58:24 2014 +0400 @@ -3,6 +3,7 @@ + diff -r fd2005a04e4e -r a5f3d4f24843 agent-tests/agent-tests.iml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent-tests/agent-tests.iml Mon Mar 03 12:58:24 2014 +0400 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r fd2005a04e4e -r a5f3d4f24843 agent-tests/src/jetbrains/buildServer/symbols/JetSymbolsExeTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent-tests/src/jetbrains/buildServer/symbols/JetSymbolsExeTest.java Mon Mar 03 12:58:24 2014 +0400 @@ -0,0 +1,190 @@ +package jetbrains.buildServer.symbols; + +import jetbrains.buildServer.BaseTestCase; +import jetbrains.buildServer.BuildProblemData; +import jetbrains.buildServer.agent.BuildProgressLogger; +import jetbrains.buildServer.agent.FlowLogger; +import jetbrains.buildServer.agent.NullBuildProgressLogger; +import jetbrains.buildServer.messages.BuildMessage1; +import jetbrains.buildServer.symbols.tools.JetSymbolsExe; +import jetbrains.buildServer.util.FileUtil; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.Date; +import java.util.HashSet; + +/** + * @author Evgeniy.Koshkin + */ +public class JetSymbolsExeTest extends BaseTestCase implements BuildProgressLogger { + + private JetSymbolsExe myExe; + + @Override + @BeforeMethod + public void setUp() throws Exception { + super.setUp(); + File homeDir = new File("tools\\JetSymbols").getAbsoluteFile(); + assertTrue(homeDir.isDirectory()); + myExe = new JetSymbolsExe(homeDir); + } + + @Test + public void testCmdParametersLengthLimit() throws Exception { + myExe.dumpGuidsToFile(getFilesCollection(500), FileUtil.createTempFile("testCmdParametersLengthLimit", ".out"), this); + } + + private Collection getFilesCollection(int count) throws IOException { + Collection result = new HashSet(); + for (int i = 0; i < count; i++){ + result.add(FileUtil.createTempFile("foo", "boo")); + } + return result; + } + + public void activityStarted(String activityName, String activityType) { + + } + + public void activityStarted(String activityName, String activityDescription, String activityType) { + + } + + public void activityFinished(String activityName, String activityType) { + + } + + public void targetStarted(String targetName) { + + } + + public void targetFinished(String targetName) { + + } + + public void buildFailureDescription(String message) { + + } + + public void internalError(String type, String message, Throwable throwable) { + + } + + public void progressStarted(String message) { + + } + + public void progressFinished() { + + } + + public void logMessage(BuildMessage1 message) { + + } + + public void logTestStarted(String name) { + + } + + public void logTestStarted(String name, Date timestamp) { + + } + + public void logTestFinished(String name) { + + } + + public void logTestFinished(String name, Date timestamp) { + + } + + public void logTestIgnored(String name, String reason) { + + } + + public void logSuiteStarted(String name) { + + } + + public void logSuiteStarted(String name, Date timestamp) { + + } + + public void logSuiteFinished(String name) { + + } + + public void logSuiteFinished(String name, Date timestamp) { + + } + + public void logTestStdOut(String testName, String out) { + + } + + public void logTestStdErr(String testName, String out) { + + } + + public void logTestFailed(String testName, Throwable e) { + + } + + public void logComparisonFailure(String testName, Throwable e, String expected, String actual) { + + } + + public void logTestFailed(String testName, String message, String stackTrace) { + + } + + public void flush() { + + } + + public void ignoreServiceMessages(Runnable runnable) { + + } + + public FlowLogger getFlowLogger(String flowId) { + return null; + } + + public FlowLogger getThreadLogger() { + return null; + } + + public String getFlowId() { + return null; + } + + public void logBuildProblem(BuildProblemData buildProblem) { + + } + + public void message(String message) { + + } + + public void error(String message) { + fail(message); + } + + public void warning(String message) { + + } + + public void exception(Throwable th) { + if(th != null) { + fail(th.toString()); + } + } + + public void progressMessage(String message) { + + } +} diff -r fd2005a04e4e -r a5f3d4f24843 agent/src/jetbrains/buildServer/symbols/tools/JetSymbolsExe.java --- a/agent/src/jetbrains/buildServer/symbols/tools/JetSymbolsExe.java Thu Feb 27 20:30:21 2014 +0400 +++ b/agent/src/jetbrains/buildServer/symbols/tools/JetSymbolsExe.java Mon Mar 03 12:58:24 2014 +0400 @@ -4,8 +4,10 @@ import jetbrains.buildServer.ExecResult; import jetbrains.buildServer.SimpleCommandLineProcessRunner; import jetbrains.buildServer.agent.BuildProgressLogger; +import jetbrains.buildServer.util.FileUtil; import java.io.File; +import java.io.IOException; import java.util.Collection; /** @@ -21,14 +23,12 @@ myExePath = new File(homeDir, SYMBOLS_EXE); } - public void dumpGuidsToFile(Collection files, File output, BuildProgressLogger buildLogger){ + public void dumpGuidsToFile(Collection files, File output, BuildProgressLogger buildLogger) throws IOException { final GeneralCommandLine commandLine = new GeneralCommandLine(); commandLine.setExePath(myExePath.getPath()); commandLine.addParameter(DUMP_SYMBOL_SIGN_CMD); commandLine.addParameter(String.format("/o=\"%s\"", output.getPath())); - for(File file : files){ - commandLine.addParameter(file.getPath()); - } + commandLine.addParameter(String.format("/i=\"%s\"", dumpPathsToFile(files).getPath())); buildLogger.message(String.format("Running command %s", commandLine.getCommandLineString())); final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, null); final String stdout = execResult.getStdout(); @@ -41,4 +41,14 @@ buildLogger.warning("Stderr: " + execResult.getStderr()); buildLogger.exception(execResult.getException()); } + + private File dumpPathsToFile(Collection files) throws IOException { + final File result = FileUtil.createTempFile(DUMP_SYMBOL_SIGN_CMD, ".input"); + StringBuilder contentBuilder = new StringBuilder(); + for(File file : files){ + contentBuilder.append(file.getPath()).append("\n"); + } + FileUtil.writeToFile(result, contentBuilder.toString().getBytes()); + return result; + } } diff -r fd2005a04e4e -r a5f3d4f24843 tools/JetSymbols/JetBrains.CommandLine.Symbols.exe Binary file tools/JetSymbols/JetBrains.CommandLine.Symbols.exe has changed diff -r fd2005a04e4e -r a5f3d4f24843 tools/JetSymbols/JetBrains.Platform.Symbols.Interop.WinApi.dll Binary file tools/JetSymbols/JetBrains.Platform.Symbols.Interop.WinApi.dll has changed diff -r fd2005a04e4e -r a5f3d4f24843 tools/JetSymbols/JetBrains.Platform.Symbols.Metadata.dll Binary file tools/JetSymbols/JetBrains.Platform.Symbols.Metadata.dll has changed diff -r fd2005a04e4e -r a5f3d4f24843 tools/JetSymbols/JetBrains.Platform.Symbols.Util.dll Binary file tools/JetSymbols/JetBrains.Platform.Symbols.Util.dll has changed