File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
// Baseline to check we got expected outputs.
8
8
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -MMD -MT dependencies -MF %t/t.d --serialize-diagnostics %t/t.dia
9
- // RUN: llvm-remote-cache-test -socket-path=%{remote-cache-dir}/%basename_t -cache-path=%t/cache -- env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
9
+ // Adding `LLBUILD_TASK_ID` just to make sure there's no failure if that is set but `LLBUILD_CONTROL_FD` is not.
10
+ // RUN: llvm-remote-cache-test -socket-path=%{remote-cache-dir}/%basename_t -cache-path=%t/cache -- env LLBUILD_TASK_ID=1 LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
10
11
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t1.o -MMD -MT dependencies -MF %t/t1.d --serialize-diagnostics %t/t1.dia -Rcompile-job-cache \
11
12
// RUN: 2>&1 | FileCheck %s --check-prefix=CACHE-MISS
12
13
// RUN: llvm-remote-cache-test -socket-path=%{remote-cache-dir}/%basename_t -cache-path=%t/cache -- env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
Original file line number Diff line number Diff line change @@ -1134,18 +1134,18 @@ void RemoteCachingOutputs::tryReleaseLLBuildExecutionLane() {
1134
1134
if (TriedReleaseLLBuildExecutionLane)
1135
1135
return ;
1136
1136
TriedReleaseLLBuildExecutionLane = true ;
1137
- if (const char * LLTaskID = getenv (" LLBUILD_TASK_ID" )) {
1137
+ if (auto LLTaskID = llvm::sys::Process::GetEnv (" LLBUILD_TASK_ID" )) {
1138
1138
// Use the llbuild protocol to request to release the execution lane for
1139
1139
// this task.
1140
- const char * LLControlFD = getenv (" LLBUILD_CONTROL_FD" );
1140
+ auto LLControlFD = llvm::sys::Process::GetEnv (" LLBUILD_CONTROL_FD" );
1141
1141
if (!LLControlFD)
1142
- llvm::report_fatal_error ( " 'LLBUILD_CONTROL_FD' env var is not set! " );
1142
+ return ; // LLBUILD_CONTROL_FD may not be set if a shell script is invoked.
1143
1143
int LLCtrlFD;
1144
- bool HasErr = StringRef (LLControlFD).getAsInteger (10 , LLCtrlFD);
1144
+ bool HasErr = StringRef (* LLControlFD).getAsInteger (10 , LLCtrlFD);
1145
1145
if (HasErr)
1146
1146
llvm::report_fatal_error (Twine (" failed converting 'LLBUILD_CONTROL_FD' "
1147
1147
" to an integer, it was: " ) +
1148
- LLControlFD);
1148
+ * LLControlFD);
1149
1149
llvm::raw_fd_ostream FDOS (LLCtrlFD, /* shouldClose*/ false );
1150
1150
FDOS << " llbuild.1\n " << LLTaskID << ' \n ' ;
1151
1151
FDOS.flush ();
You can’t perform that action at this time.
0 commit comments