Skip to content

Native CMake support in VisualStudio #5162

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

Merged
merged 6 commits into from
Oct 18, 2019
Merged

Native CMake support in VisualStudio #5162

merged 6 commits into from
Oct 18, 2019

Conversation

LAJW
Copy link
Contributor

@LAJW LAJW commented Oct 13, 2019

These changes let you compile and run this project using VisualStudio's native CMake support.

To achieve this, I dropped the dependency on Cygwin, and only require git bash (which you're bound to have if you're using git) and the chocolatey winflexbison3 package (chocolatey is already used/preinstalled on CI).

Tested on VS2019 community edition, developer experience is much better than manually generating projects with CMake - it uses Ninja by default, which uses multi core compilation, unlike manually generated CMake projects.

Setup on VS with this PR boils down to two steps:

  • choco install winflexbison3

  • File -> Open -> CMake -> CBMC

  • Each commit message has a non-empty body, explaining why the change was made.

  • [n/a] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.

  • [n/a] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/

  • [n/a] Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).

  • [n/a] My commit message includes data points confirming performance improvements (if claimed).

  • My PR is restricted to a single feature or bugfix.

  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@LAJW LAJW added the RFC Request for comment label Oct 13, 2019
@LAJW LAJW changed the title Native CMake support in VisualStudio [RFC] Native CMake support in VisualStudio Oct 13, 2019
@smowton
Copy link
Contributor

smowton commented Oct 14, 2019

Oh actually, question: since at the moment we require VS 2015+, does this degrade the experience on VS2015 or 2017?

@LAJW
Copy link
Contributor Author

LAJW commented Oct 14, 2019

@smowton, nope, you still can configure cmake the old way (and with less dependencies). This is just adding cmake native as an option (which is available even in 2017). The only downside is you need to have git.

Copy link
Contributor

@chrisr-diffblue chrisr-diffblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMake changes look OK to me - might also be worth @hannes-steffenhagen-diffblue taking a look at those too. One thing I am a bit concerned about is that, if I'm reading this PR correctly, you've switched the CI builds from Makefile based builds to CMake based builds, yes? We have end users that depend on Windows Makefile based builds, so I would like to see those builds still exercised in CI somewhere so that they don't bit rot... Unless @peterschrammel is happy for CI to change if he thinks the users I have in mind might be willing to change their build system?

@LAJW
Copy link
Contributor Author

LAJW commented Oct 14, 2019

@chrisr-diffblue Fair enough, I'm not particularly attached to CI changes. I just wanted to try to see them work on CI. Removed.

Copy link
Contributor

@chrisr-diffblue chrisr-diffblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LAJW - the other option would be to liaise with Peter S about potentially adding a second Windows CI build, so that both the CMake and Make based builds get exercised in CI.

@chrisr-diffblue
Copy link
Contributor

Oh, and one other thought (sorry! :-) ) - I believe the Windows Makefile builds use CLCACHE - do the CMake based builds do the same?

@LAJW LAJW removed the RFC Request for comment label Oct 14, 2019
@LAJW LAJW changed the title [RFC] Native CMake support in VisualStudio Native CMake support in VisualStudio Oct 14, 2019
@LAJW
Copy link
Contributor Author

LAJW commented Oct 14, 2019

@chrisr-diffblue That was the intent in the CI changes. We're gonna have to make it work for test-gen too, so it'll come around. Outside of that you can use whichever generator you want.

Lukasz A.J. Wrona added 3 commits October 14, 2019 15:10
Suppresses a "missing project" warning. Each CBMC project should have a project tag.
This way you don't have to use Cygwin on Windows to configure cbmc with CMake and allows you to use Windows's native CMake support (assuming git is installed).
It's probably safe to assume (since the project relies on submodules) that the user has git installed, so this will stop configuration rather than display a warning and then stop with a confusing error.
@codecov-io
Copy link

codecov-io commented Oct 15, 2019

Codecov Report

Merging #5162 into develop will decrease coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5162      +/-   ##
===========================================
- Coverage    67.25%   67.19%   -0.07%     
===========================================
  Files         1155     1149       -6     
  Lines        94461    94247     -214     
===========================================
- Hits         63534    63328     -206     
+ Misses       30927    30919       -8
Flag Coverage Δ
#cproversmt2 42.72% <ø> (+0.07%) ⬆️
#regression 63.71% <ø> (-0.03%) ⬇️
#unit 31.92% <ø> (-0.05%) ⬇️
Impacted Files Coverage Δ
src/analyses/loop_analysis.h 96% <0%> (-4%) ⬇️
src/util/expr.cpp 63.86% <0%> (-1.18%) ⬇️
src/solvers/strings/string_refinement.cpp 87.84% <0%> (-0.69%) ⬇️
src/goto-symex/symex_main.cpp 87.19% <0%> (-0.55%) ⬇️
jbmc/src/jbmc/jbmc_parse_options.cpp 71.56% <0%> (-0.42%) ⬇️
src/goto-symex/symex_function_call.cpp 86.71% <0%> (-0.28%) ⬇️
src/solvers/smt2/smt2_parser.cpp 66.92% <0%> (-0.06%) ⬇️
src/util/object_factory_parameters.h 100% <0%> (ø) ⬆️
src/solvers/smt2/smt2_parser.h 100% <0%> (ø) ⬆️
src/goto-symex/path_storage.h 100% <0%> (ø) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1cb10ad...069c761. Read the comment docs.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: ecce25f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132017019
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

@LAJW
Copy link
Contributor Author

LAJW commented Oct 16, 2019

Edit: fixup - I misunderstood how/where ansi_c_library_sources file was created

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 676cb0b).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132178299
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: 7707605).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132184613

@LAJW LAJW requested a review from thk123 as a code owner October 16, 2019 21:12
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: 85d15a5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132325446

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: 069c761).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132328171

@LAJW
Copy link
Contributor Author

LAJW commented Oct 17, 2019

@peterschrammel windows/cmake codebuild added (with ninja and clcache)!

@peterschrammel
Copy link
Member

@kroening, @tautschnig, this is ready to go.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 1cf0056).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132386896
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: 519a802).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132408233

@tautschnig tautschnig merged commit ec65596 into diffblue:develop Oct 18, 2019
@LAJW LAJW deleted the lajw/visual-studio-native branch October 19, 2019 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants