From 593a6fab20c86f07c54f33b5e5ed95cf5e3dc472 Mon Sep 17 00:00:00 2001 From: Glenn Fiedler Date: Sat, 23 Dec 2023 13:42:14 -0500 Subject: [PATCH] update for end of 2023 --- .github/workflows/ci.yml | 10 +++---- .gitignore | 1 - BUILDING.md | 20 +++++++++----- LICENCE | 2 +- README.md | 11 ++++---- docker/Dockerfile | 22 ---------------- fuzz.c | 4 +-- premake5.lua | 57 +++++----------------------------------- reliable.c | 4 +-- reliable.h | 4 +-- soak.c | 4 +-- stats.c | 4 +-- test.cpp | 4 +-- valgrind/Dockerfile | 20 -------------- 14 files changed, 44 insertions(+), 123 deletions(-) delete mode 100644 docker/Dockerfile delete mode 100644 valgrind/Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 562379b..b2db8ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,13 +19,13 @@ jobs: uses: abel0b/setup-premake@v1 # Linux & MacOS-specific build steps - - name: Build (gmake2) + - name: Build (gmake) if: runner.os != 'Windows' run: | - premake5 gmake2 + premake5 gmake make clean - make all config=${{ matrix.configuration }}_x64 - - name: Test (gmake2) + make all config=${{ matrix.configuration }} + - name: Test (gmake) if: runner.os != 'Windows' run: ./bin/test @@ -43,4 +43,4 @@ jobs: msbuild reliable.sln -nologo -m -p:Configuration=${{ matrix.configuration }} - name: Test (vs2019) if: runner.os == 'Windows' - run: "& ./bin/x64/${{ matrix.configuration }}/test.exe" \ No newline at end of file + run: "& ./bin/${{ matrix.configuration }}/test.exe" \ No newline at end of file diff --git a/.gitignore b/.gitignore index b285935..31d17bb 100644 --- a/.gitignore +++ b/.gitignore @@ -37,5 +37,4 @@ Release Secure .vs cov-int -Docker/reliable.io docs diff --git a/BUILDING.md b/BUILDING.md index 6a6ed22..58f0bea 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,9 +1,9 @@ -How to build reliable.io -======================== +How to build reliable +===================== ## Building on Windows -Download [premake 5](https://premake.github.io/download.html) and copy the **premake5** executable somewhere in your path. Please make sure you have at least premake5 alpha 13. +Download [premake 5](https://premake.github.io/download.html) and copy the **premake5** executable somewhere in your path. You need Visual Studio to build the source code. If you don't have Visual Studio 2019 you can [download the community edition for free](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16). @@ -17,16 +17,22 @@ Now you can build the library and run individual test programs as you would for ## Building on MacOS and Linux -First, download and install [premake 5](https://premake.github.io/download.html). Please make sure you have at least premake5 alpha 13. +First, download and install [premake 5](https://premake.github.io/download.html). -Now go to the command line under the reliable.io directory and enter: +Now go to the command line under the reliable directory and enter: - premake5 gmake2 + premake5 gmake Which creates makefiles which you can use to build the source via: make all +Then you can run binaries like this: + + ./bin/test + ./bin/soak + ./bin/fuzz + Alternatively, you can use the following shortcuts to build and run test programs directly: premake5 test // build and run unit tests @@ -35,7 +41,7 @@ Alternatively, you can use the following shortcuts to build and run test program premake5 fuzz // run the fuzz test that tests the library is able to correctly handle random data -If you have questions please create an issue at https://github.com/networkprotocol/reliable.io and I'll do my best to help you out. +If you have questions please create an issue at https://github.com/mas-bandwidth/reliable and I'll do my best to help you out. cheers diff --git a/LICENCE b/LICENCE index d57d9a0..90536b3 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,4 @@ -Copyright © 2017 - 2019, The Network Protocol Company, Inc. +Copyright © 2017 - 2024, Mas Bandwidth LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 8b883ee..d7d685c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build status](https://github.com/networkprotocol/reliable/workflows/CI/badge.svg)](https://github.com/networkprotocol/reliable/actions?query=workflow%3ACI) +[![Build status](https://github.com/mas-bandwidth/reliable/workflows/CI/badge.svg)](https://github.com/mas-bandwidth/reliable/actions?query=workflow%3ACI) # Introduction @@ -14,9 +14,9 @@ reliable is stable and production ready. # Author -The author of this library is [Glenn Fiedler](https://www.linkedin.com/in/glennfiedler). +The author of this library is Glenn Fiedler. -Open source libraries by the same author include: [netcode](http://netcode.io) and [yojimbo](http://libyojimbo.com) +Open source libraries by the same author include: [netcode](https://github.com/mas-bandwidth/netcode) and [yojimbo](https://github.com/mas-bandwidth/yojimbo) # Source Code @@ -42,10 +42,11 @@ These people are awesome: * **Silver Sponsors** * [Moon Studios](http://www.oriblindforest.com/#!moon-3/) - * [The Network Protocol Company](http://www.thenetworkprotocolcompany.com) + * [Mas Bandwidth](https://www.mas-bandwidth.com) + * The Network Protocol Company * **Bronze Sponsors** - * [Kite & Lightning](http://kiteandlightning.la/) + * Kite & Lightning * [Data Realms](http://datarealms.com) And by individual supporters on Patreon. Thank you. You made this possible! diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 5051d2b..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM phusion/baseimage:0.9.18 - -CMD ["/sbin/my_init"] - -WORKDIR /app - -RUN apt-get -y update && apt-get install -y wget make g++ dh-autoreconf pkg-config - -RUN wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz && \ - tar -zxvf premake-*.tar.gz && \ - rm premake-*.tar.gz && \ - mv premake5 /usr/local/bin - -ADD reliable.io /app/reliable.io - -RUN cd reliable.io && find . -exec touch {} \; && premake5 gmake && make -j32 test config=release_x64 && cp ./bin/* /app - -EXPOSE 40000 - -ENTRYPOINT ./test - -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/fuzz.c b/fuzz.c index 84ea69a..fa7ff60 100644 --- a/fuzz.c +++ b/fuzz.c @@ -1,7 +1,7 @@ /* - reliable.io + reliable - Copyright © 2017 - 2019, The Network Protocol Company, Inc. + Copyright © 2017 - 2024, Mas Bandwidth LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/premake5.lua b/premake5.lua index 4b37298..a303a76 100644 --- a/premake5.lua +++ b/premake5.lua @@ -2,7 +2,6 @@ solution "reliable" kind "ConsoleApp" language "C" - platforms { "x64" } configurations { "Debug", "Release" } if not os.istarget "windows" then includedirs { ".", "/usr/local/include" } -- for clang scan-build only. for some reason it needs this to work =p @@ -12,17 +11,13 @@ solution "reliable" warnings "Extra" staticruntime "On" floatingpoint "Fast" - configuration "Debug" + filter "configurations:Debug" symbols "On" defines { "RELIABLE_DEBUG" } - links { debug_libs } - configuration "Release" + filter "configurations:Release" symbols "Off" optimize "Speed" defines { "RELIABLE_RELEASE" } - links { release_libs } - configuration { "gmake2" } - linkoptions { "-lm" } project "test" files { "test.cpp" } @@ -43,7 +38,7 @@ if os.ishost "windows" then newaction { trigger = "solution", - description = "Create and open the reliable.io solution", + description = "Create and open the reliable solution", execute = function () os.execute "premake5 vs2019" os.execute "start reliable.sln" @@ -71,7 +66,7 @@ else trigger = "soak", description = "Build and run soak test", execute = function () - os.execute "test ! -e Makefile && premake5 gmake2" + os.execute "test ! -e Makefile && premake5 gmake" if os.execute "make -j32 soak" then os.execute "./bin/soak" end @@ -83,7 +78,7 @@ else trigger = "stats", description = "Build and run stats example", execute = function () - os.execute "test ! -e Makefile && premake5 gmake2" + os.execute "test ! -e Makefile && premake5 gmake" if os.execute "make -j32 stats" then os.execute "./bin/stats" end @@ -95,49 +90,13 @@ else trigger = "fuzz", description = "Build and run fuzz test", execute = function () - os.execute "test ! -e Makefile && premake5 gmake2" + os.execute "test ! -e Makefile && premake5 gmake" if os.execute "make -j32 fuzz" then os.execute "./bin/fuzz" end end } - newaction - { - trigger = "cppcheck", - description = "Run cppcheck over the source code", - execute = function () - os.execute "cppcheck reliable.c" - end - } - - newaction - { - trigger = "scan-build", - description = "Run clang scan-build over the project", - execute = function () - os.execute "premake5 clean && premake5 gmake2 && scan-build make all -j32" - end - } - - newaction - { - trigger = "docker", - description = "Build and run reliable.io tests inside docker", - execute = function () - os.execute "rm -rf docker/reliable.io && mkdir -p docker/reliable.io && cp *.h docker/reliable.io && cp *.c docker/reliable.io && cp *.cpp docker/reliable.io && cp premake5.lua docker/reliable.io && cd docker && docker build -t \"networkprotocol:reliable.io-server\" . && rm -rf reliable.io && docker run -ti -p 40000:40000/udp networkprotocol:reliable.io-server" - end - } - - newaction - { - trigger = "valgrind", - description = "Run valgrind over tests inside docker", - execute = function () - os.execute "rm -rf valgrind/reliable.io && mkdir -p valgrind/reliable.io && cp *.h valgrind/reliable.io && cp *.c valgrind/reliable.io && cp *.cpp valgrind/reliable.io && cp premake5.lua valgrind/reliable.io && cd valgrind && docker build -t \"networkprotocol:reliable.io-valgrind\" . && rm -rf reliable.io && docker run -ti networkprotocol:reliable.io-valgrind" - end - } - newaction { trigger = "loc", @@ -186,9 +145,7 @@ newaction "release", "cov-int", "docs", - "xml", - "docker/reliable.io", - "valgrind/reliable.io" + "xml" } for i,v in ipairs( directories_to_delete ) do diff --git a/reliable.c b/reliable.c index 654fa5a..818af2f 100644 --- a/reliable.c +++ b/reliable.c @@ -1,7 +1,7 @@ /* - reliable.io + reliable - Copyright © 2017 - 2019, The Network Protocol Company, Inc. + Copyright © 2017 - 2024, Mas Bandwidth LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/reliable.h b/reliable.h index 31dd7d5..e7bb5af 100644 --- a/reliable.h +++ b/reliable.h @@ -1,7 +1,7 @@ /* - reliable.io + reliable - Copyright © 2017 - 2019, The Network Protocol Company, Inc. + Copyright © 2017 - 2024, Mas Bandwidth LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/soak.c b/soak.c index e26a672..cd0131c 100644 --- a/soak.c +++ b/soak.c @@ -1,7 +1,7 @@ /* - reliable.io + reliable - Copyright © 2017 - 2019, The Network Protocol Company, Inc. + Copyright © 2017 - 2024, Mas Bandwidth LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/stats.c b/stats.c index e3c5139..b760ac0 100644 --- a/stats.c +++ b/stats.c @@ -1,7 +1,7 @@ /* - reliable.io + reliable - Copyright © 2017 - 2019, The Network Protocol Company, Inc. + Copyright © 2017 - 2024, Mas Bandwidth LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/test.cpp b/test.cpp index b503f02..c60cc9b 100644 --- a/test.cpp +++ b/test.cpp @@ -1,7 +1,7 @@ /* - reliable.io + reliable - Copyright © 2017 - 2019, The Network Protocol Company, Inc. + Copyright © 2017 - 2024, Mas Bandwidth LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/valgrind/Dockerfile b/valgrind/Dockerfile deleted file mode 100644 index 3cebd27..0000000 --- a/valgrind/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM phusion/baseimage:0.9.18 - -CMD ["/sbin/my_init"] - -WORKDIR /app - -RUN apt-get -y update && apt-get install -y wget make g++ dh-autoreconf pkg-config valgrind - -RUN wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-linux.tar.gz && \ - tar -zxvf premake-*.tar.gz && \ - rm premake-*.tar.gz && \ - mv premake5 /usr/local/bin - -ADD reliable.io /app/reliable.io - -RUN cd reliable.io && find . -exec touch {} \; && premake5 gmake && make -j32 test && make -j32 soak && cp ./bin/* /app - -CMD [ "valgrind", "--tool=memcheck", "--leak-check=yes", "--show-reachable=yes", "--num-callers=20", "--track-fds=yes", "--track-origins=yes", "./soak", "1000" ] - -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*