Commit graph

121 commits

Author SHA1 Message Date
def 7379a64004 [WIP] Require Python 3.6 (f-strings) and fix pylints
So far only done scripts directory, will do the rest if this is
considered good
2022-07-27 09:37:24 +02:00
bors[bot] e9eeb24c17
Merge #5345 #5519 #5572
5345: Add Integration test to pr template r=heinrich5991 a=def-



5519: Library updates (2022-06-27) r=heinrich5991 a=def-

Should probably wait until after 16.2 release with them.

Vulkan 1.3.204.1 -> 1.3.216.0
curl 7.81.0 -> 7.84.0
FFmpeg 5.0 -> 5.0.1
freetype 2.11.1 -> 2.12.1
SQLite3 3.37.2 -> 3.39.0

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


5572: Also make gameclient aware that snapshots have been purged (fixes #5571) r=heinrich5991 a=def-

Recreates SnapEntities internally

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-07-07 10:41:22 +00:00
bors[bot] b75289df35
Merge #4829 #5343 #5465
4829: Added map_replace_area tool r=def- a=sctt

Motivation:
sometimes mappers need to copy a certain area from a map to another (but also to a different position of the same map).
that's very time consuming on complex maps, as tiles and quads layers have to be manually copied one by one.

map_replace_area is designed to automatically replace all the tiles and quads from a specific area to another.
`Usage: map_replace_area <from_map> <from_x> <from_y> <to_map> <to_x> <to_y> <width> <height> <output_map>`

PoW screenshots attached below.

note: for the moment map_replace_area suppose that you are working on the same map  (that's what i needed), that means source and destination maps must have the same layers structure, or else an error is returned.
but i understand it might be useful to also work on totally different maps, in that case users must be able specify layers they want to consider by associating source map layers to destination map layers (by using a config file maybe).
i'm probably going to make another PR to add this enhancement in the future.

PoW:
![Screenshot from 2022-03-16 18-08-12](https://user-images.githubusercontent.com/3328841/158650515-17c31639-28f7-4e19-954a-b5734ee82703.png)
![Screenshot from 2022-03-16 18-08-43](https://user-images.githubusercontent.com/3328841/158650512-6e21f2b4-538f-4974-aaa2-2983551d24b4.png)
![Screenshot from 2022-03-16 18-11-50](https://user-images.githubusercontent.com/3328841/158650510-d00a05a9-a2e8-4df2-8674-0c80fd894f66.png)

5343: Add rcon and chat to integration test r=def- a=ChillerDragon

Add more action to the integration test script: chat messages, chat commands, rcon commands.
This unlocks more code coverage at runtime to catch asan issues.

It adds a very restrictive regex on the log format. But I am happy to maintain that in case changes to the log output happen.
The current version is already supporting heinrichs refactor https://github.com/ddnet/ddnet/pull/5036

Also ensure chat messages arrive in the correct format. Would have catched the following issues:
https://github.com/ddnet/ddnet/issues/5342
https://github.com/ddnet/ddnet/issues/5340
https://github.com/ddnet/ddnet/issues/5302
https://github.com/ddnet/ddnet/pull/5126

DEPENDS ON:

https://github.com/ddnet/ddnet/issues/5342
https://github.com/ddnet/ddnet/issues/5340

5465: Change from pnglite to libpng for PNG reading r=def- a=heinrich5991

This is desirable mainly because libpng is maintained and pnglite is
not. pnglite was last updated in 2007 (15 years ago) and probably has a
lot of security vulnerabilities.

libpng is an actively maintained library also used by browsers like
Firefox or Chromium, so it's less likely to contain security
vulnerabilities, also it's more likely to be packaged by Linux
distributions.

This also refuses to load images of types not supported by pnglite,
which allows us to think about backward compatibility while also
introducing libpng.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: sctt <scottistefano91@gmail.com>
Co-authored-by: term <term@term.sinervis.pri>
Co-authored-by: f <scottistefano91@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-06-21 16:21:47 +00:00
Jupeyy 65ad57a448 Change from pnglite to libpng for PNG reading
This is desirable mainly because libpng is maintained and pnglite is
not. pnglite was last updated in 2007 (15 years ago) and probably has a
lot of security vulnerabilities.

libpng is an actively maintained library also used by browsers like
Firefox or Chromium, so it's less likely to contain security
vulnerabilities, also it's more likely to be packaged by Linux
distributions.
2022-06-21 13:37:14 +02:00
def 442ae7dc13 Make it easier to run integration tests
Entire worflow is now:

mkdir san
cd san
CC=clang CXX=clang++ CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja ..
ninja run_integration_tests
2022-06-06 18:53:59 +02:00
def 9a89e58a16 Add lsan.supp for opengl leak (fixes #5296)
See also Jupeyy's explanation in
https://github.com/ddnet/ddnet/issues/4294 for why we want to ignore
this:

> sadly components have no OnDestruct on anything like that
> so aslong it doesn't actually leak it's just non destructed memory

So it's something we allocate once for the entire client lifetime from
my understanding.

=================================================================
==421461==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 411760 byte(s) in 10 object(s) allocated from:
    #0 0x55eaf0c08a29 in malloc (/media/ddnet/integration_test/DDNet+0x736a29)
    #1 0x55eaf0de9f72 in CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(CCommandBuffer::SCommand_CreateBufferObject const*) /media/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp:1898:25
    #2 0x55eaf0dd82f5 in CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*) /media/ddnet/src/engine/client/backend/opengl/backend_opengl.cpp
    #3 0x55eaf0f73229 in CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) /media/ddnet/src/engine/client/backend_sdl.cpp:246:20
    #4 0x55eaf0f70568 in CGraphicsBackend_Threaded::ThreadFunc(void*) /media/ddnet/src/engine/client/backend_sdl.cpp:75:25
    #5 0x55eaf0d679d7 in thread_run(void*) /media/ddnet/src/base/system.cpp:686:2
    #6 0x7f08b788c54c  (/usr/lib/libc.so.6+0x8c54c)

SUMMARY: AddressSanitizer: 411760 byte(s) leaked in 10 allocation(s).
2022-06-05 20:01:02 +02:00
def 47b9512212 Add Integration test to pr template 2022-06-05 12:51:34 +02:00
def b3d8e05e00 Add valgrind to integration test 2022-05-26 23:52:29 +02:00
ChillerDrgon 05efc25f32 Add integration test script and coverage map 2022-05-26 00:37:45 +02:00
Dennis Felsing ae1c63f33d Try adding mysql to github workflow in ubuntu 20.04
Remove my_bool, has been removed in MySQL 8.0
2022-04-28 18:23:23 +02:00
Chiller Dragon d45448fab6
Fix asan CI 2022-04-18 17:32:06 +02:00
def 7973713257 Ignore pnglite shift ubsan
/home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:68:16: runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
    #0 0x1b85f2f in file_read_ul /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:68:16
    #1 0x1b7e129 in png_read_ihdr /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:171:2
    #2 0x1b7d867 in png_open_read /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:275:11
    #3 0xb59f78 in CGraphics_Threaded::LoadPNG(CImageInfo*, char const*, int) /home/runner/work/ddnet/ddnet/src/engine/client/graphics_threaded.cpp:642:14
    #4 0xb54e78 in CGraphics_Threaded::LoadTexture(char const*, int, int, int) /home/runner/work/ddnet/ddnet/src/engine/client/graphics_threaded.cpp:517:5
    #5 0x18e24f7 in CEditor::Init() /home/runner/work/ddnet/ddnet/src/game/editor/editor.cpp:6354:32
    #6 0xa8732e in CClient::Run() /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:2917:13
    #7 0xaef796 in main /home/runner/work/ddnet/ddnet/src/engine/client/client.cpp:4462:11
    #8 0x7ff6950d80b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
    #9 0x43ce7d in _start (/home/runner/work/ddnet/ddnet/san/DDNet+0x43ce7d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/runner/work/ddnet/ddnet/src/engine/external/pnglite/pnglite.c:68:16 in
2022-04-18 00:42:44 +02:00
ChillerDragon ccd748f4f1 Add UBSan and ASan to CI 2022-04-10 14:30:21 +02:00
Dennis Felsing ed5cc78771 Try to fix linux github worker build
The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.34-0ubuntu0.20.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
2022-04-08 01:18:55 +02:00
Jupeyy fbeba9eb5f Add Vulkan backend 2022-03-21 12:39:51 +01:00
def 86fff7cd3d Add vulkan libs, exclude pylint 2022-03-19 12:50:20 +01:00
def 5105141519 Use newer ubuntu with higher clang-tidy version
clang-tidy 10.0 -> 13.0

Should be green, checked locally on Arch with 13.0.1
2022-03-12 12:39:29 +01:00
Alexander Akulich df5c48d675 CI: Relax 'package-file' mask 2022-03-08 14:24:37 +03:00
Dennis Felsing c92423362e Videorecorder on by default (also for github builds) 2022-03-01 22:56:24 +01:00
Dennis Felsing e31f255a65 Use ninja instead of makefiles 2022-02-14 23:06:28 +01:00
def f0f7d0aa5e Try not to pass any Visual Studio version and use default
since it seems not all github worflow servers are on VS17 yet
2022-02-06 13:34:07 +01:00
Dennis Felsing 1199fd6aa3 Try using Windows 2022 (fixes #4658) 2022-02-04 17:20:09 +01:00
heinrich5991 f42a826945 Fix Windows CI not properly erroring out on errors
Previously, it would not error when tests failed to build or run.
Powershell (at least on CI) apparently only cares about the last exit
status, so separate running the server from running the tests.

Fixes #3057.
2022-01-31 01:31:47 +01:00
def fec20679f1 Create custom look for DMG using dmgbuild
(nice background image still missing)
2021-12-26 00:24:55 +01:00
def 0c759ae6b6 Deterministic player order in /top5team name
same as in /top5team without name
2021-12-20 00:50:56 +01:00
def c7fee1135f Keep Ubuntu 18.04, but without sql tests 2021-12-19 23:51:14 +01:00
def 01b1dbfc2e Fix fancy test to use correct build 2021-12-19 23:04:13 +01:00
def f464f148ac Add explicit -DTEST_MYSQL
Since the setup is a bit more manual and not as self-contained, so most
probably don't want to test it locally.
2021-12-19 19:40:20 +01:00
def 04594397ca Test MySQL centrally in fancy 2021-12-19 19:40:20 +01:00
def 436fcbcf08 Ubuntu 20.04 in central tests 2021-12-19 19:40:20 +01:00
def c8bcda2984 Also remove from CodeQL 2021-12-07 18:16:38 +01:00
def 3f637ae0f7 osx -> macos 2021-12-04 13:27:18 +01:00
ChillerDragon afc253cc49 Run headless client in CI 2021-09-30 19:20:20 +02:00
bors[bot] 42f21c6dd9
Merge #3986
3986: Use consistent case for error messages r=def- a=ChillerDragon

Use the style introduced by `@def-` in
61e47422f6

consistency :)

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-08-21 10:03:10 +00:00
ChillerDragon 48531661a3 erros typo and rephrase
Thanks @edg-l
2021-08-21 11:49:28 +02:00
Jupeyy 55b6d27d36 Use ninja for building 2021-08-16 12:42:12 +02:00
Jupeyy 3d91628da2 Remove fetch-depth from CodeQL 2021-08-16 11:04:59 +02:00
ChillerDragon 02abc95c18 Use consistent case for error messages
Use the style introduced by @def- in
61e47422f6
2021-08-03 16:41:04 +02:00
def 6598e0a543 Another MacOS -> macOS in translations 2021-07-08 09:08:08 +02:00
Jupeyy 25b2b5b9b2
Merge pull request #3886 from def-/pr-ubuntu
Github Workflow Ubuntu 16.04 -> 18.04
2021-06-13 04:56:17 +02:00
def 7dd4b5e1a9 Don't use HEAD^2 in codeql anymore
> 1 issue was detected with this workflow: git checkout HEAD^2 is no
> longer necessary. Please remove this step as Code Scanning recommends
> analyzing the merge commit for best results.

https://github.com/ddnet/ddnet/actions/runs/931568951
2021-06-12 20:12:28 +02:00
def 88141078ca Github Workflow Ubuntu 16.04 -> 18.04
No hurry to merge it, can wait until ~September I guess

https://github.com/actions/virtual-environments/issues/3287
2021-06-08 12:18:23 +02:00
heinrich5991 aa594795db Work around CMake 3.20.0 bug, fix packaging on CI
CMake 3.20.0 ignores the next CLI parameter after --parallel. Fix that by
moving it to the end of the command line.

https://gitlab.kitware.com/cmake/cmake/-/issues/21966
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5936

It is meant to be fixed in CMake 3.20.1.
2021-04-07 18:07:44 +02:00
heinrich5991 d7019a244e Get rid of the MySQL C++ connector as a dependency
We now use the C API directly. This has the advantage of using one
obscure dependency less, as the C++ connector also used the C API.
2021-02-24 17:34:08 +01:00
def 13a8dfa307 Add pylint
and fix occurences
2020-12-09 10:40:28 +01:00
def 458c752ee7 Put style checks into individual steps 2020-12-08 15:02:16 +01:00
ChillerDragon f2c834e881 Add shellcheck to ci 2020-12-08 15:02:16 +01:00
def 0822f9cecd Add check_dilate 2020-11-24 11:15:24 +01:00
def 5b24e95b29 Check translations in github, check formatting strings, fix 2020-11-12 08:57:20 +01:00
def 1bb9a5f54f No need for Summary title 2020-10-20 18:33:42 +02:00
def 90ad617e9b Add asan+ubsan or memcheck 2020-10-20 10:43:33 +02:00
12pm 35a2b845c1 add a checklist for PRs (fixes #3130) 2020-10-18 12:06:02 +02:00
Edgar baa8b93d2f Add clang-tidy to CI and enable clang-analyzer checks
The actual work will be fixing those or at least
NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) them so we can enable
this. Disable checks that we don't want.

Exclude external directory from clang-tidy.
2020-10-14 14:54:33 +02:00
heinrich5991 bf576de5b6 check_style CI no longer needs git history 2020-10-13 23:33:51 +02:00
Dennis Felsing bea76a8f20 Create codeql-analysis.yaml 2020-10-01 12:01:05 +02:00
def 47c15d99bf Ignore brew update constantly failing (fixes #2950) 2020-09-29 19:16:33 +02:00
heinrich5991 678b2b15c3 Change fix_style.py script to unconditionally format everything 2020-09-26 21:41:24 +02:00
bors[bot] 5d7f9698ca
Merge #2879
2879: Use submodule option. Fix #2792 r=def- a=Learath2



Co-authored-by: Emir Marincic <learath2@gmail.com>
2020-09-19 20:05:47 +00:00
Emir Marincic af3f167f49
Use submodule option. Fix #2792 2020-09-19 22:16:10 +03:00
heinrich5991 b235637713 Find the common ancestor for the style checking
This allows the style checker to only look at the changes done in the
current branch, and not the other commits that were done in the base
branch.
2020-09-11 00:57:03 +02:00
def d92e6ecb00 Use check_header_guards script 2020-09-11 00:03:31 +02:00
heinrich5991 0a2eab6a10 CI: Check style on pull requests 2020-09-10 04:11:58 +02:00
Zwelf ad21ec1269 Add SQLite to build system and CI 2020-08-03 12:58:52 +02:00
heinrich5991 1fbd847edd Skip temporary branches of bors 2020-07-01 01:54:46 +02:00
def 7fc15289f2 Fix mac build on github (fixes #2347) 2020-06-24 11:51:35 +02:00
heinrich5991 bd022b77d0 Test antibot, mysql, websockets compilation on CI 2020-05-18 00:29:15 +02:00
def 6f040e4b8c Try to fix macos action 2020-05-01 15:18:56 +03:00
Arda Demir b7d452d2a0
Libnotify support for linux client (#2099)
Add libnotify support for linux client

Also unify notification management

Make libnotify mandatory for the client. It is installed on 100% of Arch
Linux systems and on 70% of Debian systems. I'd guess the remaining
Debian systems are servers.

Detect dependent libraries of `libnotify` using `pkg-config`. Remove
library-specific code from the game module. Decrement refcount for
libnotify notification object before leaving the function.
2020-04-14 17:53:53 +02:00
heinrich5991 5a1215d922 GitHub actions: Don't cancel jobs if one failed 2020-04-10 21:01:39 +02:00
Learath 696532689c Fix package names 2020-01-23 16:13:54 +01:00
Learath a9e3a4029a Migrate to Github Actions 2020-01-23 16:01:52 +01:00