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

Support MacOS #157

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,20 @@ What is working:
- Calling RPCs (unary + streaming)
- Input and output of all protocol buffer types
- Security: SSL is supported
- Performance: Caching of reflection queries

Some notable things which are not yet working:

- Using Proto files instead of Reflection API (currently gWhisper only works with servers which have reflection enabled)
- Performance: Caching of reflection queries

## Supported platforms

Development and testing is done on Fedora Linux 33 and Arch Linux.
We expect no bigger problems with building and running this software on different linux distributions.
We support the following platforms:
- Linux
- MacOS

Development is done on Fedora Linux and Arch Linux.
CI tests are run on `ubuntu-latest` and `macos-latest` GitHub Action runners.

## Reporting issues

Expand Down
14 changes: 14 additions & 0 deletions cmake/filesystem.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(FILESYSTEM_LIB "")

# Check for the the need to link FS library
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
message(STATUS "Using GCC version less than 9.1, linking with -lstdc++fs")
set(FILESYSTEM_LIB stdc++fs)
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
message(STATUS "Using Clang version less than 9.0, linking with -lc++fs")
set(FILESYSTEM_LIB c++fs)
endif()
endif()
7 changes: 5 additions & 2 deletions src/libLocalDescriptorCache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.


include(filesystem)

set(TARGET_NAME "DescDbProxy")
set(TARGET_SRC
Expand All @@ -32,6 +32,9 @@ target_link_libraries(${TARGET_NAME}
version
reflection
cli
stdc++fs
)

# Link FS library if required:
if (FILESYSTEM_LIB)
target_link_libraries(${TARGET_NAME} PRIVATE ${MANUAL_FILESYSTEM_LIB})
endif()
13 changes: 6 additions & 7 deletions src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

include(filesystem)

set(TARGET_NAME "gwhisperUtils")
set(TARGET_SRC
./gwhisperUtils.cpp
Expand All @@ -21,11 +23,8 @@ target_include_directories(${TARGET_NAME}
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/..
)


target_link_libraries(${TARGET_NAME}
stdc++fs
)



# Link FS library if required:
if (FILESYSTEM_LIB)
target_link_libraries(${TARGET_NAME} PRIVATE ${MANUAL_FILESYSTEM_LIB})
endif()
2 changes: 1 addition & 1 deletion tests/functionTests/runFunctionTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def prGreen(text): print("\033[92m {}\033[00m" .format(text))
for expectedLine in expected:
if len(expected)>len(received):
fail = True
failtext = "Test '{}' at line {} received not enough lines.".format(testname, testline)
failtext = "Test '{}' at line {} received not enough lines. expected: {}, received: {}".format(testname, testline, expected, received)
break
if(len(expected) <= idx):
if(expectedLine.startswith("?")):
Expand Down
32 changes: 23 additions & 9 deletions tests/testServer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,32 @@ MakeKeyCert
target_link_libraries(${TARGET_NAME}
PUBLIC
${TARGET_NAME}_protobuf

# we need to link the whole reflection lib, even though the compiler might
# think we do not use any symbols. (This is because gRPC dynamically
# checks if reflection is linked and has no hard dependency on any symbols
# there)
# This is done with --no-as-needed in case we link dynamically and
# --whole-archive in case we link statically.
-Wl,--push-state,--no-as-needed,--whole-archive ${LIB_GRPC++_REFLECTION} -Wl,--pop-state

protoDoc
gwhisperUtils
)

if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_link_libraries(${TARGET_NAME}
PUBLIC
${TARGET_NAME}_protobuf
${LIB_GRPC++_REFLECTION}
)
else()
target_link_libraries(${TARGET_NAME}
PUBLIC
${TARGET_NAME}_protobuf
# on linux we need to link the whole reflection lib, even though the compiler might
# think we do not use any symbols. (This is because gRPC dynamically
# checks if reflection is linked and has no hard dependency on any symbols
# there)
# This is done with --no-as-needed in case we link dynamically and
# --whole-archive in case we link statically.
-Wl,--push-state,--no-as-needed,--whole-archive ${LIB_GRPC++_REFLECTION} -Wl,--pop-state
)

endif()



add_custom_command(
OUTPUT cert-key-pair/ca.crt cert-key-pair/ca.key cert-key-pair/ca.srl cert-key-pair/client_crt.pem cert-key-pair/client_csr.pem cert-key-pair/client_key.pem cert-key-pair/server_crt.pem cert-key-pair/server_csr.pem cert-key-pair/server_key.pem
Expand Down
Loading