назначение окружения PATH LD_LIBRARY_PATH

++
This commit is contained in:
2025-03-09 21:35:34 +03:00
parent d2a333c7cb
commit c85661a264
9 changed files with 39 additions and 37 deletions

10
.idea/workspace.xml generated
View File

@@ -8,10 +8,14 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Json/ComponentPublicationInfoJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Json/ComponentPublicationInfoJson.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/files/Global.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/Global.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/files/RunTask.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/RunTask.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/files/Task.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/Task.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/files/planner.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/planner.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/files/version.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/files/version.h" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -4,7 +4,7 @@
"ServerUserPassword": "mprit_2011", "ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true, "OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests", "Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\BUG", "ProjectsSearchDirectory": "E:\\Tests",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system", "DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads", "VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
@@ -26,13 +26,13 @@
"Kernels": 8, "Kernels": 8,
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe", "LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
"CheckTestingIntervalSeconds": 10, "CheckTestingIntervalSeconds": 10,
"AutoCheckTesting": false, "AutoCheckTesting": true,
"EmailOnTestingProgress": true, "EmailOnTestingProgress": true,
"CompleteCompilationOptions": false, "CompleteCompilationOptions": false,
"CompleteRunEnvironments": false, "CompleteRunEnvironments": false,
"lastMachineId": 13, "lastMachineId": 28,
"lastUserId": 34, "lastUserId": 36,
"lastCompilerId": 52, "lastCompilerId": 110,
"RegisterOn": false, "RegisterOn": false,
"SpacesOn": false, "SpacesOn": false,
"EmptyLinesOn": false, "EmptyLinesOn": false,

View File

@@ -3,8 +3,8 @@ import Common.Utils.Vector_;
import java.util.Vector; import java.util.Vector;
public class Constants { public class Constants {
public static final int version = 1203; public static final int version = 1204;
public static final int planner_version = 12; public static final int planner_version = 15;
public static final int testingMaxKernels = 64; public static final int testingMaxKernels = 64;
//-- //--
public static final String ApplicationFileName = "VisualSapfor.jar"; public static final String ApplicationFileName = "VisualSapfor.jar";

View File

@@ -225,9 +225,6 @@ public abstract class RepositoryServer<D extends Database> {
case ReceiveFile: case ReceiveFile:
ReceiveFile(); ReceiveFile();
break; break;
case Email:
Email();
break;
default: default:
UnsafeSession(); UnsafeSession();
break; break;

View File

@@ -8,3 +8,5 @@ int maxKernels;
int busyKernels; int busyKernels;
int freeKernels; int freeKernels;
String dvm_drv; String dvm_drv;
String PATH;
String LD_LIBRARY_PATH;

View File

@@ -91,12 +91,9 @@ public:
} }
String getStartCommand() override { String getStartCommand() override {
String res = workspace + "/run"; String res = Task::getStartCommand();
if (!environments.isEmpty()) if (!environments.isEmpty())
res = environments + " " + res; res = environments + " " + res;
#if DEB
printf("START %ld: %s\n", id, res.getCharArray());
#endif
return res; return res;
} }

View File

@@ -122,9 +122,13 @@ public:
virtual void prepareWorkspace() {} virtual void prepareWorkspace() {}
virtual String getLaunchScriptText() = 0; virtual String getLaunchScriptText() = 0;
virtual String getStartCommand() { virtual String getStartCommand() {
return workspace + "/run"; String res = workspace + "/run";
if (!PATH.isEmpty())
res = "PATH="+String::DQuotes(PATH)+ " " + res;
if (!LD_LIBRARY_PATH.isEmpty())
res = "LD_LIBRARY_PATH="+String::DQuotes(LD_LIBRARY_PATH)+ " " + res;
return res;
} }
void createWorkspace() { void createWorkspace() {
Utils::Mkdir(workspace); Utils::Mkdir(workspace);
} }

View File

@@ -88,6 +88,14 @@ void set_handlers() {
#endif #endif
} }
void getEnv_(String& res, const char * name_in){
char * value_ = getenv(name_in);
if (value_ != NULL){
res = String(value_);
value_ = NULL;
}
}
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
//+ //+
@@ -101,18 +109,20 @@ int main(int argc, char ** argv)
freeKernels = maxKernels; freeKernels = maxKernels;
busyKernels= 0; busyKernels= 0;
//-- //--
getEnv_(PATH,"PATH");
getEnv_(LD_LIBRARY_PATH,"LD_LIBRARY_PATH");
//--
("PATH="+PATH).println();
("LD_LIBRARY_PATH="+LD_LIBRARY_PATH).println();
//--
#if __cplusplus >= 201703L #if __cplusplus >= 201703L
std::filesystem::current_path(packageWorkspace.getCharArray()); std::filesystem::current_path(packageWorkspace.getCharArray());
#else #else
chdir(packageWorkspace.getCharArray()); chdir(packageWorkspace.getCharArray());
#endif #endif
#if DEB
userWorkspace.println(); userWorkspace.println();
packageWorkspace.println(); packageWorkspace.println();
printf("%d\n", maxKernels); printf("%d\n", maxKernels);
#endif
#ifndef _WIN32 #ifndef _WIN32
int pid = getpid(); int pid = getpid();
@@ -120,29 +130,17 @@ int main(int argc, char ** argv)
int pid = _getpid(); int pid = _getpid();
#endif #endif
#if DEB
printf("PID=%d\n", pid); printf("PID=%d\n", pid);
#endif
File pidFile("PID", String(pid)+"\n"); File pidFile("PID", String(pid)+"\n");
pidFile.Close(); pidFile.Close();
//--- //---
File startFile("STARTED", "+"); File startFile("STARTED", "+");
startFile.Close(); startFile.Close();
//--- //---
#if DEB
printf(">>>>\n"); printf(">>>>\n");
#endif
CompilationSupervisor * compilationSupervisor = new CompilationSupervisor(); CompilationSupervisor * compilationSupervisor = new CompilationSupervisor();
#if DEB
printf("%ld\n", compilationSupervisor->getLength());
#endif
compilationSupervisor->DoWithSchedule(maxKernels); compilationSupervisor->DoWithSchedule(maxKernels);
RunSupervisor * runSupervisor = new RunSupervisor(compilationSupervisor);
RunSupervisor * runSupervisor = new RunSupervisor(compilationSupervisor);
#if DEB
printf("%ld\n", runSupervisor->getLength());
runSupervisor->print();
#endif
runSupervisor->DoWithSchedule(maxKernels); runSupervisor->DoWithSchedule(maxKernels);
return 0; return 0;
} }

View File

@@ -1 +1 @@
13 15