diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df02e65..498918e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,87 +9,238 @@ on: permissions: contents: write - packages: read + packages: write jobs: - build: + builder-image: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Log in to Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,arm' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Extract Docker Metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }}/raceboat-builder + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{raw}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + + - name: Configure Docker Caching + id: cache + uses: int128/docker-build-cache-config-action@v1 + with: + image: ghcr.io/${{ github.repository }}/raceboat-builder/cache + + - name: Build and Push raceboat-builder Docker Image + uses: docker/build-push-action@v4 + with: + context: raceboat-builder-image + file: raceboat-builder-image/Dockerfile + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: ${{ steps.cache.outputs.cache-from }} + cache-to: ${{ steps.cache.outputs.cache-to }} + + build-framework: + needs: [builder-image] runs-on: ubuntu-latest container: - image: ghcr.io/tst-race/race-images/race-compile:main - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + image: ghcr.io/tst-race/raceboat/raceboat-builder:${{ github.head_ref || github.ref_name }} steps: - name: Checkout uses: actions/checkout@v3 - name: Build - run: ./build_it_all.sh - - - name: Build-pt - run: ./pluggable-transport/build.sh -p=build/LINUX_x86_64/language-shims/source/include/src/core + run: ./build.sh - name: Create Build Artifact - # NOTE: _commsPluginBindings.so not in racesdk/package/ - run: "tar cvf ${{ github.event.repository.name }}.tar.gz -C racesdk/package/ ." + run: "tar cvf ${{ github.event.repository.name }}.tar.gz -C /__w/raceboat/raceboat/ ./racesdk" - name: Upload Build Artifact uses: actions/upload-artifact@v3 with: - name: "${{ github.event.repository.name }}-linux-x86_64.tar.gz" - path: "${{ github.event.repository.name }}-linux-x86_64.tar.gz" + name: "${{ github.event.repository.name }}.tar.gz" + path: "${{ github.event.repository.name }}.tar.gz" retention-days: 10 - # todo base these on the raceboat image - test-unit: - # needs: build + compile-image: + needs: [build-framework] runs-on: ubuntu-latest - container: - image: ghcr.io/tst-race/race-images/race-compile:main - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} steps: - - name: unit test + - name: Checkout uses: actions/checkout@v3 - - name: Build and Run Unit Tests - # shuffle the order of the tests to potentially uncover weirdness - # note that you can reproduce the test results by finding the seed in the log output and - # setting the environment variable GTEST_RANDOM_SEED to that value. - env: - GTEST_SHUFFLE: 1 - run: | - ./build_it_all.sh - cmake --build --preset=LINUX_x86_64 --target run_tests -j - test-coverage: - # needs: build + - name: Download Framework Artifacts + uses: actions/download-artifact@v3 + with: + name: "${{ github.event.repository.name }}.tar.gz" + + - name: debug ls + run: ls -R . + + - name: untar + run: tar xf ${{ github.event.repository.name }}.tar.gz + + - name: debug ls + run: ls -R racesdk + + - name: debu pwdg + run: pwd + + - name: env + run: env + + - name: Log in to Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,arm' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Extract Docker Metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }}/raceboat-compile + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{raw}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + + - name: Configure Docker Caching + id: cache + uses: int128/docker-build-cache-config-action@v1 + with: + image: ghcr.io/${{ github.repository }}/raceboat-compile/cache + + - name: Build and Push raceboat-compile Docker Image + uses: docker/build-push-action@v4 + with: + context: /home/runner/work/raceboat/raceboat + file: raceboat-compile-image/Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: ${{ steps.cache.outputs.cache-from }} + cache-to: ${{ steps.cache.outputs.cache-to }} + + run-tests: + needs: [compile-image] runs-on: ubuntu-latest container: - image: ghcr.io/tst-race/race-images/race-compile:main + image: ghcr.io/tst-race/raceboat/raceboat-compile:${{ github.head_ref || github.ref_name }} steps: - name: Checkout uses: actions/checkout@v3 - - name: Build and Run Unit Tests - # shuffle the order of the tests to potentially uncover weirdness - # note that you can reproduce the test results by finding the seed in the log output and - # setting the environment variable GTEST_RANDOM_SEED to that value. - env: - GTEST_SHUFFLE: 1 - run: | - cmake --preset=coverage - cmake --build --preset=coverage --target coverage - test-format: - # needs: build + - name: Test + run: ./test.sh + + runtime-image: + needs: [compile-image] runs-on: ubuntu-latest - container: - image: ghcr.io/tst-race/race-images/race-compile:main steps: - name: Checkout uses: actions/checkout@v3 - - name: Check Format - run: | - ./build_it_all.sh - cmake --build --preset=LINUX_x86_64 --target check_format -j + - name: Download Framework Artifacts + uses: actions/download-artifact@v3 + with: + name: "${{ github.event.repository.name }}.tar.gz" + + - name: debug ls + run: ls -R . + + - name: untar + run: tar xf ${{ github.event.repository.name }}.tar.gz + + - name: debug ls + run: ls -R racesdk + + - name: debu pwdg + run: pwd + + - name: env + run: env + + - name: Log in to Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,arm' + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Extract Docker Metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }}/raceboat-runtime + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{raw}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + + - name: Configure Docker Caching + id: cache + uses: int128/docker-build-cache-config-action@v1 + with: + image: ghcr.io/${{ github.repository }}/raceboat-runtime/cache + + - name: Build and Push raceboat-runtime Docker Image + uses: docker/build-push-action@v4 + with: + context: /home/runner/work/raceboat/raceboat + file: raceboat-runtime-image/Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: ${{ steps.cache.outputs.cache-from }} + cache-to: ${{ steps.cache.outputs.cache-to }} + build-contexts: ghcr.io/tst-race/raceboat/raceboat-compile=docker-image://ghcr.io/tst-race/raceboat/raceboat-compile:${{ steps.meta.outputs.version }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b56a97..3260356 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,8 +42,8 @@ include(race/test-targets) include(race/valgrind) include(race/warnings) -# setup_project_test_targets(raceSdkCommon UNIT INTEGRATION) -# setup_project_format_targets(raceSdkCommon) +setup_project_test_targets(raceSdkCommon UNIT INTEGRATION) +setup_project_format_targets(raceSdkCommon) add_subdirectory(language-shims) add_subdirectory(source) @@ -54,6 +54,12 @@ if(NOT ANDROID) add_subdirectory(test/common/DecomposedTestStub EXCLUDE_FROM_ALL) add_subdirectory(test/common/plugins/DecomposedTestImplementation EXCLUDE_FROM_ALL) add_subdirectory(test/source EXCLUDE_FROM_ALL) + install( + TARGETS + race-cli + bridge-distro + RUNTIME DESTINATION app + ) endif() # Create this after all subdirectories have been added @@ -63,6 +69,7 @@ install( TARGETS raceSdkCommon EXPORT raceSdkCommon + RUNTIME DESTINATION app LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include ) diff --git a/README.md b/README.md index 9472ad4..f8d5f45 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,66 @@ Raceboat provides two different interfaces for censorship circumvention channels ## **Building** -Raceboat uses a docker-based build process, running the below may take some time to download the compilation image. This build command also creates a `raceboat` docker image with the shared objects and executable built into it for easy testing and execution. +Raceboat uses a docker-based build process, running the below may take some time to download the compilation image. This build command also creates a `raceboat` runtumie docker image with the shared objects and executable built into it for easy testing and execution. **These are all built in GitHub CI and available from the `ghcr.io/tst-race/raceboat` namespace. + +- `ghcr.io/tst-race/raceboat/raceboat-builder:main`: an image for building the raceboat framework itself (i.e. the code in this repository) + +- `ghcr.io/tst-race/raceboat/raceboat-compile:main`: extension of the raceboat-builder with prebuilt framework binaries, used to compile plugins that provide channels or components for raceboat to use. + +- `ghcr.io/tst-race/raceboat/raceboat:main`: runtime image which contains both prebuilt framework binaries and runtime dependencies. + +Use the following commands to build a local set of x86_64 images: ```bash +pushd raceboat-builder-image && \ +./build_image.sh -n ghcr.io/tst-race/raceboat --platform-x86_64 && \ +popd && \ docker run -it --rm --name=build-pt \ -e MAKEFLAGS="-j" \ -v $(pwd)/:/code/ \ -w /code \ - raceboat-builder:main \ - ./build.sh && docker-image/build_image.sh + raceboat-builder:latest \ + ./build.sh && \ +pushd raceboat-compile-image && \ +./build_image.sh -n ghcr.io/tst-race/raceboat --platform-x86_64 && \ +popd && \ +pushd runtime-image && \ +./build_image.sh -n ghcr.io/tst-race/raceboat --platform-x86_64 && \ +popd +``` + +To build an aarch64 raceboat image locally: + +```bash +./raceboat-builder-image/build_image.sh --platform-arm64 +./raceboat-compile-image/build_image.sh --platform-arm64 +docker run -it --rm -v $(pwd):/code/ -w /code raceboat-builder:latest bash +rm -fr build +export MAKEFLAGS="-j" +./build_it_all.sh +./create-package.sh --linux-arm64 +exit +./docker-image/build_image.sh --platform-arm64 +``` + +(Some) host dependencies: +- golang v1.23.1 (change in build files if another version is preferred) + +## **Building Plugins** + +Users can compile plugins/channels with the resulting raceboat-compile:. For example: + +```bash +cd ../race-obfs +rm -fr build +rm -fr kit +./build_artifacts_in_docker_image.sh -l -v latest +cp -fr kit/artifacts/linux--server/PluginObfs ../raceboat/kits ``` ## **Running** -The following commands run the different Raceboat modes using a simple TCP socket called `twoSixDirectCpp` provided by `PluginCommsTwoSixStub` and assumes you have downloaded or built that plugin and placed it in a `kits` directory that is volume-mounted into the docker container (this is the easiest development process for testing your own plugins/channels). _You can get a copy of some prebuilt kits for both arm64-v8a and x86_64 processors [here](https://github.com/tst-race/raceboat/releases/download/pets24/kits.tgz). +The following commands run the different Raceboat modes using a simple TCP socket called `twoSixDirectCpp` provided by `PluginCommsTwoSixStub` and assumes you have downloaded or built that plugin and placed it in a `kits` directory that is volume-mounted into the docker container (this is the easiest development process for testing your own plugins/channels). _You can get a copy of some prebuilt kits for both arm64-v8a and x86_64 processors [here](https://github.com/tst-race/raceboat/releases/download/pets24/kits.tgz). Download the prebuilt kits, extract the compressed folder, then copy the contents of the architecture specific files to ./kits (e.g ./kits/PluginCommsTwoSixStub). In each case, you need to run two raceboat instances, we conventionally refer to these as a "client" and a "server"; generally the server should be started first (this isn't _necessary_ for some channels, but _is_ necessary when using a direct IP connection like `twoSixDirectCpp`). @@ -40,8 +86,8 @@ This is a unidirectional single-message push from the client to the server. docker run --rm -it --name=rbserver \ --network=raceboat-network \ --ip=10.11.1.3 \ - -v $(pwd)/../kits:/server-kits \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + -v $(pwd)/kits:/server-kits \ + raceboat:latest bash -c \ 'race-cli -m --recv --quiet \ --dir /server-kits \ --recv-channel=twoSixDirectCpp \ @@ -58,8 +104,8 @@ __NOTE__: This outputs a line `Listening on {"hostname":"10.11.1.3","port":26262 docker run --rm -it --name=rbclient \ --network=raceboat-network \ --ip=10.11.1.4 \ - -v $(pwd)/../kits:/client-kits -v $(pwd):/code -w /code \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + -v $(pwd)/kits:/client-kits -v $(pwd):/code -w /code \ + raceboat:latest bash -c \ 'echo "Raceboat Client says Hello " \ | race-cli -m --send --quiet \ --dir /client-kits \ @@ -83,8 +129,8 @@ There is a "fork" of the race-cli called `bridge-distro` which demonstrates adap docker run --rm -it --name=rbserver \ --network=raceboat-network \ --ip=10.11.1.3 \ - -v $(pwd)/../kits:/server-kits \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + -v $(pwd)/kits:/server-kits \ + raceboat:latest bash -c \ 'echo "Welcome, I am the Raceboat Server" \ | race-cli -m --recv-reply --quiet \ --dir /server-kits \ @@ -100,8 +146,8 @@ docker run --rm -it --name=rbserver \ docker run --rm -it --name=rbclient \ --network=raceboat-network \ --ip=10.11.1.4 \ - -v $(pwd)/../kits:/client-kits \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + -v $(pwd)/kits:/client-kits \ + raceboat:latest bash -c \ 'echo "Raceboat Client says Hello " \ | race-cli -m --send-recv --quiet \ --dir /client-kits \ @@ -127,8 +173,8 @@ For exemplary purposes, we use `netcat` as the server application. docker run --rm --name=rbserver -d \ --network=raceboat-network \ --ip=10.11.1.3 \ - -v $(pwd)/../kits:/server-kits \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + -v $(pwd)/kits:/server-kits \ + raceboat:latest bash -c \ 'race-cli -m --server-bootstrap-connect --quiet \ --dir /server-kits \ --recv-channel=twoSixDirectCpp \ @@ -148,8 +194,8 @@ docker exec -it rbserver bash -c 'nc -l localhost 7777' docker run --rm -it --name=rbclient -d \ --network=raceboat-network \ --ip=10.11.1.4 \ - -v $(pwd)/../kits:/client-kits \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + -v $(pwd)/kits:/client-kits \ + raceboat:latest bash -c \ 'race-cli -m --client-bootstrap-connect --quiet \ --dir /client-kits \ --recv-channel=twoSixDirectCpp \ @@ -174,9 +220,9 @@ One of the motivating use-cases for Raceboat is for bridge distribution. We have docker run --rm -it --name=rbserver \ --network=raceboat-network \ --ip=10.11.1.3 \ - -v $(pwd)/../kits:/server-kits \ + -v $(pwd)/kits:/server-kits \ -v $(pwd)/scripts:/scripts \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + raceboat:latest bash -c \ 'echo "Welcome, I am the Raceboat Server" \ | bridge-distro --quiet \ --passphrase bridge-please \ @@ -195,8 +241,8 @@ docker run --rm -it --name=rbserver \ docker run --rm -it --name=rbclient \ --network=raceboat-network \ --ip=10.11.1.4 \ - -v $(pwd)/../kits:/client-kits \ - ghcr.io/tst-race/raceboat/raceboat:latest bash -c \ + -v $(pwd)/kits:/client-kits \ + raceboat:latest bash -c \ 'echo "bridge-please" \ | race-cli -m --send-recv --quiet \ --dir /client-kits \ diff --git a/build.sh b/build.sh index 841705e..c95b918 100755 --- a/build.sh +++ b/build.sh @@ -19,24 +19,6 @@ set -e CMAKE_ARGS="" -CORE_BINDINGS_GOLANG_BINARY_DIR="" - -for i in "$@" -do - key="$1" - echo "key $1" - case $key in - -p=*) - CORE_BINDINGS_GOLANG_BINARY_DIR="${1#*=}" - shift - ;; - - # echo "unknown argument \"$1\"" - # exit 1 - # ;; - esac -done - LINUX_PRESET=LINUX_x86_64 ARCH=x86_64 @@ -46,20 +28,6 @@ then ARCH=arm64-v8a fi -if [ -z "$CORE_BINDINGS_GOLANG_BINARY_DIR" ] -then - DEFAULT_GOLANG_PATH="/code/build/LINUX_${ARCH}/language-shims/source/include/src/core" - echo "INFO: No -p argument, assuming golang install path is: ${DEFAULT_GOLANG_PATH}" - CMAKE_ARGS="-DCORE_BINDINGS_GOLANG_BINARY_DIR=${DEFAULT_GOLANG_PATH}" - # echo "ERROR: golang install path required (eg ./build.sh -p build/LINUX/language-shims/source/include/src)" -else - # CMAKE_ARGS="-DCORE_BINDINGS_GOLANG_BINARY_DIR=${CORE_BINDINGS_GOLANG_BINARY_DIR} -D CMAKE_LIBRARY_PATH=/code/racesdk/package/LINUX_x86_64/lib/" - echo "path: $CORE_BINDINGS_GOLANG_BINARY_DIR" - CMAKE_ARGS="-DCORE_BINDINGS_GOLANG_BINARY_DIR="$CORE_BINDINGS_GOLANG_BINARY_DIR - - echo "golang install path $CORE_BINDINGS_GOLANG_BINARY_DIR" -fi - cmake --preset=$LINUX_PRESET -DBUILD_VERSION="local" --debug-output -DCXX="clang++ -std=c++17" cmake --build -j --preset=$LINUX_PRESET --target install @@ -86,16 +54,12 @@ else # cmake --build -j --preset=ANDROID_arm64-v8a --target install fi -mkdir -p /usr/local/go +# mkdir -p /usr/local/go -cp -r racesdk/package/${LINUX_PRESET}/lib/* /linux/${ARCH}/lib -export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/${ARCH}/lib" -mkdir -p /linux/${ARCH}/include/race/common -cp -r racesdk/package/${LINUX_PRESET}/include/* /linux/${ARCH}/include/race/common/ -cp /linux/${ARCH}/include/race/common/Race.h /linux/${ARCH}/include/race/ -cp -r racesdk/package/${LINUX_PRESET}/go/* /usr/local/go/* +# cp -r racesdk/package/${LINUX_PRESET}/lib/* /linux/${ARCH}/lib +# export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/${ARCH}/lib" +# mkdir -p /linux/${ARCH}/include/race/common +# cp -r racesdk/package/${LINUX_PRESET}/include/* /linux/${ARCH}/include/race/common/ +# cp /linux/${ARCH}/include/race/common/Race.h /linux/${ARCH}/include/race/ +# cp -r racesdk/package/${LINUX_PRESET}/go/* /usr/local/go/* -pushd pluggable-transport -cmake --preset=$LINUX_PRESET -DBUILD_VERSION="local" ${CMAKE_ARGS} -cmake --build -j --preset=$LINUX_PRESET --target install --verbose -cp -r racesdk/package/${LINUX_PRESET}/lib/race/raceDispatcher ../racesdk/package/${LINUX_PRESET}/lib/raceDispatcher diff --git a/build_it_all.sh b/build_it_all.sh deleted file mode 100755 index bedb0b6..0000000 --- a/build_it_all.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2023 Two Six Technologies -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -set -e - -LINUX_PRESET=LINUX_x86_64 -if [ "$(uname -m)" == "aarch64" ] || [ "$(uname -m)" == "arm64" ] -then - LINUX_PRESET=LINUX_arm64-v8a -fi - -cmake --preset=$LINUX_PRESET -DBUILD_VERSION="local" -cmake --build -j --preset=$LINUX_PRESET --target install - -if [ "$(uname -m)" == "x86_64" ] -then - cmake --preset=ANDROID_x86_64 -DBUILD_VERSION="local" - cmake --build -j --preset=ANDROID_x86_64 --target install - - cmake --preset=ANDROID_arm64-v8a -DBUILD_VERSION="local" - cmake --build -j --preset=ANDROID_arm64-v8a --target install -else - echo "android build not supported on aarch64 arch" - # cmake -DANDROID_STL="c++_shared -frtti" -DBUILD_VERSION="local" -DCXX="/opt/android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" - # cmake --build -j -DANDROID_STL="c++_shared -frtti" -DCXX="/opt/android/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" --target install - # cmake --build -j --preset=ANDROID_arm64-v8a --target install -fi diff --git a/docker-image/Dockerfile b/docker-image/Dockerfile deleted file mode 100644 index 1b93e00..0000000 --- a/docker-image/Dockerfile +++ /dev/null @@ -1,64 +0,0 @@ - -# Copyright 2023 Two Six Technologies -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# TODO: from race-compile:main once arm platform supported -FROM --platform=$TARGETPLATFORM ghcr.io/tst-race/race-images/race-runtime-linux:main as base -LABEL maintainer="Two Six Labs " - -ARG TARGETARCH -RUN echo "building for architecture $TARGETARCH" - -# Copy locally-built artifacts into the image -# Note: If you are adding new artifacts you may -# need to update the .dockerignore file -# so that they are included in the docker -# context. Otherwise the COPY may fail. - - -# x86-64 linux -FROM base as amd64-linux -COPY racesdk/package/LINUX_x86_64/lib /linux/x86_64/lib -# RUN ln -s /linux/x86_64/lib/libraceboat.so /linux/x86_64/lib/libraceSdkCommon.so -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/x86_64/lib" -COPY build/LINUX_x86_64/app/race-cli/race-cli /usr/local/bin/race-cli -COPY build/LINUX_x86_64/app/bridge-distro/bridge-distro /usr/local/bin/bridge-distro - -# preserve include structure assumed by go SWIG -RUN mkdir -p /linux/x86_64/include/race/common -COPY racesdk/package/LINUX_x86_64/include /linux/x86_64/include/race/common -RUN cp /linux/x86_64/include/race/common/Race.h /linux/x86_64/include/race/ -COPY racesdk/package/LINUX_x86_64/go /usr/local/go - -# arm64 linux -FROM base as arm64-linux -COPY racesdk/package/LINUX_arm64-v8a/lib /linux/arm64-v8a/lib -# RUN ln -s /linux/arm64-v8a/lib/libraceboat.so /linux/arm64-v8a/lib/libraceSdkCommon.so -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/arm64-v8a/lib" -COPY build/LINUX_arm64-v8a/app/race-cli/race-cli/ /usr/local/bin/race-cli -COPY build/LINUX_arm64-v8a/app/bridge-distro/bridge-distro/ /usr/local/bin/bridge-distro - -# preserve include structure assumed by go SWIG -RUN mkdir -p /linux/arm64-v8a/include/race/common -COPY racesdk/package/LINUX_arm64-v8a/include /linux/arm64-v8a/include/race/common -RUN cp /linux/arm64-v8a/include/race/common/Race.h /linux/arm64-v8a/include/race/ -COPY racesdk/package/LINUX_arm64-v8a/go /usr/local/go - - -FROM ${TARGETARCH}-linux -COPY race-cmake-modules /opt/race/race-cmake-modules - -RUN apt-get update && apt-get install ncat - diff --git a/include/race/Race.h b/include/race/Race.h index feeb083..8177974 100644 --- a/include/race/Race.h +++ b/include/race/Race.h @@ -22,8 +22,8 @@ #include #include -#include "common/ChannelId.h" -#include "common/RaceHandle.h" +#include "ChannelId.h" +#include "RaceHandle.h" namespace Raceboat { diff --git a/include/race/common/ChannelProperties.h b/include/race/common/ChannelProperties.h index 2fdd9e0..3713ebc 100644 --- a/include/race/common/ChannelProperties.h +++ b/include/race/common/ChannelProperties.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __CHANNEL_PROPERTIES_H_ -#define __CHANNEL_PROPERTIES_H_ +#ifndef CHANNEL_PROPERTIES_H +#define CHANNEL_PROPERTIES_H #include #include diff --git a/include/race/common/ChannelRole.h b/include/race/common/ChannelRole.h index 78c3498..5fcdf44 100644 --- a/include/race/common/ChannelRole.h +++ b/include/race/common/ChannelRole.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_CHANNEL_ROLE_H_ -#define __RACE_CHANNEL_ROLE_H_ +#ifndef RACE_CHANNEL_ROLE_H +#define RACE_CHANNEL_ROLE_H #include #include diff --git a/include/race/common/ChannelStatus.h b/include/race/common/ChannelStatus.h index 21a065d..3ba7571 100644 --- a/include/race/common/ChannelStatus.h +++ b/include/race/common/ChannelStatus.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_CHANNEL_STATUS_H_ -#define __RACE_CHANNEL_STATUS_H_ +#ifndef RACE_CHANNEL_STATUS_H +#define RACE_CHANNEL_STATUS_H #include diff --git a/include/race/common/ConnectionStatus.h b/include/race/common/ConnectionStatus.h index a29ff2c..4ac96b0 100644 --- a/include/race/common/ConnectionStatus.h +++ b/include/race/common/ConnectionStatus.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_CONNECTION_STATUS_H_ -#define __RACE_CONNECTION_STATUS_H_ +#ifndef RACE_CONNECTION_STATUS_H +#define RACE_CONNECTION_STATUS_H #include #include diff --git a/include/race/common/ConnectionType.h b/include/race/common/ConnectionType.h index bfe63cc..7434709 100644 --- a/include/race/common/ConnectionType.h +++ b/include/race/common/ConnectionType.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_CONNECTION_TYPE_H_ -#define __RACE_CONNECTION_TYPE_H_ +#ifndef RACE_CONNECTION_TYPE_H +#define RACE_CONNECTION_TYPE_H #include diff --git a/include/race/common/Defer.h b/include/race/common/Defer.h index 3f0caf6..f374a44 100644 --- a/include/race/common/Defer.h +++ b/include/race/common/Defer.h @@ -14,9 +14,7 @@ // limitations under the License. // -#pragma clang diagnostic ignored "-Wreserved-identifier" #ifndef RACE_DEFER_H -#pragma clang diagnostic ignored "-Wreserved-identifier" #define RACE_DEFER_H #include // std::move diff --git a/include/race/common/EncPkg.h b/include/race/common/EncPkg.h index 623514b..0618462 100644 --- a/include/race/common/EncPkg.h +++ b/include/race/common/EncPkg.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __ENC_PKG_ -#define __ENC_PKG_ +#ifndef ENC_PKG +#define ENC_PKG #include #include diff --git a/include/race/common/LinkProperties.h b/include/race/common/LinkProperties.h index b5f36bb..ff922b5 100644 --- a/include/race/common/LinkProperties.h +++ b/include/race/common/LinkProperties.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __LINK_PROPERTIES_H_ -#define __LINK_PROPERTIES_H_ +#ifndef LINK_PROPERTIES_H +#define LINK_PROPERTIES_H #include #include diff --git a/include/race/common/LinkPropertyPair.h b/include/race/common/LinkPropertyPair.h index 67d1147..7ced4f8 100644 --- a/include/race/common/LinkPropertyPair.h +++ b/include/race/common/LinkPropertyPair.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __LINK_PROPERTY_PAIR_H_ -#define __LINK_PROPERTY_PAIR_H_ +#ifndef LINK_PROPERTY_PAIR_H +#define LINK_PROPERTY_PAIR_H #include #include diff --git a/include/race/common/LinkPropertySet.h b/include/race/common/LinkPropertySet.h index 8691cc7..af7985d 100644 --- a/include/race/common/LinkPropertySet.h +++ b/include/race/common/LinkPropertySet.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __LINK_PROPERTY_SET_H_ -#define __LINK_PROPERTY_SET_H_ +#ifndef LINK_PROPERTY_SET_H +#define LINK_PROPERTY_SET_H #include #include diff --git a/include/race/common/LinkStatus.h b/include/race/common/LinkStatus.h index b12e66d..60d2c11 100644 --- a/include/race/common/LinkStatus.h +++ b/include/race/common/LinkStatus.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_LINK_STATUS_H_ -#define __RACE_LINK_STATUS_H_ +#ifndef RACE_LINK_STATUS_H +#define RACE_LINK_STATUS_H #include #include diff --git a/include/race/common/LinkType.h b/include/race/common/LinkType.h index f2f22ff..bd18c24 100644 --- a/include/race/common/LinkType.h +++ b/include/race/common/LinkType.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_LINK_TYPE_H_ -#define __RACE_LINK_TYPE_H_ +#ifndef RACE_LINK_TYPE_H +#define RACE_LINK_TYPE_H #include diff --git a/include/race/common/PackageStatus.h b/include/race/common/PackageStatus.h index 82be37b..09fa39f 100644 --- a/include/race/common/PackageStatus.h +++ b/include/race/common/PackageStatus.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_PACKAGE_STATUS_H_ -#define __RACE_PACKAGE_STATUS_H_ +#ifndef RACE_PACKAGE_STATUS_H +#define RACE_PACKAGE_STATUS_H #include diff --git a/include/race/common/PackageType.h b/include/race/common/PackageType.h index b995a42..125ffe7 100644 --- a/include/race/common/PackageType.h +++ b/include/race/common/PackageType.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_PACKAGE_TYPE_H_ -#define __RACE_PACKAGE_TYPE_H_ +#ifndef RACE_PACKAGE_TYPE_H +#define RACE_PACKAGE_TYPE_H #include diff --git a/include/race/common/PluginConfig.h b/include/race/common/PluginConfig.h index a4b4513..658f51b 100644 --- a/include/race/common/PluginConfig.h +++ b/include/race/common/PluginConfig.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __PLUGIN_CONFIG_H_ -#define __PLUGIN_CONFIG_H_ +#ifndef PLUGIN_CONFIG_H +#define PLUGIN_CONFIG_H #include diff --git a/include/race/common/PluginResponse.h b/include/race/common/PluginResponse.h index eb152bc..8d35517 100644 --- a/include/race/common/PluginResponse.h +++ b/include/race/common/PluginResponse.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_PLUGIN_RESPONSE_H_ -#define __RACE_PLUGIN_RESPONSE_H_ +#ifndef RACE_PLUGIN_RESPONSE_H +#define RACE_PLUGIN_RESPONSE_H #include diff --git a/include/race/common/RaceEnums.h b/include/race/common/RaceEnums.h index b5ed912..c0e0ccd 100644 --- a/include/race/common/RaceEnums.h +++ b/include/race/common/RaceEnums.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_ENUMS_H_ -#define __RACE_ENUMS_H_ +#ifndef RACE_ENUMS_H +#define RACE_ENUMS_H #include @@ -75,4 +75,4 @@ enum BootstrapActionType { } // namespace RaceEnums -#endif \ No newline at end of file +#endif diff --git a/include/race/common/RaceExport.h b/include/race/common/RaceExport.h index 43196a4..ad3623f 100644 --- a/include/race/common/RaceExport.h +++ b/include/race/common/RaceExport.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __EXPORTS_H_ -#define __EXPORTS_H_ +#ifndef EXPORTS_H +#define EXPORTS_H #if defined(_WIN32) #define EXPORT __declspec(dllexport) diff --git a/include/race/common/RaceLog.h b/include/race/common/RaceLog.h index e9f2d5b..c3ae0be 100644 --- a/include/race/common/RaceLog.h +++ b/include/race/common/RaceLog.h @@ -14,9 +14,7 @@ // limitations under the License. // -#pragma clang diagnostic ignored "-Wreserved-identifier" #ifndef RACE_LOG_H -#pragma clang diagnostic ignored "-Wreserved-identifier" #define RACE_LOG_H #include diff --git a/include/race/common/RacePluginExports.h b/include/race/common/RacePluginExports.h index 50d0c38..4463316 100644 --- a/include/race/common/RacePluginExports.h +++ b/include/race/common/RacePluginExports.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_PLUGIN_EXPORTS_H_ -#define __RACE_PLUGIN_EXPORTS_H_ +#ifndef RACE_PLUGIN_EXPORTS_H +#define RACE_PLUGIN_EXPORTS_H #include "RaceExport.h" diff --git a/include/race/common/SendType.h b/include/race/common/SendType.h index c13cd72..7af9854 100644 --- a/include/race/common/SendType.h +++ b/include/race/common/SendType.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_SEND_TYPE_H_ -#define __RACE_SEND_TYPE_H_ +#ifndef RACE_SEND_TYPE_H +#define RACE_SEND_TYPE_H #include diff --git a/include/race/common/TransmissionType.h b/include/race/common/TransmissionType.h index 587bc98..802edab 100644 --- a/include/race/common/TransmissionType.h +++ b/include/race/common/TransmissionType.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __RACE_TRANSMISSION_TYPE_H_ -#define __RACE_TRANSMISSION_TYPE_H_ +#ifndef RACE_TRANSMISSION_TYPE_H +#define RACE_TRANSMISSION_TYPE_H #include diff --git a/include/race/decomposed/ComponentTypes.h b/include/race/decomposed/ComponentTypes.h index 1e77a15..4a2f445 100644 --- a/include/race/decomposed/ComponentTypes.h +++ b/include/race/decomposed/ComponentTypes.h @@ -15,14 +15,14 @@ // limitations under the License. // -#ifndef __I_COMPONENT_TYPES_H__ -#define __I_COMPONENT_TYPES_H__ +#ifndef I_COMPONENT_TYPES_H +#define I_COMPONENT_TYPES_H #include #include #include -#include "../common/RaceHandle.h" +#include "RaceHandle.h" using LinkID = std::string; diff --git a/include/race/decomposed/IComponentBase.h b/include/race/decomposed/IComponentBase.h index 1928962..ba7becf 100644 --- a/include/race/decomposed/IComponentBase.h +++ b/include/race/decomposed/IComponentBase.h @@ -15,8 +15,8 @@ // limitations under the License. // -#ifndef __I_COMPONENT_BASE_H__ -#define __I_COMPONENT_BASE_H__ +#ifndef I_COMPONENT_BASE_H_ +#define I_COMPONENT_BASE_H_ #include "ComponentTypes.h" diff --git a/include/race/decomposed/IComponentSdkBase.h b/include/race/decomposed/IComponentSdkBase.h index 87ac3b6..27490bd 100644 --- a/include/race/decomposed/IComponentSdkBase.h +++ b/include/race/decomposed/IComponentSdkBase.h @@ -15,8 +15,8 @@ // limitations under the License. // -#ifndef __I_COMPONENT_SDK_BASE_H__ -#define __I_COMPONENT_SDK_BASE_H__ +#ifndef I_COMPONENT_SDK_BASE_H_ +#define I_COMPONENT_SDK_BASE_H_ #include "IComponentBase.h" diff --git a/include/race/decomposed/IEncodingComponent.h b/include/race/decomposed/IEncodingComponent.h index 560c1c6..b96450a 100644 --- a/include/race/decomposed/IEncodingComponent.h +++ b/include/race/decomposed/IEncodingComponent.h @@ -15,11 +15,11 @@ // limitations under the License. // -#ifndef __I_ENCODING_COMPONENT_H__ -#define __I_ENCODING_COMPONENT_H__ +#ifndef I_ENCODING_COMPONENT_H_ +#define I_ENCODING_COMPONENT_H_ -#include "../common/PluginConfig.h" -#include "../common/RacePluginExports.h" +#include "PluginConfig.h" +#include "RacePluginExports.h" #include "ComponentTypes.h" #include "IComponentBase.h" #include "IEncodingSdk.h" diff --git a/include/race/decomposed/IEncodingSdk.h b/include/race/decomposed/IEncodingSdk.h index 24f26ec..70f1ba5 100644 --- a/include/race/decomposed/IEncodingSdk.h +++ b/include/race/decomposed/IEncodingSdk.h @@ -15,8 +15,8 @@ // limitations under the License. // -#ifndef __I_ENCODING_SDK_H__ -#define __I_ENCODING_SDK_H__ +#ifndef I_ENCODING_SDK_H_ +#define I_ENCODING_SDK_H_ #include diff --git a/include/race/decomposed/ITransportComponent.h b/include/race/decomposed/ITransportComponent.h index f02cf9d..cb7ba5d 100644 --- a/include/race/decomposed/ITransportComponent.h +++ b/include/race/decomposed/ITransportComponent.h @@ -15,12 +15,12 @@ // limitations under the License. // -#ifndef __I_TRANSPORT_COMPONENT_H__ -#define __I_TRANSPORT_COMPONENT_H__ +#ifndef I_TRANSPORT_COMPONENT_H_ +#define I_TRANSPORT_COMPONENT_H_ -#include "../common/LinkProperties.h" -#include "../common/PluginConfig.h" -#include "../common/RacePluginExports.h" +#include "LinkProperties.h" +#include "PluginConfig.h" +#include "RacePluginExports.h" #include "ComponentTypes.h" #include "ITransportSdk.h" diff --git a/include/race/decomposed/ITransportSdk.h b/include/race/decomposed/ITransportSdk.h index b710445..a6e88d4 100644 --- a/include/race/decomposed/ITransportSdk.h +++ b/include/race/decomposed/ITransportSdk.h @@ -15,12 +15,12 @@ // limitations under the License. // -#ifndef __I_TRANSPORT_SDK_H__ -#define __I_TRANSPORT_SDK_H__ +#ifndef I_TRANSPORT_SDK_H_ +#define I_TRANSPORT_SDK_H_ -#include "../common/ChannelProperties.h" -#include "../common/LinkStatus.h" -#include "../common/PackageStatus.h" +#include "ChannelProperties.h" +#include "LinkStatus.h" +#include "PackageStatus.h" #include "ComponentTypes.h" #include "IComponentSdkBase.h" diff --git a/include/race/decomposed/IUserModelComponent.h b/include/race/decomposed/IUserModelComponent.h index b9d54c7..283d8e8 100644 --- a/include/race/decomposed/IUserModelComponent.h +++ b/include/race/decomposed/IUserModelComponent.h @@ -15,11 +15,11 @@ // limitations under the License. // -#ifndef __I_USER_MODEL_COMPONENT_H__ -#define __I_USER_MODEL_COMPONENT_H__ +#ifndef I_USER_MODEL_COMPONENT_H_ +#define I_USER_MODEL_COMPONENT_H_ -#include "../common/PluginConfig.h" -#include "../common/RacePluginExports.h" +#include "PluginConfig.h" +#include "RacePluginExports.h" #include "ComponentTypes.h" #include "IUserModelSdk.h" diff --git a/include/race/decomposed/IUserModelSdk.h b/include/race/decomposed/IUserModelSdk.h index 395e70d..573ec20 100644 --- a/include/race/decomposed/IUserModelSdk.h +++ b/include/race/decomposed/IUserModelSdk.h @@ -15,8 +15,8 @@ // limitations under the License. // -#ifndef __I_USER_MODEL_SDK_H__ -#define __I_USER_MODEL_SDK_H__ +#ifndef I_USER_MODEL_SDK_H_ +#define I_USER_MODEL_SDK_H_ #include "IComponentSdkBase.h" diff --git a/include/race/unified/IRacePluginComms.h b/include/race/unified/IRacePluginComms.h index a0233b0..90584b0 100644 --- a/include/race/unified/IRacePluginComms.h +++ b/include/race/unified/IRacePluginComms.h @@ -14,18 +14,18 @@ // limitations under the License. // -#ifndef __I_RACE_PLUGIN_COMMS_H_ -#define __I_RACE_PLUGIN_COMMS_H_ +#ifndef I_RACE_PLUGIN_COMMS_H +#define I_RACE_PLUGIN_COMMS_H #include -#include "../common/ChannelProperties.h" -#include "../common/EncPkg.h" -#include "../common/LinkProperties.h" -#include "../common/PluginConfig.h" -#include "../common/PluginResponse.h" -#include "../common/RacePluginExports.h" -#include "../common/constants.h" +#include "ChannelProperties.h" +#include "EncPkg.h" +#include "LinkProperties.h" +#include "PluginConfig.h" +#include "PluginResponse.h" +#include "RacePluginExports.h" +#include "constants.h" #include "IRaceSdkComms.h" class IRacePluginComms { diff --git a/include/race/unified/IRaceSdkCommon.h b/include/race/unified/IRaceSdkCommon.h index b22af66..ca17634 100644 --- a/include/race/unified/IRaceSdkCommon.h +++ b/include/race/unified/IRaceSdkCommon.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef __I_RACE_SDK_COMMON_H_ -#define __I_RACE_SDK_COMMON_H_ +#ifndef I_RACE_SDK_COMMON_H +#define I_RACE_SDK_COMMON_H #include #include @@ -23,11 +23,11 @@ #include #include -#include "../common/ChannelProperties.h" -#include "../common/EncPkg.h" -#include "../common/PluginResponse.h" -#include "../common/constants.h" -// #include "common/RaceEnums.h" +#include "ChannelProperties.h" +#include "EncPkg.h" +#include "PluginResponse.h" +#include "constants.h" +// #include "RaceEnums.h" #include "SdkResponse.h" class IRaceSdkCommon { diff --git a/include/race/unified/IRaceSdkComms.h b/include/race/unified/IRaceSdkComms.h index 3709e69..cc9952a 100644 --- a/include/race/unified/IRaceSdkComms.h +++ b/include/race/unified/IRaceSdkComms.h @@ -14,19 +14,19 @@ // limitations under the License. // -#ifndef __I_RACE_SDK_COMMS_H_ -#define __I_RACE_SDK_COMMS_H_ +#ifndef I_RACE_SDK_COMMS_H +#define I_RACE_SDK_COMMS_H #include -#include "../common/ChannelProperties.h" -#include "../common/ChannelStatus.h" -#include "../common/ConnectionStatus.h" -#include "../common/EncPkg.h" -#include "../common/LinkProperties.h" -#include "../common/LinkStatus.h" -#include "../common/PackageStatus.h" -#include "../common/RaceEnums.h" +#include "ChannelProperties.h" +#include "ChannelStatus.h" +#include "ConnectionStatus.h" +#include "EncPkg.h" +#include "LinkProperties.h" +#include "LinkStatus.h" +#include "PackageStatus.h" +#include "RaceEnums.h" #include "IRaceSdkCommon.h" #include "SdkResponse.h" diff --git a/include/race/unified/SdkResponse.h b/include/race/unified/SdkResponse.h index c8d23bc..351965f 100644 --- a/include/race/unified/SdkResponse.h +++ b/include/race/unified/SdkResponse.h @@ -19,7 +19,7 @@ #include #include -#include "../common/RaceHandle.h" +#include "RaceHandle.h" extern "C" { diff --git a/language-shims/source/commsPluginBindings.golang.i b/language-shims/source/commsPluginBindings.golang.i index 345aecd..eece730 100644 --- a/language-shims/source/commsPluginBindings.golang.i +++ b/language-shims/source/commsPluginBindings.golang.i @@ -9,29 +9,29 @@ #include #include -#include "race/common/constants.h" - -#include "race/common/ChannelProperties.h" -#include "race/common/ChannelRole.h" -#include "race/common/ChannelStatus.h" -#include "race/common/ConnectionStatus.h" -#include "race/common/ConnectionType.h" -#include "race/common/EncPkg.h" -#include "race/common/LinkProperties.h" -#include "race/common/LinkPropertyPair.h" -#include "race/common/LinkPropertySet.h" -#include "race/common/LinkStatus.h" -#include "race/common/LinkType.h" -#include "race/common/PackageStatus.h" -#include "race/common/PackageType.h" -#include "race/common/PackageStatus.h" -#include "race/common/PluginConfig.h" -#include "race/common/PluginResponse.h" -#include "race/common/RaceEnums.h" -#include "race/common/RaceHandle.h" -#include "race/common/RaceLog.h" -#include "race/common/SendType.h" -#include "race/common/TransmissionType.h" +#include "constants.h" + +#include "ChannelProperties.h" +#include "ChannelRole.h" +#include "ChannelStatus.h" +#include "ConnectionStatus.h" +#include "ConnectionType.h" +#include "EncPkg.h" +#include "LinkProperties.h" +#include "LinkPropertyPair.h" +#include "LinkPropertySet.h" +#include "LinkStatus.h" +#include "LinkType.h" +#include "PackageStatus.h" +#include "PackageType.h" +#include "PackageStatus.h" +#include "PluginConfig.h" +#include "PluginResponse.h" +#include "RaceEnums.h" +#include "RaceHandle.h" +#include "RaceLog.h" +#include "SendType.h" +#include "TransmissionType.h" #include "race/decomposed/ComponentTypes.h" #include "race/decomposed/IComponentBase.h" diff --git a/language-shims/source/commsPluginBindings.i b/language-shims/source/commsPluginBindings.i index 16eeca9..adae9c8 100644 --- a/language-shims/source/commsPluginBindings.i +++ b/language-shims/source/commsPluginBindings.i @@ -7,29 +7,29 @@ #include #include -#include "race/common/constants.h" - -#include "race/common/ChannelProperties.h" -#include "race/common/ChannelRole.h" -#include "race/common/ChannelStatus.h" -#include "race/common/ConnectionStatus.h" -#include "race/common/ConnectionType.h" -#include "race/common/EncPkg.h" -#include "race/common/LinkProperties.h" -#include "race/common/LinkPropertyPair.h" -#include "race/common/LinkPropertySet.h" -#include "race/common/LinkStatus.h" -#include "race/common/LinkType.h" -#include "race/common/PackageStatus.h" -#include "race/common/PackageType.h" -#include "race/common/PackageStatus.h" -#include "race/common/PluginConfig.h" -#include "race/common/PluginResponse.h" -#include "race/common/RaceEnums.h" -#include "race/common/RaceHandle.h" -#include "race/common/RaceLog.h" -#include "race/common/SendType.h" -#include "race/common/TransmissionType.h" +#include "constants.h" + +#include "ChannelProperties.h" +#include "ChannelRole.h" +#include "ChannelStatus.h" +#include "ConnectionStatus.h" +#include "ConnectionType.h" +#include "EncPkg.h" +#include "LinkProperties.h" +#include "LinkPropertyPair.h" +#include "LinkPropertySet.h" +#include "LinkStatus.h" +#include "LinkType.h" +#include "PackageStatus.h" +#include "PackageType.h" +#include "PackageStatus.h" +#include "PluginConfig.h" +#include "PluginResponse.h" +#include "RaceEnums.h" +#include "RaceHandle.h" +#include "RaceLog.h" +#include "SendType.h" +#include "TransmissionType.h" #include "race/decomposed/ComponentTypes.h" #include "race/decomposed/IComponentBase.h" diff --git a/language-shims/source/corePluginBindings.golang.i b/language-shims/source/corePluginBindings.golang.i index 32aded6..18b45c8 100644 --- a/language-shims/source/corePluginBindings.golang.i +++ b/language-shims/source/corePluginBindings.golang.i @@ -6,10 +6,10 @@ %{ #include #include -#include "race/common/ChannelId.h" -#include "race/common/RaceHandle.h" +#include "ChannelId.h" +#include "RaceHandle.h" #include "race/Race.h" -#include "race/common/RaceLog.h" +#include "RaceLog.h" using namespace Raceboat; %} diff --git a/pluggable-transport/build.sh b/pluggable-transport/build.sh index b20c8e0..40fe1f6 100755 --- a/pluggable-transport/build.sh +++ b/pluggable-transport/build.sh @@ -39,13 +39,19 @@ do esac done +INUX_PRESET=LINUX_x86_64 +ARCH=x86_64 if [ -z "$CORE_BINDINGS_GOLANG_BINARY_DIR" ] then - echo "path: $CORE_BINDINGS_GOLANG_BINARY_DIR" - echo "ERROR: golang install path required (eg ./build.sh -p build/LINUX/language-shims/source/include/src)" - exit 1 + DEFAULT_GOLANG_PATH="/code/build/LINUX_${ARCH}/language-shims/source/include/src/core" + echo "INFO: No -p argument, assuming golang install path is: ${DEFAULT_GOLANG_PATH}" + CMAKE_ARGS="-DCORE_BINDINGS_GOLANG_BINARY_DIR=${DEFAULT_GOLANG_PATH}" + # echo "ERROR: golang install path required (eg ./build.sh -p build/LINUX/language-shims/source/include/src)" else + # CMAKE_ARGS="-DCORE_BINDINGS_GOLANG_BINARY_DIR=${CORE_BINDINGS_GOLANG_BINARY_DIR} -D CMAKE_LIBRARY_PATH=/code/racesdk/package/LINUX_x86_64/lib/" + echo "path: $CORE_BINDINGS_GOLANG_BINARY_DIR" CMAKE_ARGS="-DCORE_BINDINGS_GOLANG_BINARY_DIR="$CORE_BINDINGS_GOLANG_BINARY_DIR + echo "golang install path $CORE_BINDINGS_GOLANG_BINARY_DIR" fi diff --git a/pluggable-transport/source/pkg/race_pt3/CMakeLists.txt b/pluggable-transport/source/pkg/race_pt3/CMakeLists.txt index 935f299..33ca83f 100644 --- a/pluggable-transport/source/pkg/race_pt3/CMakeLists.txt +++ b/pluggable-transport/source/pkg/race_pt3/CMakeLists.txt @@ -31,8 +31,8 @@ set(PT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PT_FILE_NAME}) set(GOMOD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/go.mod) set(GOCMD go build -work -o ${PT_FILE}) -message("MESSAGE RACE_COMM_INCLUDE_PATH ${RACE_COMM_INCLUDE_PATH}") -message("MESSAGE RACE_COMM_LIB_INSTALL_PATH ${RACE_COMM_LIB_INSTALL_PATH}") +message("MESSAGE RACE_COMM_INCLUDE_PATH $ENV{RACE_COMM_INCLUDE_PATH}") +message("MESSAGE RACE_COMM_LIB_INSTALL_PATH $ENV{RACE_COMM_LIB_INSTALL_PATH}") list(APPEND CGO_CXXFLAGS "-I$ENV{RACE_COMM_LIB_INSTALL_PATH}/include") list(APPEND CGO_CXXFLAGS "-I$ENV{RACE_COMM_INCLUDE_PATH}") list(APPEND CGO_LDFLAGS "-L$ENV{RACE_COMM_LIB_INSTALL_PATH}/lib") diff --git a/race-cmake-modules/race/lint.cmake b/race-cmake-modules/race/lint.cmake index e7e5bae..cb9f8c9 100644 --- a/race-cmake-modules/race/lint.cmake +++ b/race-cmake-modules/race/lint.cmake @@ -38,7 +38,6 @@ function(setup_clang_tidy_for_target) set(CLANG_TIDY_CMD clang-tidy-15 -checks=${CLANG_TIDY_CHECKS} - -warnings-as-errors=* -header-filter=.* ) set_target_properties(${CLANG_TIDY_TARGET} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_CMD}") diff --git a/raceboat-builder-image/Dockerfile b/raceboat-builder-image/Dockerfile index 379b9e1..6e4c3b1 100644 --- a/raceboat-builder-image/Dockerfile +++ b/raceboat-builder-image/Dockerfile @@ -77,20 +77,25 @@ RUN case ${TARGETPLATFORM} in \ --directory=/usr/local && \ rm /tmp/swig-*.tar.gz +# non-interactive install mode workaround to python prerequisite tzdata ENV DEBIAN_FRONTEND=noninteractive -ARG PYTHON_VERSION=3.12.7 -RUN apt-get update -y && \ - add-apt-repository ppa:deadsnakes/ppa -y && \ - apt-get update -y && \ - apt-get install -y --no-install-recommends \ - python3.12=${PYTHON_VERSION}-* \ - python3.12-dev=${PYTHON_VERSION}-* \ +# RUN apt update && apt install tzdata + +# Python 3.12 +ARG PYTHON_VERSION=3.12 +RUN apt update && \ + apt install software-properties-common -y --no-install-recommends + +RUN add-apt-repository ppa:deadsnakes/ppa -y && \ + apt update && \ + apt install -y --no-install-recommends \ + python3.12 \ + python3.12-dev \ python3-pip \ python3-setuptools \ python3-wheel \ - python3.12-tk=${PYTHON_VERSION}-* \ - python3.12-distutils - + python3.12-tk + RUN apt-get install -y \ valgrind @@ -160,6 +165,19 @@ RUN for ARCH in x86_64 arm64-v8a; do \ done && \ rm /tmp/python-*.tar.gz +# Cppcheck (Linux-only) +ARG CPPCHECK_VERSION=2.4.1-1 +RUN case ${TARGETPLATFORM} in \ + "linux/amd64") LINUX_ARCH=x86_64 ;; \ + "linux/arm64") LINUX_ARCH=arm64-v8a ;; \ + esac && \ + wget \ + --output-document=/tmp/cppcheck-${CPPCHECK_VERSION}-linux-${LINUX_ARCH}.tar.gz \ + https://github.com/tst-race/ext-cppcheck/releases/download/${CPPCHECK_VERSION}/cppcheck-${CPPCHECK_VERSION}-linux-${LINUX_ARCH}.tar.gz && \ + tar --extract \ + --file=/tmp/cppcheck-${CPPCHECK_VERSION}-linux-${LINUX_ARCH}.tar.gz \ + --directory=/usr/local && \ + rm /tmp/cppcheck-*.tar.gz COPY ./android-x86_64.toolchain.cmake /opt/android/ndk/default/ COPY ./android-arm64-v8a.toolchain.cmake /opt/android/ndk/default/ diff --git a/raceboat-compile-image/Dockerfile b/raceboat-compile-image/Dockerfile index d53c52a..a25a10d 100644 --- a/raceboat-compile-image/Dockerfile +++ b/raceboat-compile-image/Dockerfile @@ -14,49 +14,25 @@ # limitations under the License. # -# TODO: from race-compile:main once arm platform supported -FROM --platform=$TARGETPLATFORM ghcr.io/tst-race/raceboat/raceboat-builder:latest as base +FROM --platform=$TARGETPLATFORM ghcr.io/tst-race/raceboat/raceboat-builder:latest AS base LABEL maintainer="Two Six Labs " ARG TARGETARCH RUN echo "building for architecture $TARGETARCH" -# Copy locally-built artifacts into the image -# Note: If you are adding new artifacts you may -# need to update the .dockerignore file -# so that they are included in the docker -# context. Otherwise the COPY may fail. - - # x86-64 linux -FROM base as amd64-linux +FROM base AS amd64-linux COPY racesdk/package/LINUX_x86_64/lib /linux/x86_64/lib -# RUN ln -s /linux/x86_64/lib/libraceboat.so /linux/x86_64/lib/libraceSdkCommon.so ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/x86_64/lib" -COPY build/LINUX_x86_64/app/race-cli/race-cli /usr/local/bin/race-cli -COPY build/LINUX_x86_64/app/bridge-distro/bridge-distro /usr/local/bin/bridge-distro - -# preserve include structure assumed by go SWIG -RUN mkdir -p /linux/x86_64/include/race/common -COPY racesdk/package/LINUX_x86_64/include /linux/x86_64/include/race/common COPY racesdk/package/LINUX_x86_64/include /linux/x86_64/include/ -RUN cp /linux/x86_64/include/race/common/*.h /linux/x86_64/include/race/ COPY racesdk/package/LINUX_x86_64/go /usr/local/go RUN cp /usr/local/go/src/shims/comm/* /usr/local/go/src/shims/ # arm64 linux -FROM base as arm64-linux +FROM base AS arm64-linux COPY racesdk/package/LINUX_arm64-v8a/lib /linux/arm64-v8a/lib -# RUN ln -s /linux/arm64-v8a/lib/libraceboat.so /linux/arm64-v8a/lib/libraceSdkCommon.so -ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/arm64-v8a/lib" -COPY build/LINUX_arm64-v8a/app/race-cli/race-cli /usr/local/bin/race-cli -COPY build/LINUX_arm64-v8a/app/bridge-distro/bridge-distro /usr/local/bin/bridge-distro - -# preserve include structure assumed by go SWIG -RUN mkdir -p /linux/arm64-v8a/include/race/common -COPY racesdk/package/LINUX_arm64-v8a/include /linux/arm64-v8a/include/race/common +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/linux/arm64-v8a/lib" COPY racesdk/package/LINUX_arm64-v8a/include /linux/arm64-v8a/include/ -RUN cp /linux/arm64-v8a/include/race/common/*.h /linux/arm64-v8a/include/race/ COPY racesdk/package/LINUX_arm64-v8a/go /usr/local/go RUN cp /usr/local/go/src/shims/comm/* /usr/local/go/src/shims/ diff --git a/raceboat-runtime-image/Dockerfile b/raceboat-runtime-image/Dockerfile new file mode 100644 index 0000000..2c906ac --- /dev/null +++ b/raceboat-runtime-image/Dockerfile @@ -0,0 +1,35 @@ + +# Copyright 2023 Two Six Technologies +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM --platform=$TARGETPLATFORM ghcr.io/tst-race/raceboat/raceboat-compile:latest as base +LABEL maintainer="Two Six Labs " + +ARG TARGETARCH +RUN echo "building for architecture $TARGETARCH" + +# x86-64 linux +FROM base as amd64-linux +COPY racesdk/package/LINUX_x86_64/app/race-cli /usr/local/bin/race-cli +COPY racesdk/package/LINUX_x86_64/app/bridge-distro /usr/local/bin/bridge-distro + +# arm64 linux +FROM base as arm64-linux +COPY racesdk/package/LINUX_arm64-v8a/app/race-cli /usr/local/bin/race-cli +COPY racesdk/package/LINUX_arm64-v8a/app/bridge-distro /usr/local/bin/bridge-distro + + +FROM ${TARGETARCH}-linux +RUN apt-get update && yes | apt-get install ncat # for example / test / debug diff --git a/docker-image/README.md b/raceboat-runtime-image/README.md similarity index 76% rename from docker-image/README.md rename to raceboat-runtime-image/README.md index c3a3362..838ed07 100644 --- a/docker-image/README.md +++ b/raceboat-runtime-image/README.md @@ -2,7 +2,7 @@ ## Building on M1 Mac -Currently there is no support for building x86 artifacts on M1 Macs. It is still possible to build raceboat Docker images, however they will only include ARM artifacts. To build the Docker image follows these steps (all paths are relative to the root of the project). +Currently there is no support for building x86 artifacts on M1 Macs. It is still possible to build raceboat Docker images, however they will only include ARM artifacts. To build the Docker image follow these steps (all paths are relative to the root of the project). Note that it may be necessary to `rm -fr build` to clear out stale incompatible image components. 1. From inside a `race-compile` container build the linux artifacts: ```bash @@ -15,7 +15,7 @@ Currently there is no support for building x86 artifacts on M1 Macs. It is still ``` 2. From you host machine build the image: ```bash - ./build_raceboat_image.sh --platform-arm64 + ./docker-image/build_image.sh --platform-arm64 ``` 3. Start the new container, and confirm the desired architecture is as expected ```bash diff --git a/docker-image/build_image.sh b/raceboat-runtime-image/build_image.sh similarity index 100% rename from docker-image/build_image.sh rename to raceboat-runtime-image/build_image.sh diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index f1a7c76..df74ea0 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -89,20 +89,36 @@ add_library(raceSdkCommon SHARED UserInput.cpp ) -#Add the headers to the shared library +#Add public headers to the shared library file(GLOB_RECURSE COMM_LIB_PUBLIC_HEADERS CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*.h ) + + set_target_properties(raceSdkCommon PROPERTIES - PUBLIC_HEADER "${COMM_LIB_PUBLIC_HEADERS}" + PUBLIC_HEADER "${COMM_LIB_PUBLIC_HEADERS}" ) + +# BUILD_INTERFACE and INSTALL_INTERFACE used to specify different include paths that are relevant to your project in different build contexts +# - BUILD_INTERFACE - Specifies properties that should be used when building the project in the build tree +# - INSTALL_INTERFACE - Specifies properties that should be used when the project is installed (built and copied to installation dir for use by other projects) target_include_directories(raceSdkCommon PUBLIC $ + $ + $ + $ + $ $ $ + PRIVATE + $ + $ + $ + $ ) + file(GLOB_RECURSE COMM_LIB_PRIVATE_HEADERS CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.h ) diff --git a/source/Composition.h b/source/Composition.h index b63d25d..2eb46f4 100644 --- a/source/Composition.h +++ b/source/Composition.h @@ -19,7 +19,7 @@ #include #include "PluginDef.h" -#include "race/common/RaceEnums.h" +#include "RaceEnums.h" namespace Raceboat { diff --git a/source/Core.h b/source/Core.h index e368259..727ce66 100644 --- a/source/Core.h +++ b/source/Core.h @@ -17,16 +17,16 @@ #pragma once #include "UserInput.h" -#include "api-managers/ApiManager.h" -#include "api-managers/ChannelManager.h" -#include "plugin-loading/Config.h" -#include "plugin-loading/PluginLoader.h" -#include "race/Race.h" -#include "race/common/ConnectionStatus.h" -#include "race/common/LinkStatus.h" -#include "race/common/PackageStatus.h" -#include "race/common/PluginResponse.h" -#include "race/common/RaceHandle.h" +#include "ApiManager.h" +#include "ChannelManager.h" +#include "Config.h" +#include "PluginLoader.h" +#include "Race.h" +#include "ConnectionStatus.h" +#include "LinkStatus.h" +#include "PackageStatus.h" +#include "PluginResponse.h" +#include "RaceHandle.h" class EncPkg; diff --git a/source/Handler.h b/source/Handler.h index df520e0..a9dd1d0 100644 --- a/source/Handler.h +++ b/source/Handler.h @@ -29,7 +29,7 @@ #include #include "helper.h" -#include "race/common/constants.h" +#include "constants.h" namespace Raceboat { diff --git a/source/PluginDef.h b/source/PluginDef.h index 7721f4f..d16c48b 100644 --- a/source/PluginDef.h +++ b/source/PluginDef.h @@ -21,7 +21,7 @@ #include #include -#include "race/common/RaceEnums.h" +#include "RaceEnums.h" namespace Raceboat { diff --git a/source/PluginWrapper.h b/source/PluginWrapper.h index 242fa0e..d3717cb 100644 --- a/source/PluginWrapper.h +++ b/source/PluginWrapper.h @@ -21,7 +21,7 @@ #include "Handler.h" #include "SdkWrapper.h" -#include "race/unified/IRacePluginComms.h" +#include "IRacePluginComms.h" namespace Raceboat { diff --git a/source/SdkWrapper.h b/source/SdkWrapper.h index 8bd569c..5371e4e 100644 --- a/source/SdkWrapper.h +++ b/source/SdkWrapper.h @@ -17,7 +17,7 @@ #pragma once #include "PluginContainer.h" -#include "race/unified/IRaceSdkComms.h" +#include "IRaceSdkComms.h" namespace Raceboat { class Core; diff --git a/source/UserInput.h b/source/UserInput.h index ea966ea..fdf89f0 100644 --- a/source/UserInput.h +++ b/source/UserInput.h @@ -18,7 +18,7 @@ #include -#include "race/Race.h" +#include "Race.h" namespace Raceboat { diff --git a/source/api-managers/ApiManager.h b/source/api-managers/ApiManager.h index f93316b..09f5102 100644 --- a/source/api-managers/ApiManager.h +++ b/source/api-managers/ApiManager.h @@ -25,7 +25,7 @@ #include #include -#include "../../include/race/Race.h" +#include "Race.h" #include "../../include/race/unified/SdkResponse.h" #include "../state-machine/ApiContext.h" #include "../state-machine/ConduitStateMachine.h" @@ -41,13 +41,13 @@ #include "../state-machine/SendReceiveStateMachine.h" #include "../state-machine/SendStateMachine.h" #include "Handler.h" -#include "race/common/ChannelProperties.h" -#include "race/common/ConnectionStatus.h" -#include "race/common/LinkProperties.h" -#include "race/common/LinkStatus.h" -#include "race/common/PackageStatus.h" -#include "race/common/PluginResponse.h" -#include "race/common/RaceHandle.h" +#include "ChannelProperties.h" +#include "ConnectionStatus.h" +#include "LinkProperties.h" +#include "LinkStatus.h" +#include "PackageStatus.h" +#include "PluginResponse.h" +#include "RaceHandle.h" class EncPkg; diff --git a/source/api-managers/ChannelManager.h b/source/api-managers/ChannelManager.h index adf1662..2b5e876 100644 --- a/source/api-managers/ChannelManager.h +++ b/source/api-managers/ChannelManager.h @@ -18,9 +18,9 @@ #include -#include "race/common/ChannelId.h" -#include "race/common/ChannelProperties.h" -#include "race/common/RaceHandle.h" +#include "ChannelId.h" +#include "ChannelProperties.h" +#include "RaceHandle.h" namespace Raceboat { class Core; diff --git a/source/decomposed/ComponentManagerTypes.h b/source/decomposed/ComponentManagerTypes.h index 598a594..372d642 100644 --- a/source/decomposed/ComponentManagerTypes.h +++ b/source/decomposed/ComponentManagerTypes.h @@ -25,8 +25,8 @@ #include #include -#include "race/common/EncPkg.h" -#include "race/common/LinkProperties.h" // ConnectionID, LinkID +#include "EncPkg.h" +#include "LinkProperties.h" // ConnectionID, LinkID #include "race/decomposed/ComponentTypes.h" namespace Raceboat { diff --git a/source/decomposed/ComponentPackageManager.h b/source/decomposed/ComponentPackageManager.h index b061363..4b08556 100644 --- a/source/decomposed/ComponentPackageManager.h +++ b/source/decomposed/ComponentPackageManager.h @@ -25,7 +25,7 @@ #include "Composition.h" #include "SdkWrappers.h" #include "plugin-loading/ComponentPlugin.h" -#include "race/common/PluginResponse.h" +#include "PluginResponse.h" namespace Raceboat { diff --git a/source/helper.h b/source/helper.h index 53128de..31bde04 100644 --- a/source/helper.h +++ b/source/helper.h @@ -20,8 +20,8 @@ #include #include -#include "race/common/PluginResponse.h" -#include "race/common/RaceLog.h" +#include "PluginResponse.h" +#include "RaceLog.h" namespace Raceboat { namespace helper { diff --git a/source/plugin-loading/ComponentPlugin.h b/source/plugin-loading/ComponentPlugin.h index 966a795..344d077 100644 --- a/source/plugin-loading/ComponentPlugin.h +++ b/source/plugin-loading/ComponentPlugin.h @@ -20,7 +20,7 @@ #include "DynamicLibrary.h" #include "IComponentPlugin.h" -#include "race/common/PluginConfig.h" +#include "PluginConfig.h" #include "race/decomposed/IEncodingComponent.h" #include "race/decomposed/ITransportComponent.h" #include "race/decomposed/IUserModelComponent.h" diff --git a/source/plugin-loading/CompositeWrapper.h b/source/plugin-loading/CompositeWrapper.h index ff73cbc..1846b0e 100644 --- a/source/plugin-loading/CompositeWrapper.h +++ b/source/plugin-loading/CompositeWrapper.h @@ -27,7 +27,7 @@ #include "SdkWrapper.h" #include "decomposed/ComponentManager.h" #include "helper.h" -#include "race/common/RacePluginExports.h" +#include "RacePluginExports.h" namespace Raceboat { diff --git a/source/plugin-loading/Config.h b/source/plugin-loading/Config.h index 899a2aa..c646b07 100644 --- a/source/plugin-loading/Config.h +++ b/source/plugin-loading/Config.h @@ -23,7 +23,7 @@ #include "Composition.h" #include "FileSystem.h" #include "PluginDef.h" -#include "race/common/ChannelProperties.h" +#include "ChannelProperties.h" namespace Raceboat { /** diff --git a/source/plugin-loading/DecomposedPluginLoader.h b/source/plugin-loading/DecomposedPluginLoader.h index 7a279a3..2e9b1a8 100644 --- a/source/plugin-loading/DecomposedPluginLoader.h +++ b/source/plugin-loading/DecomposedPluginLoader.h @@ -24,7 +24,7 @@ #include "PluginDef.h" #include "PluginLoader.h" #include "PythonComponentPlugin.h" -#include "race/common/RaceEnums.h" +#include "RaceEnums.h" namespace Raceboat { diff --git a/source/plugin-loading/IComponentPlugin.h b/source/plugin-loading/IComponentPlugin.h index 295f4aa..f0375c2 100644 --- a/source/plugin-loading/IComponentPlugin.h +++ b/source/plugin-loading/IComponentPlugin.h @@ -17,7 +17,7 @@ #pragma once #include -#include "race/common/PluginConfig.h" +#include "PluginConfig.h" #include "race/decomposed/IEncodingComponent.h" #include "race/decomposed/ITransportComponent.h" #include "race/decomposed/IUserModelComponent.h" diff --git a/source/plugin-loading/LoaderWrapper.h b/source/plugin-loading/LoaderWrapper.h index 07ab03d..d561d23 100644 --- a/source/plugin-loading/LoaderWrapper.h +++ b/source/plugin-loading/LoaderWrapper.h @@ -26,7 +26,7 @@ #include "PluginWrapper.h" #include "SdkWrapper.h" #include "helper.h" -#include "race/common/RacePluginExports.h" +#include "RacePluginExports.h" namespace Raceboat { diff --git a/source/plugin-loading/PluginLoader.h b/source/plugin-loading/PluginLoader.h index 5052a4c..8473614 100644 --- a/source/plugin-loading/PluginLoader.h +++ b/source/plugin-loading/PluginLoader.h @@ -18,7 +18,7 @@ #include "Composition.h" #include "PluginContainer.h" -#include "race/common/ChannelId.h" +#include "ChannelId.h" namespace Raceboat { diff --git a/source/plugin-loading/PythonComponentPlugin.h b/source/plugin-loading/PythonComponentPlugin.h index d434e7a..851e96d 100644 --- a/source/plugin-loading/PythonComponentPlugin.h +++ b/source/plugin-loading/PythonComponentPlugin.h @@ -20,7 +20,7 @@ #include #include "IComponentPlugin.h" -#include "race/common/PluginConfig.h" +#include "PluginConfig.h" #include "race/decomposed/IEncodingComponent.h" #include "race/decomposed/ITransportComponent.h" #include "race/decomposed/IUserModelComponent.h" diff --git a/source/state-machine/ApiContext.h b/source/state-machine/ApiContext.h index 1004944..f1c067e 100644 --- a/source/state-machine/ApiContext.h +++ b/source/state-machine/ApiContext.h @@ -24,13 +24,13 @@ #include "PluginContainer.h" #include "StateMachine.h" #include "race/Race.h" -#include "race/common/ChannelId.h" -#include "race/common/ChannelProperties.h" -#include "race/common/ChannelStatus.h" -#include "race/common/ConnectionStatus.h" -#include "race/common/LinkProperties.h" -#include "race/common/LinkStatus.h" -#include "race/common/PackageStatus.h" +#include "ChannelId.h" +#include "ChannelProperties.h" +#include "ChannelStatus.h" +#include "ConnectionStatus.h" +#include "LinkProperties.h" +#include "LinkStatus.h" +#include "PackageStatus.h" namespace Raceboat { diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..dc27daf --- /dev/null +++ b/test.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# +# Copyright 2023 Two Six Technologies +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# ----------------------------------------------------------------------------- + +LINUX_PRESET=LINUX_x86_64 +ARCH=x86_64 +if [ "$(uname -m)" == "aarch64" ] || [ "$(uname -m)" == "arm64" ] +then + LINUX_PRESET=LINUX_arm64-v8a + ARCH=arm64-v8a +fi + +cmake --preset=$LINUX_PRESET -DBUILD_VERSION="local" --debug-output -DCXX="clang++ -std=c++17" +cmake --build --preset=$LINUX_PRESET --target testStandaloneLibrary + diff --git a/test/common/MockCore.h b/test/common/MockCore.h index 5857ac7..5827689 100644 --- a/test/common/MockCore.h +++ b/test/common/MockCore.h @@ -22,7 +22,7 @@ #include "MockPluginWrapper.h" #include "MockApiManager.h" #include "MockUserInput.h" -#include "race/common/EncPkg.h" +#include "EncPkg.h" #include "gmock/gmock.h" namespace Raceboat { @@ -113,4 +113,4 @@ class MockCore : public Core { RaceHandle handle = 1; }; -} // namespace Raceboat \ No newline at end of file +} // namespace Raceboat diff --git a/test/common/UnifiedTestStub/CMakeLists.txt b/test/common/UnifiedTestStub/CMakeLists.txt index c8dd3c3..b6c51d0 100644 --- a/test/common/UnifiedTestStub/CMakeLists.txt +++ b/test/common/UnifiedTestStub/CMakeLists.txt @@ -22,6 +22,9 @@ add_library(unified-test-stub SHARED target_include_directories(unified-test-stub PUBLIC $ $ + $ + $ + $ $ $ ) diff --git a/test/common/UnifiedTestStub/UnifiedTestStub.h b/test/common/UnifiedTestStub/UnifiedTestStub.h index 1c73237..0041bd9 100644 --- a/test/common/UnifiedTestStub/UnifiedTestStub.h +++ b/test/common/UnifiedTestStub/UnifiedTestStub.h @@ -15,7 +15,8 @@ // #pragma once -#include "unified/IRacePluginComms.h" +// #include "../../include/race/unified/IRacePluginComms.h" +#include "IRacePluginComms.h" class UnifiedTestStub : public IRacePluginComms { public: @@ -51,4 +52,4 @@ class UnifiedTestStub : public IRacePluginComms { virtual PluginResponse flushChannel(RaceHandle handle, std::string channelGid, uint64_t batchId) override; -}; \ No newline at end of file +}; diff --git a/test/common/race_printers.h b/test/common/race_printers.h index b991520..622d832 100644 --- a/test/common/race_printers.h +++ b/test/common/race_printers.h @@ -17,11 +17,11 @@ #pragma once -#include "race/unified/SdkResponse.h" -#include "race/common/ChannelProperties.h" -#include "race/common/LinkProperties.h" -#include "race/common/PluginConfig.h" -#include "race/common/EncPkg.h" +#include "SdkResponse.h" +#include "ChannelProperties.h" +#include "LinkProperties.h" +#include "PluginConfig.h" +#include "EncPkg.h" #include "nlohmann/json.hpp" using nlohmann::json; diff --git a/test/source/ApiManager/DialTest.cpp b/test/source/ApiManager/DialTest.cpp index eaee861..e8227da 100644 --- a/test/source/ApiManager/DialTest.cpp +++ b/test/source/ApiManager/DialTest.cpp @@ -67,9 +67,10 @@ class ApiManagerDialTestFixture : public ::testing::Test { linkProps.linkType = LT_BIDI; status1 = ApiStatus::INVALID; - dialCallback = [this](ApiStatus _status, RaceHandle _handle) { + dialCallback = [this](ApiStatus _status, RaceHandle _handle, ConduitProperties _properties) { status1 = _status; dialHandle = _handle; + properties = _properties; }; status2 = ApiStatus::INVALID; @@ -99,7 +100,7 @@ class ApiManagerDialTestFixture : public ::testing::Test { void expectCloseConnection(RaceHandle &handle, ConnectionID thisConnId); void expectDestroyLink(RaceHandle &handle, LinkID thisLinkId); - void dialCall(std::function callback, + void dialCall(std::function callback, std::string send_address = ""); void readCall(RaceHandle handle, std::function)> callback); @@ -147,7 +148,8 @@ class ApiManagerDialTestFixture : public ::testing::Test { ApiStatus status1; RaceHandle dialHandle; - std::function dialCallback; + ConduitProperties properties; + std::function dialCallback; ApiStatus status2; std::vector bytes2; @@ -241,7 +243,7 @@ void ApiManagerDialTestFixture::expectDestroyLink(RaceHandle &handle, } void ApiManagerDialTestFixture::dialCall( - std::function callback, + std::function callback, std::string send_address) { SendOptions sendOptionsCopy = sendOptions; sendOptionsCopy.send_address = @@ -524,4 +526,4 @@ TEST_F(ApiManagerDialTestFixture, recv_conn_fail) { EXPECT_EQ(manager.impl.activeContexts.size(), 0); EXPECT_EQ(manager.impl.idContextMap.size(), 0); EXPECT_EQ(manager.impl.handleContextMap.size(), 0); -} \ No newline at end of file +} diff --git a/test/source/ApiManager/ListenTest.cpp b/test/source/ApiManager/ListenTest.cpp index 06450ec..0a40edb 100644 --- a/test/source/ApiManager/ListenTest.cpp +++ b/test/source/ApiManager/ListenTest.cpp @@ -86,9 +86,10 @@ class ApiManagerListenTestFixture : public ::testing::Test { }; status2 = ApiStatus::INVALID; - acceptCallback = [this](ApiStatus _status, RaceHandle handle) { + acceptCallback = [this](ApiStatus _status, RaceHandle handle, ConduitProperties _properties) { status2 = _status; acceptHandle = handle; + properties = _properties; }; status3 = ApiStatus::INVALID; @@ -120,7 +121,7 @@ class ApiManagerListenTestFixture : public ::testing::Test { void listenCall(std::function callback); - void acceptCall(std::function callback); + void acceptCall(std::function callback); void readCall(RaceHandle handle, std::function)> callback); void writeCall(RaceHandle handle, std::function callback); @@ -168,13 +169,14 @@ class ApiManagerListenTestFixture : public ::testing::Test { RaceHandle destroyRecvLinkHandle; ApiStatus status1; + ConduitProperties properties; RaceHandle listenHandle; LinkAddress linkAddress; std::function listenCallback; ApiStatus status2; RaceHandle acceptHandle; - std::function acceptCallback; + std::function acceptCallback; ApiStatus status3; std::vector bytes2; @@ -273,7 +275,7 @@ void ApiManagerListenTestFixture::listenCall( } void ApiManagerListenTestFixture::acceptCall( - std::function callback) { + std::function callback) { manager.accept(listenHandle, callback); manager.waitForCallbacks(); } diff --git a/test/source/CMakeLists.txt b/test/source/CMakeLists.txt index 79c70f0..75e9788 100644 --- a/test/source/CMakeLists.txt +++ b/test/source/CMakeLists.txt @@ -57,11 +57,17 @@ target_compile_definitions(testStandaloneLibrary PUBLIC DECOMPOSED_IMPLEMENTATION="$" ) +message("CMAKE_CURRENT_SOURCE_DIR " ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(testStandaloneLibrary PRIVATE + $ + $ $ $ - $ - $ + $ + $ + $ + $ + $ $ $ )