Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check struct sizes on the CI instead of during compile-time #1329

Merged
merged 3 commits into from
Apr 24, 2022

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Apr 18, 2022

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

10


Check struct sizes on the CI (in code) instead of during compile-time (using the preprocessor). This should resolve an issue reported on Discourse.

It adds an (undocumented) new flag pihole-FTL --check-structs that is supposed to be used by the tests. The exit code will tell if everything worked as expected (bash-compatible: exit code 0 is success).

… (using the preprocessor)

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER requested a review from a team April 18, 2022 09:02
Signed-off-by: DL6ER <dl6er@dl6er.de>
@dschaper
Copy link
Member

Thanks!

src/config.h Show resolved Hide resolved
src/datastructure.h Show resolved Hide resolved
@DL6ER DL6ER marked this pull request as draft April 24, 2022 06:52
@DL6ER DL6ER marked this pull request as ready for review April 24, 2022 06:53
@DL6ER
Copy link
Member Author

DL6ER commented Apr 24, 2022

It's worth pointing out that we will only test struct sizes on platform where we run the tests for (x86, x86-musl, i386). However, this is not a drawback as we are checking on both 32bit and a 64bit architectures. (also note that there is no difference between arm, mips and i386 so everything is still covered).

Signed-off-by: DL6ER <dl6er@dl6er.de>
@yubiuser yubiuser merged commit b56fe06 into development Apr 24, 2022
@yubiuser yubiuser deleted the tests/struct_sizes branch April 24, 2022 07:23
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-16-web-v5-13-and-core-v5-11-1-released/56384/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants