Skip to content
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

Improve Windows build support #760

Merged
merged 17 commits into from
Jun 21, 2024
Merged

Improve Windows build support #760

merged 17 commits into from
Jun 21, 2024

Conversation

mtmk
Copy link
Contributor

@mtmk mtmk commented May 30, 2024

Added vcpkg.json as package manifest for dependencies. Changed the build options in CMakeLists.txt by specifying the output directories to make sure DLLs are copied next to executables for Windows debugging in an IDE (e.g. Visual Studio or CLion) Disabled the build of NATS streaming for windows builds since protobuf-c dependency doesn't seem to be working properly, and it's deprecated anyway. Further, updated .gitignore to exclude Visual Studio related files and the 'out' directory which VS seems to use by default for build output.

mtmk added 2 commits May 30, 2024 21:52
Added vcpkg.json as package manifest for dependencies.
Changed the build options in CMakeLists.txt by specifying the output
directories to make sure DLLs are copied next to executables for
Windows debugging in an IDE (e.g. Visual Studio or CLion)
Disabled the build of NATS streaming since protobuf-c dependency
doesn't seem to be working properly, and it's deprecated anyway.
Further, updated .gitignore to exclude Visual Studio related files and
the 'out' directory which VS seems to use by default for build output.
Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.72%. Comparing base (1cb8d8c) to head (b85395a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #760      +/-   ##
==========================================
+ Coverage   68.68%   68.72%   +0.03%     
==========================================
  Files          39       39              
  Lines       15186    15186              
  Branches     3139     3139              
==========================================
+ Hits        10431    10437       +6     
+ Misses       1702     1695       -7     
- Partials     3053     3054       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@levb levb self-requested a review May 31, 2024 14:40
Copy link
Collaborator

@levb levb left a comment

Choose a reason for hiding this comment

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

LGTM

@levb levb requested a review from kozlovic May 31, 2024 15:36
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
# Set output directories for libraries and executables.
# This is important for Windows builds to have the DLLs in the same directory as the executables.
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@kozlovic Do you think this may break any existing user build scripts? As I understand, this should not affect make install results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fyi just compared make install results for this PR and main on a couple of docker container diffs and they were identical:

A /usr/local/include/nats.h
A /usr/local/include/nats/adapters/libevent.h
A /usr/local/include/nats/adapters/libuv.h
A /usr/local/include/nats/nats.h
A /usr/local/include/nats/status.h
A /usr/local/include/nats/version.h
A /usr/local/lib/cmake/cnats/cnats-config-release.cmake
A /usr/local/lib/cmake/cnats/cnats-config.cmake
A /usr/local/lib/libnats.so
A /usr/local/lib/libnats.so.3.9
A /usr/local/lib/libnats.so.3.9.0
A /usr/local/lib/libnats_static.a
A /usr/local/lib/pkgconfig/libnats.pc

@levb levb marked this pull request as ready for review May 31, 2024 15:38
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

If the purpose of this PR is to have build for Windows on GH, then I think it is good, although the build logs there report a bunch of warnings (that I don't get when I compile on my Windows VM). As far of testing, this PR generates the test list but does not run the tests. Is that expected? Based on answer, I will LGTM or not. Thanks!

- name: Test
run: |
cd build
./bin/Debug/testsuite
Copy link
Member

Choose a reason for hiding this comment

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

This does not run the test suite, it just builds the list of tests. Was it intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that was my intention to have a GH Windows build and improved debugging experience using VS and CLion on Windows. I propose we address testing in a follow up PR.

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM

@levb levb merged commit 1553d4a into main Jun 21, 2024
16 checks passed
@levb levb deleted the mtmk-windows-build branch June 21, 2024 15:30
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.

3 participants