Permalink
Browse files

Use the lane id instead of lane name in temporary paths for the builder.

This works around a problem with long lane names and Windows' 260 character MAX_PATH restriction.
  • Loading branch information...
1 parent a4a561c commit e4eccc755c44a660613e28d720be8d2593645ec5 @rolfbjarne rolfbjarne committed Jan 10, 2014
Showing with 33 additions and 33 deletions.
  1. +11 −11 MonkeyWrench.Builder/Builder.cs
  2. +22 −22 MonkeyWrench/Configuration.cs
@@ -275,7 +275,7 @@ private static void Build (BuildInfo info)
p.StartInfo.EnvironmentVariables ["BUILD_COMMAND"] = info.command.command;
p.StartInfo.EnvironmentVariables ["BUILD_REVISION"] = info.revision.revision;
p.StartInfo.EnvironmentVariables ["BUILD_INSTALL"] = Configuration.CygwinizePath (info.BUILDER_DATA_INSTALL_DIR);
- p.StartInfo.EnvironmentVariables ["BUILD_DATA_LANE"] = Configuration.GetDataLane (info.lane.lane);
+ p.StartInfo.EnvironmentVariables ["BUILD_DATA_LANE"] = Configuration.GetDataLane (info.lane.id);
p.StartInfo.EnvironmentVariables ["BUILD_DATA_SOURCE"] = info.BUILDER_DATA_SOURCE_DIR;
p.StartInfo.EnvironmentVariables ["BUILD_REPOSITORY"] = info.lane.repository;
p.StartInfo.EnvironmentVariables ["BUILD_HOST"] = Configuration.Host;
@@ -292,11 +292,11 @@ private static void Build (BuildInfo info)
p.StartInfo.EnvironmentVariables ["BUILD_REPOSITORY_SPACE"] = info.lane.repository.Replace (',', ' ');
p.StartInfo.EnvironmentVariables ["BUILD_SEQUENCE"] = "0";
p.StartInfo.EnvironmentVariables ["BUILD_SCRIPT_DIR"] = info.temp_dir;
- p.StartInfo.EnvironmentVariables ["LD_LIBRARY_PATH"] = Configuration.CygwinizePath (Configuration.GetLdLibraryPath (info.lane.lane, info.revision.revision));
- p.StartInfo.EnvironmentVariables ["PKG_CONFIG_PATH"] = Configuration.CygwinizePath (Configuration.GetPkgConfigPath (info.lane.lane, info.revision.revision));
- p.StartInfo.EnvironmentVariables ["PATH"] = Configuration.CygwinizePath (Configuration.GetPath (info.lane.lane, info.revision.revision));
- p.StartInfo.EnvironmentVariables ["C_INCLUDE_PATH"] = Configuration.CygwinizePath (Configuration.GetCIncludePath (info.lane.lane, info.revision.revision));
- p.StartInfo.EnvironmentVariables ["CPLUS_INCLUDE_PATH"] = Configuration.CygwinizePath (Configuration.GetCPlusIncludePath (info.lane.lane, info.revision.revision));
+ p.StartInfo.EnvironmentVariables ["LD_LIBRARY_PATH"] = Configuration.CygwinizePath (Configuration.GetLdLibraryPath (info.lane.id, info.revision.revision));
+ p.StartInfo.EnvironmentVariables ["PKG_CONFIG_PATH"] = Configuration.CygwinizePath (Configuration.GetPkgConfigPath (info.lane.id, info.revision.revision));
+ p.StartInfo.EnvironmentVariables ["PATH"] = Configuration.CygwinizePath (Configuration.GetPath (info.lane.id, info.revision.revision));
+ p.StartInfo.EnvironmentVariables ["C_INCLUDE_PATH"] = Configuration.CygwinizePath (Configuration.GetCIncludePath (info.lane.id, info.revision.revision));
+ p.StartInfo.EnvironmentVariables ["CPLUS_INCLUDE_PATH"] = Configuration.CygwinizePath (Configuration.GetCPlusIncludePath (info.lane.id, info.revision.revision));
// We need to remove all paths from environment variables that were
// set for this executable to work so that they don't mess with
@@ -422,7 +422,7 @@ private static void Build (BuildInfo info)
if (response.RevisionWorkCompleted) {
// Cleanup after us.
- string base_dir = Configuration.GetDataRevisionDir (info.lane.lane, info.revision.revision);
+ string base_dir = Configuration.GetDataRevisionDir (info.lane.id, info.revision.revision);
FileUtilities.TryDeleteDirectoryRecursive (base_dir);
}
@@ -490,14 +490,14 @@ private static void Build (List<BuildInfoEntry> list)
for (int f = 0; f < entry.FilesToDownload.Count; f++) {
DBWorkFile file = entry.FilesToDownload [f];
DBLane dependent_lane = entry.DependentLaneOfFiles [f];
- WebService.DownloadFileSafe (file, Configuration.GetDependentDownloadDirectory (info.lane.lane, dependent_lane.lane, info.revision.revision));
+ WebService.DownloadFileSafe (file, Configuration.GetDependentDownloadDirectory (info.lane.id, dependent_lane.lane, info.revision.revision));
}
}
// Set revision-specific paths
- info.BUILDER_DATA_INSTALL_DIR = Configuration.GetDataInstallDir (entry.Lane.lane, entry.Revision.revision);
- info.BUILDER_DATA_LOG_DIR = Configuration.GetDataLogDir (entry.Lane.lane, entry.Revision.revision);
- info.BUILDER_DATA_SOURCE_DIR = Configuration.GetDataSourceDir (entry.Lane.lane, entry.Revision.revision);
+ info.BUILDER_DATA_INSTALL_DIR = Configuration.GetDataInstallDir (entry.Lane.id, entry.Revision.revision);
+ info.BUILDER_DATA_LOG_DIR = Configuration.GetDataLogDir (entry.Lane.id, entry.Revision.revision);
+ info.BUILDER_DATA_SOURCE_DIR = Configuration.GetDataSourceDir (entry.Lane.id, entry.Revision.revision);
info.environment_variables = entry.EnvironmentVariables;
if (!Directory.Exists (info.BUILDER_DATA_SOURCE_DIR))
@@ -320,9 +320,9 @@ public static string ApplicationName
}
}
- public static string GetDataLane (string lane)
+ public static string GetDataLane (int lane_id)
{
- return Path.Combine (Path.Combine (DataDirectory, "lanes"), lane);
+ return Path.Combine (Path.Combine (DataDirectory, "lanes"), lane_id.ToString ());
}
/// <summary>
@@ -331,9 +331,9 @@ public static string GetDataLane (string lane)
/// <param name="lane"></param>
/// <param name="revision"></param>
/// <returns></returns>
- public static string GetDataRevisionDir (string lane, string revision)
+ public static string GetDataRevisionDir (int lane_id, string revision)
{
- return Path.Combine (Path.Combine (RevDataDirectory, lane), revision.Length > 8 ? revision.Substring (0, 8) : revision);
+ return Path.Combine (Path.Combine (RevDataDirectory, lane_id.ToString ()), revision.Length > 8 ? revision.Substring (0, 8) : revision);
}
/// <summary>
@@ -342,14 +342,14 @@ public static string GetDataRevisionDir (string lane, string revision)
/// <param name="lane"></param>
/// <param name="revision"></param>
/// <returns></returns>
- public static string GetDataLogDir (string lane, string revision)
+ public static string GetDataLogDir (int lane_id, string revision)
{
- return Path.Combine (GetDataRevisionDir (lane, revision), "logs");
+ return Path.Combine (GetDataRevisionDir (lane_id, revision), "logs");
}
- public static string GetDependentDownloadDirectory (string lane, string dependent_lane, string revision)
+ public static string GetDependentDownloadDirectory (int lane_id, string dependent_lane, string revision)
{
- return Path.Combine (Path.Combine (GetDataRevisionDir (lane, revision), "dependencies"), dependent_lane);
+ return Path.Combine (Path.Combine (GetDataRevisionDir (lane_id, revision), "dependencies"), dependent_lane);
}
/// <summary>
@@ -358,9 +358,9 @@ public static string GetDependentDownloadDirectory (string lane, string dependen
/// <param name="lane"></param>
/// <param name="revision"></param>
/// <returns></returns>
- public static string GetDataSourceDir (string lane, string revision)
+ public static string GetDataSourceDir (int lane_id, string revision)
{
- return Path.Combine (GetDataRevisionDir (lane, revision), "source");
+ return Path.Combine (GetDataRevisionDir (lane_id, revision), "source");
}
/// <summary>
@@ -369,51 +369,51 @@ public static string GetDataSourceDir (string lane, string revision)
/// <param name="lane"></param>
/// <param name="revision"></param>
/// <returns></returns>
- public static string GetDataInstallDir (string lane, string revision)
+ public static string GetDataInstallDir (int lane_id, string revision)
{
- return Path.Combine (GetDataRevisionDir (lane, revision), "install");
+ return Path.Combine (GetDataRevisionDir (lane_id, revision), "install");
}
- public static string GetPkgConfigPath (string lane, string revision)
+ public static string GetPkgConfigPath (int lane_id, string revision)
{
string current = Environment.GetEnvironmentVariable ("PKG_CONFIG_PATH");
- string result = Path.Combine (Path.Combine (GetDataInstallDir (lane, revision), "lib"), "pkgconfig");
+ string result = Path.Combine (Path.Combine (GetDataInstallDir (lane_id, revision), "lib"), "pkgconfig");
if (!string.IsNullOrEmpty (current))
result += ":" + current;
return result;
}
- public static string GetLdLibraryPath (string lane, string revision)
+ public static string GetLdLibraryPath (int lane_id, string revision)
{
string current = Environment.GetEnvironmentVariable ("LD_LIBRARY_PATH");
- string result = Path.Combine (GetDataInstallDir (lane, revision), "lib");
+ string result = Path.Combine (GetDataInstallDir (lane_id, revision), "lib");
if (!string.IsNullOrEmpty (current))
result += ":" + current;
return result;
}
- public static string GetPath (string lane, string revision)
+ public static string GetPath (int lane_id, string revision)
{
string current = Environment.GetEnvironmentVariable ("PATH");
- string result = Path.Combine (GetDataInstallDir (lane, revision), "bin");
+ string result = Path.Combine (GetDataInstallDir (lane_id, revision), "bin");
if (!string.IsNullOrEmpty (current))
result += ":" + current;
return result;
}
- public static string GetCIncludePath (string lane, string revision)
+ public static string GetCIncludePath (int lane_id, string revision)
{
string current = Environment.GetEnvironmentVariable ("C_INCLUDE_PATH");
- string result = Path.Combine (GetDataInstallDir (lane, revision), "include");
+ string result = Path.Combine (GetDataInstallDir (lane_id, revision), "include");
if (!string.IsNullOrEmpty (current))
result += ":" + current;
return result;
}
- public static string GetCPlusIncludePath (string lane, string revision)
+ public static string GetCPlusIncludePath (int lane_id, string revision)
{
string current = Environment.GetEnvironmentVariable ("CPLUS_INCLUDE_PATH");
- string result = Path.Combine (GetDataInstallDir (lane, revision), "include");
+ string result = Path.Combine (GetDataInstallDir (lane_id, revision), "include");
if (!string.IsNullOrEmpty (current))
result += ":" + current;
return result;

0 comments on commit e4eccc7

Please sign in to comment.