Skip to content

Commit a256714

Browse files
committed
Remove continue on error Windows jobs ci
1 parent 920347b commit a256714

11 files changed

+83
-48
lines changed

.github/workflows/ci.yml

+5-43
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ jobs:
7575
clang-runtime: '17'
7676
cling: Off
7777
cppyy: Off
78-
- name: win2022-msvc-clang-repl-16
79-
os: windows-2022
80-
compiler: msvc
81-
clang-runtime: '16'
82-
cling: Off
83-
cppyy: Off
84-
- name: win2022-msvc-cling
85-
os: windows-2022
86-
compiler: msvc
87-
clang-runtime: '13'
88-
cling: On
89-
cling-version: '1.0'
90-
cppyy: Off
9178
- name: osx14-arm-clang-clang-repl-19
9279
os: macos-14
9380
compiler: clang
@@ -459,7 +446,7 @@ jobs:
459446
}
460447
cd build
461448
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
462-
cmake -DLLVM_ENABLE_PROJECTS="clang" `
449+
cmake -DLLVM_ENABLE_PROJECTS="clang" `
463450
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" `
464451
-DCMAKE_BUILD_TYPE=Release `
465452
-DLLVM_ENABLE_ASSERTIONS=ON `
@@ -553,32 +540,6 @@ jobs:
553540
# clang-runtime: '17'
554541
# cling: Off
555542
# cppyy: On
556-
- name: win2022-msvc-clang-repl-16
557-
os: windows-2022
558-
compiler: msvc
559-
clang-runtime: '16'
560-
cling: Off
561-
cppyy: Off
562-
#- name: win2022-msvc-clang-repl-16-cppyy
563-
# os: windows-2022
564-
# compiler: msvc
565-
# clang-runtime: '16'
566-
# cling: Off
567-
# cppyy: On
568-
- name: win2022-msvc-cling
569-
os: windows-2022
570-
compiler: msvc
571-
clang-runtime: '13'
572-
cling: On
573-
cling-version: '1.0'
574-
cppyy: Off
575-
#- name: win2022-msvc-cling-cppyy
576-
# os: windows-2022
577-
# compiler: msvc
578-
# clang-runtime: '13'
579-
# cling: On
580-
# cling-version: '1.0'
581-
# cppyy: On
582543
- name: osx14-arm-clang-clang-repl-19-cppyy
583544
os: macos-14
584545
compiler: clang
@@ -821,6 +782,7 @@ jobs:
821782
brew install eigen
822783
brew install boost
823784
pip install distro pytest
785+
824786
825787
- name: Restore Cache LLVM/Clang runtime build directory
826788
uses: actions/cache/restore@v4
@@ -898,7 +860,6 @@ jobs:
898860
echo "CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
899861
900862
- name: Build and Test/Install CppInterOp on Windows systems
901-
continue-on-error: true
902863
if: ${{ runner.os == 'windows' }}
903864
run: |
904865
#FIXME: Windows CppInterOp tests expected to fail
@@ -912,7 +873,7 @@ jobs:
912873
$env:LLVM_BUILD_DIR="$env:PWD_DIR\llvm-project\build"
913874
echo "LLVM_BUILD_DIR=$env:LLVM_BUILD_DIR"
914875
echo "LLVM_BUILD_DIR=$env:LLVM_BUILD_DIR" >> $env:GITHUB_ENV
915-
876+
916877
if ( "${{ matrix.cling }}" -imatch "On" )
917878
{
918879
$env:CLING_DIR="$env:PWD_DIR\cling"
@@ -966,6 +927,7 @@ jobs:
966927
-DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" `
967928
-DLLVM_ENABLE_WERROR=On `
968929
-DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\
930+
cmake --build . --config ${{ env.BUILD_TYPE }} --target googletest --parallel ${{ env.ncpus }}
969931
}
970932
cmake --build . --config ${{ env.BUILD_TYPE }} --target check-cppinterop --parallel ${{ env.ncpus }}
971933
cd ..
@@ -1117,7 +1079,7 @@ jobs:
11171079
# When debugging increase to a suitable value!
11181080
timeout-minutes: 30
11191081

1120-
emscripten_wasm:
1082+
emscripten_wasm_CppInterOp_and_xeus_cpp:
11211083
needs: [build_cache]
11221084
name: ${{ matrix.name }}
11231085
runs-on: ${{ matrix.os }}

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
303303
endif ()
304304

305305
# Fixes "C++ exception handler used, but unwind semantics are not enabled" warning Windows
306-
if (WIN32)
306+
if (MSVC)
307307
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
308308
endif ()
309309

lib/Interpreter/Compatibility.h

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
#include "clang/Basic/Version.h"
1111
#include "clang/Config/config.h"
1212

13+
#ifdef _WIN32
14+
#define dup _dup
15+
#define dup2 _dup2
16+
#define close _close
17+
#define fileno _fileno
18+
#endif
19+
1320
#if CLANG_VERSION_MAJOR < 19
1421
#define Template_Deduction_Result Sema::TemplateDeductionResult
1522
#define Template_Deduction_Result_Success \

lib/Interpreter/CppInterOp.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -3277,7 +3277,22 @@ namespace Cpp {
32773277
int m_DupFD = -1;
32783278

32793279
public:
3280+
#ifdef _WIN32
3281+
StreamCaptureInfo(int FD)
3282+
: m_TempFile(
3283+
[]() {
3284+
FILE* stream = nullptr;
3285+
errno_t err;
3286+
err = tmpfile_s(&stream);
3287+
if (err)
3288+
printf("Cannot create temporary file!\n");
3289+
return stream;
3290+
}(),
3291+
std::fclose),
3292+
m_FD(FD) {
3293+
#else
32803294
StreamCaptureInfo(int FD) : m_TempFile(tmpfile(), std::fclose), m_FD(FD) {
3295+
#endif
32813296
if (!m_TempFile) {
32823297
perror("StreamCaptureInfo: Unable to create temp file");
32833298
return;
@@ -3289,7 +3304,6 @@ namespace Cpp {
32893304
// This seems only neccessary when piping stdout or stderr, but do it
32903305
// for ttys to avoid over complicated code for minimal benefit.
32913306
::fflush(FD == STDOUT_FILENO ? stdout : stderr);
3292-
32933307
if (dup2(fileno(m_TempFile.get()), FD) < 0)
32943308
perror("StreamCaptureInfo:");
32953309
}
@@ -3306,7 +3320,6 @@ namespace Cpp {
33063320
assert(m_DupFD != -1 && "Multiple calls to GetCapturedString");
33073321

33083322
fflush(nullptr);
3309-
33103323
if (dup2(m_DupFD, m_FD) < 0)
33113324
perror("StreamCaptureInfo:");
33123325
// Go to the end of the file.

lib/Interpreter/DynamicLibraryManager.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ namespace Cpp {
5252
// Behaviour is to not add paths that don't exist...In an interpreted env
5353
// does this make sense? Path could pop into existance at any time.
5454
for (const char* Var : kSysLibraryEnv) {
55+
#ifdef _WIN32
56+
char* Env = nullptr;
57+
size_t sz = 0;
58+
if (_dupenv_s(&Env, &sz, Var)) {
59+
#else
5560
if (const char* Env = ::getenv(Var)) {
61+
#endif
5662
SmallVector<StringRef, 10> CurPaths;
5763
SplitPaths(Env, CurPaths, utils::kPruneNonExistant, Cpp::utils::platform::kEnvDelim);
5864
for (const auto& Path : CurPaths)

lib/Interpreter/Paths.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ bool ExpandEnvVars(std::string& Str, bool Path) {
168168

169169
std::string EnvVar = Str.substr(DPos + 1, Length -1); //"HOME"
170170
std::string FullPath;
171-
if (const char* Tok = ::getenv(EnvVar.c_str()))
171+
#ifdef _WIN32
172+
char* Tok = nullptr;
173+
size_t sz = 0;
174+
if (_dupenv_s(&Tok, &sz, EnvVar.c_str()))
175+
#else
176+
if (const char* Tok = getenv(EnvVar.c_str()))
177+
#endif
172178
FullPath = Tok;
173179

174180
Str.replace(DPos, Length, FullPath);

unittests/CppInterOp/CUDATest.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,18 @@ TEST(DISABLED_CUDATest, Sanity) {
4646
#else
4747
TEST(CUDATest, Sanity) {
4848
#endif // CLANG_VERSION_MAJOR < 16
49+
#ifdef _WIN32
50+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
51+
#endif
4952
if (!HasCudaSDK())
5053
GTEST_SKIP() << "Skipping CUDA tests as CUDA SDK not found";
5154
EXPECT_TRUE(Cpp::CreateInterpreter({}, {"--cuda"}));
5255
}
5356

5457
TEST(CUDATest, CUDAH) {
58+
#ifdef _WIN32
59+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
60+
#endif
5561
if (!HasCudaSDK())
5662
GTEST_SKIP() << "Skipping CUDA tests as CUDA SDK not found";
5763

@@ -61,6 +67,9 @@ TEST(CUDATest, CUDAH) {
6167
}
6268

6369
TEST(CUDATest, CUDARuntime) {
70+
#ifdef _WIN32
71+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
72+
#endif
6473
if (!HasCudaRuntime())
6574
GTEST_SKIP() << "Skipping CUDA tests as CUDA runtime not found";
6675

unittests/CppInterOp/FunctionReflectionTest.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,9 @@ TEST(FunctionReflectionTest, IsStaticMethod) {
799799
TEST(FunctionReflectionTest, GetFunctionAddress) {
800800
if (llvm::sys::RunningOnValgrind())
801801
GTEST_SKIP() << "XFAIL due to Valgrind report";
802+
#ifdef _WIN32
803+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
804+
#endif
802805
std::vector<Decl*> Decls, SubDecls;
803806
std::string code = "int f1(int i) { return i * i; }";
804807

@@ -1075,6 +1078,10 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) {
10751078
TEST(FunctionReflectionTest, Construct) {
10761079
if (llvm::sys::RunningOnValgrind())
10771080
GTEST_SKIP() << "XFAIL due to Valgrind report";
1081+
#ifdef _WIN32
1082+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
1083+
#endif
1084+
10781085
Cpp::CreateInterpreter();
10791086

10801087
Interp->declare(R"(
@@ -1111,6 +1118,11 @@ TEST(FunctionReflectionTest, Construct) {
11111118
TEST(FunctionReflectionTest, Destruct) {
11121119
if (llvm::sys::RunningOnValgrind())
11131120
GTEST_SKIP() << "XFAIL due to Valgrind report";
1121+
1122+
#ifdef _WIN32
1123+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
1124+
#endif
1125+
11141126
Cpp::CreateInterpreter();
11151127

11161128
Interp->declare(R"(

unittests/CppInterOp/InterpreterTest.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ TEST(InterpreterTest, DebugFlag) {
4545
}
4646

4747
TEST(InterpreterTest, Evaluate) {
48+
#ifdef _WIN32
49+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
50+
#endif
4851
if (llvm::sys::RunningOnValgrind())
4952
GTEST_SKIP() << "XFAIL due to Valgrind report";
5053
// EXPECT_TRUE(Cpp::Evaluate(I, "") == 0);
@@ -61,6 +64,9 @@ TEST(InterpreterTest, Evaluate) {
6164
}
6265

6366
TEST(InterpreterTest, Process) {
67+
#ifdef _WIN32
68+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
69+
#endif
6470
if (llvm::sys::RunningOnValgrind())
6571
GTEST_SKIP() << "XFAIL due to Valgrind report";
6672
Cpp::CreateInterpreter();
@@ -99,6 +105,9 @@ TEST(InterpreterTest, DetectResourceDir) {
99105
#else
100106
TEST(InterpreterTest, DISABLED_DetectResourceDir) {
101107
#endif // LLVM_BINARY_DIR
108+
#ifdef _WIN32
109+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
110+
#endif
102111
Cpp::CreateInterpreter();
103112
EXPECT_STRNE(Cpp::DetectResourceDir().c_str(), Cpp::GetResourceDir());
104113
llvm::SmallString<256> Clang(LLVM_BINARY_DIR);
@@ -108,6 +117,9 @@ TEST(InterpreterTest, DISABLED_DetectResourceDir) {
108117
}
109118

110119
TEST(InterpreterTest, DetectSystemCompilerIncludePaths) {
120+
#ifdef _WIN32
121+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
122+
#endif
111123
std::vector<std::string> includes;
112124
Cpp::DetectSystemCompilerIncludePaths(includes);
113125
EXPECT_FALSE(includes.empty());

unittests/CppInterOp/JitTest.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ static int printf_jit(const char* format, ...) {
1414
TEST(JitTest, InsertOrReplaceJitSymbol) {
1515
if (llvm::sys::RunningOnValgrind())
1616
GTEST_SKIP() << "XFAIL due to Valgrind report";
17+
#ifdef _WIN32
18+
GTEST_SKIP() << "Disabled on Windows. Needs fixing.";
19+
#endif
1720
std::vector<Decl*> Decls;
1821
std::string code = R"(
1922
extern "C" int printf(const char*,...);

unittests/CppInterOp/VariableReflectionTest.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ TEST(VariableReflectionTest, GetDatamembers) {
5454
EXPECT_EQ(datamembers.size(), 3);
5555
EXPECT_EQ(datamembers1.size(), 0);
5656
}
57-
57+
#ifdef _WIN32
58+
#pragma warning(disable : 4201)
59+
#endif
5860
#define CODE \
5961
struct Klass1 { \
6062
Klass1(int i) : num(1), b(i) {} \
@@ -131,6 +133,9 @@ TEST(VariableReflectionTest, DatamembersWithAnonymousStructOrUnion) {
131133
((intptr_t) & (k3.c)) - ((intptr_t) & (k3.num)));
132134
EXPECT_EQ(Cpp::GetVariableOffset(datamembers_klass3[4]),
133135
((intptr_t) & (k3.num2)) - ((intptr_t) & (k3.num)));
136+
#ifdef _WIN32
137+
#pragma warning(default : 4201)
138+
#endif
134139
}
135140

136141
TEST(VariableReflectionTest, LookupDatamember) {

0 commit comments

Comments
 (0)