mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 11:38:16 +00:00
Bug 557225 - Fix TryServer failures. r=cjones r=josh
This commit is contained in:
parent
942c80cced
commit
33301ca730
@ -49,15 +49,43 @@ bool LaunchApp(const std::vector<std::string>& argv,
|
|||||||
SetAllFDsToCloseOnExec();
|
SetAllFDsToCloseOnExec();
|
||||||
|
|
||||||
#if defined(CHROMIUM_MOZILLA_BUILD)
|
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||||
for (environment_map::const_iterator it = env_vars_to_set.begin();
|
// Copy _NSGetEnviron() to a new char array and add the variables
|
||||||
it != env_vars_to_set.end(); ++it) {
|
// in env_vars_to_set.
|
||||||
if (setenv(it->first.c_str(), it->second.c_str(), 1/*overwrite*/))
|
// Existing variables are overwritten by env_vars_to_set.
|
||||||
exit(127);
|
int pos = 0;
|
||||||
|
environment_map combined_env_vars = env_vars_to_set;
|
||||||
|
while((*_NSGetEnviron())[pos] != NULL) {
|
||||||
|
std::string varString = (*_NSGetEnviron())[pos];
|
||||||
|
std::string varName = varString.substr(0, varString.find_first_of('='));
|
||||||
|
std::string varValue = varString.substr(varString.find_first_of('=') + 1);
|
||||||
|
if (combined_env_vars.find(varName) == combined_env_vars.end()) {
|
||||||
|
combined_env_vars[varName] = varValue;
|
||||||
}
|
}
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
int varsLen = combined_env_vars.size() + 1;
|
||||||
|
|
||||||
|
char** vars = new char*[varsLen];
|
||||||
|
int i = 0;
|
||||||
|
for (environment_map::const_iterator it = combined_env_vars.begin();
|
||||||
|
it != combined_env_vars.end(); ++it) {
|
||||||
|
std::string entry(it->first);
|
||||||
|
entry += "=";
|
||||||
|
entry += it->second;
|
||||||
|
vars[i] = strdup(entry.c_str());
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
vars[i] = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
posix_spawn_file_actions_t file_actions;
|
posix_spawn_file_actions_t file_actions;
|
||||||
if (posix_spawn_file_actions_init(&file_actions) != 0) {
|
if (posix_spawn_file_actions_init(&file_actions) != 0) {
|
||||||
|
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||||
|
for(int j = 0; j < varsLen; j++) {
|
||||||
|
free(vars[j]);
|
||||||
|
}
|
||||||
|
delete[] vars;
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,18 +105,36 @@ bool LaunchApp(const std::vector<std::string>& argv,
|
|||||||
if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0)
|
if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0)
|
||||||
{
|
{
|
||||||
posix_spawn_file_actions_destroy(&file_actions);
|
posix_spawn_file_actions_destroy(&file_actions);
|
||||||
|
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||||
|
for(int j = 0; j < varsLen; j++) {
|
||||||
|
free(vars[j]);
|
||||||
|
}
|
||||||
|
delete[] vars;
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int pid = 0;
|
int pid = 0;
|
||||||
int spawn_succeeded = (posix_spawnp(&pid,
|
int spawn_succeeded = (posix_spawnp(&pid,
|
||||||
argv_copy[0],
|
argv_copy[0],
|
||||||
&file_actions,
|
&file_actions,
|
||||||
NULL,
|
NULL,
|
||||||
argv_copy,
|
argv_copy,
|
||||||
|
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||||
|
vars) == 0);
|
||||||
|
#else
|
||||||
*_NSGetEnviron()) == 0);
|
*_NSGetEnviron()) == 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||||
|
for(int j = 0; j < varsLen; j++) {
|
||||||
|
free(vars[j]);
|
||||||
|
}
|
||||||
|
delete[] vars;
|
||||||
|
#endif
|
||||||
|
|
||||||
posix_spawn_file_actions_destroy(&file_actions);
|
posix_spawn_file_actions_destroy(&file_actions);
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ class XPCShellTests(object):
|
|||||||
elif sys.platform in ('os2emx', 'os2knix'):
|
elif sys.platform in ('os2emx', 'os2knix'):
|
||||||
os.environ["BEGINLIBPATH"] = self.xrePath + ";" + self.env["BEGINLIBPATH"]
|
os.environ["BEGINLIBPATH"] = self.xrePath + ";" + self.env["BEGINLIBPATH"]
|
||||||
os.environ["LIBPATHSTRICT"] = "T"
|
os.environ["LIBPATHSTRICT"] = "T"
|
||||||
elif sys.platform == 'osx':
|
elif sys.platform == 'osx' or sys.platform == "darwin":
|
||||||
self.env["DYLD_LIBRARY_PATH"] = self.xrePath
|
self.env["DYLD_LIBRARY_PATH"] = self.xrePath
|
||||||
else: # unix or linux?
|
else: # unix or linux?
|
||||||
self.env["LD_LIBRARY_PATH"] = self.xrePath
|
self.env["LD_LIBRARY_PATH"] = self.xrePath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user