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

build: download uthash and utarray from upstream #232

Merged
merged 4 commits into from
Aug 12, 2022

Conversation

aloisklink
Copy link
Contributor

@aloisklink aloisklink commented Aug 8, 2022

Instead of maintaining our own fork of uthash and utarray, we can download the upstream version.

This means we have less code to test, increasing code coverage (or at least it would if they weren't C/header-only macro functions).
It also makes it easier to update to a newer version of uthash the future (for example, we are now using v2.1.0, but v2.3.0 is now out)

I had a quick look at the git history for utarray.h and uthash.h, and the only major thing that I could find is that utarray.h was modified to use src/util/allocs.h.

Instead of maintaining our own fork of uthash and utarray,
we can download the upstream version.

This means we have less code to test, increasing code
coverage. It also makes it easier to update to a newer
version in the future.

The only changes we had made to our version was to use
src/util/allocs.h
@aloisklink aloisklink added the dependencies Pull requests that update a dependency file label Aug 8, 2022
@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Merging #232 (f238515) into main (35297ad) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
- Coverage   45.56%   45.52%   -0.04%     
==========================================
  Files         108      107       -1     
  Lines       14949    14940       -9     
==========================================
- Hits         6811     6802       -9     
  Misses       8138     8138              
Impacted Files Coverage Δ
...iddlewares/cleaner_middleware/cleaner_middleware.c 18.34% <ø> (ø)
...apture/middlewares/header_middleware/dns_decoder.c 0.00% <ø> (ø)
...pture/middlewares/header_middleware/mdns_decoder.c 0.00% <ø> (ø)
...ure/middlewares/header_middleware/packet_decoder.c 0.00% <ø> (ø)
src/capture/middlewares_list.h 32.00% <ø> (ø)
src/config.c 0.00% <ø> (ø)
src/dhcp/dhcp_service.c 64.28% <ø> (ø)
src/dhcp/dnsmasq.c 67.27% <ø> (ø)
src/dns/mdns_mapper.c 58.97% <ø> (ø)
src/dns/mdns_service.c 16.16% <ø> (ø)
... and 29 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@mereacre mereacre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea. However, there's one main theoretical disadvantage that is if the author of the utarray decide to delete the repo.

@aloisklink
Copy link
Contributor Author

I like the idea. However, there's one main theoretical disadvantage that is if the author of the utarray decide to delete the repo.

It's a bit too famous to delete :)

The uthash library is even built-in to Ubuntu, see https://packages.ubuntu.com/jammy/uthash-dev (utarray.h is one of the files it contains).

Apparently there's even a /usr/lib/x86_64-linux-gnu/libut.a file that makes compiling slightly faster.

@aloisklink aloisklink merged commit 70458bc into main Aug 12, 2022
@aloisklink aloisklink deleted the uthash-build-refactor branch August 12, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants