-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSVC support, CI github Actions windows-2019
#2098
Conversation
The new GH action needs a dependency that is blocked in this repo, probably for security reasons.
@b-scholz would you add an exception rule for |
// The separator in the PATH variable | ||
#ifdef _MSC_VER | ||
const char PATHdelimiter = ';'; | ||
const char pathSeparator = '\\'; | ||
#else | ||
const char PATHdelimiter = ':'; | ||
const char pathSeparator = '/'; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, would switch to std::filesystem
Can you give us instructions how to do this? |
The setting should be available from the project's "Settings > Actions > Allow select actions" as discussed here for instance @b-scholz please let me know when it's fixed so I can relaunch the action. Thanks.
|
Codecov Report
@@ Coverage Diff @@
## master #2098 +/- ##
==========================================
- Coverage 75.58% 75.51% -0.08%
==========================================
Files 452 452
Lines 27266 27477 +211
==========================================
+ Hits 20609 20748 +139
- Misses 6657 6729 +72
|
The flyweight test-case fails. Should we re-run the tests? |
Also there are conflicts now. |
I added the exception. Thanks for the instructions. I hope it works now. |
I see that the tests are passing now (without the exception) - is this correct? |
@b-scholz Thanks, I this time the I re-enabled the tests for Windows. I re-wrote some (not all of them yet) of the I chose |
Tom suggested Python. I am not familiar with Windows. Python might be more mainstream and might be available for Windows as well. |
0cb6fd1
to
e3fcb60
Compare
Hi @b-scholz, Current state on Linux / MacOS
Current state on Windows with Visual Studio
TODO before merging
|
@@ -504,51 +504,41 @@ void SemanticCheckerImpl::checkClause(const Clause& clause) { | |||
} | |||
|
|||
void SemanticCheckerImpl::checkComplexRule(const std::set<const Clause*>& multiRule) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically std::set
does not guarantee that Clause
s will be ordered in a deterministic way because it is ordered by pointer's value.
By chance it seems that on Linux and MacOS the clauses are allocated memory location with the same order as the lexical order of clauses in the rule.
Unfortunately on Visual Studio, the clauses memory locations are not deterministically ordered.
// complex rule only once. | ||
// TODO (b-scholz): for negation / disjunction this is not quite | ||
// right; we would need more semantic information here. | ||
for (auto literal : (*multiRule.begin())->getBodyLiterals()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first clause returned by begin()
is not deterministic when compiled with Visual Studio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh dear - perhaps it is related to pointers rather than semantic info for ordering in STL containers. We had such issues in the past.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. My successive changes in this functions are mostly useless and could be entirely roll-back.
If we really want begin()
to always return the "first" clause (lexically), then we should provide a dedicated Comparator
to the multiRule
set. And that comparator would somehow dig into the pointed clauses, explore the body source-locations and compute the "less" relation.
But my feeling is that there is a more general problem and just relying on the "first" clause is not sufficient to correctly check the whole rule.
@@ -227,4 +227,8 @@ positive_test(pragma1) | |||
souffle_run_test_helper(TEST_NAME pragma2 FUNCTORS CATEGORY semantic) | |||
positive_test(rel_redundant) | |||
positive_test(type_as4) | |||
if (FALSE) | |||
# semantics checker of complex rule does not catch this | |||
# "variable only occurs once" issue. | |||
positive_test(complex_rule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test exhibit a more general issue with SemanticCheckerImpl::checkComplexRule
, as commented by b-scholtz
in the function:
// Count the variable occurrence for the body of a
// complex rule only once.
// TODO (b-scholz): for negation / disjunction this is not quite
// right; we would need more semantic information here.
What is still missing for completion? |
if (NOT (MSVC AND (CMAKE_BUILD_TYPE MATCHES Debug))) | ||
# When compiled in Debug with Visual Studio with the default stack size of 1MB, | ||
# the interpreter fails with a stack overflow in Engine::execute(). | ||
# The cause is the number of lambda functions that are allocated as locals on the stack. | ||
# The stack frame of Engine::execute is close to 30KB. | ||
# The 1MB stack will overflow at depth ~34 of Engine::execute(). | ||
positive_test(magic_nqueens) | ||
endif () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be addressed as an issue.
Engine::execute
must be split into smaller pieces to decrease the size required by the stack-frame.
|
I made sure the SWIG tests pass on Linux. |
Hi @b-scholz, the port to Windows is now in a good shape. Should the 70+ commits of this change be added in the master tree as-is? I cannot guarantee (actually I am pretty sure) that the intermediate steps don't build successfully. @XiaowenHu96 The new dependency on Python 3.x may need to be taken care of in some of the distribution/packaging scripts? |
Hi Quentin! If I understand it correctly,
|
windows-latest
windows-2019
Could you check that the SWIG interface is still working? We don't have SWIG as part of our CI. |
Hi @b-scholz, the SWIG interface tests are working on Linux, for both Python and Java. Do you want me to create a clean pull-request with all changes squashed into a single commit ? |
I think it is not necessary to squash everything into a single commit. That is alright. Could you enable SWIG testing? I think it would be good to test this - otherwise, it will stop working soon. |
I suggest we enable SWIG testing in the CI with a separate change, it will probably have some impacts on dependencies (Python, Java). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
This is a work-in-progress to support the build of Souffle on native Windows with Visual Studio.
Current achievement:
windows-latest
.ctest
currently, I did not investigate.Fixes
Main fixes include:
parallel for
.Other changes:
getopt
/getopt_long
no standard on Windows, wrote a replacement function to avoid introducing third-party licensed code.