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

libcompat: cleanup, drop dead and little-used code #1231

Merged
merged 10 commits into from
Oct 11, 2017

Conversation

garlick
Copy link
Member

@garlick garlick commented Oct 11, 2017

In another PR I was moving some deprecated KVS functions to libcompat and noted that some libcompat code was no longer used, some had only one user and was simple to eliminate, and some headers included from compat headers were wrong. That is cleaned up here.

In addition, the single compat.h include file is a problem if you only want one piece of libcompat, and other pieces conflict. The specific problem I ran into was compat.h bringing in json-c, but needing to use a libcompat KVS function from code that used jansson. This PR drops compat.h and makes the individual headers able to be included directly

Problem: libcompat functions can only be used by including
src/common/libcompat/compat.h.  However, that in turn includes
json-c, which prevents it from being used by code that has
been converted to jansson.

Drop compat.h and instead have users directly include the
compat modules they need.  This also makes it more clear
which parts of libcompat are being used.
Drop unnecessary external includes from libcompat headers,
and include <flux/core.h> rather than individual internal
headers.

Fix up users that were getting their includes transitively
through the compat headers.
No users for this.
The following functions are dropped due to no users:
  flux_msghandler_addvec()
  flux_reactor_start()
@garlick garlick requested a review from grondo October 11, 2017 17:09
Copy link
Contributor

@grondo grondo left a comment

Choose a reason for hiding this comment

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

Wow, nice!

Sorry about the stale lua bindings code ☹️

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 478156b on garlick:compat_cleanup into ** on flux-framework:master**.

@grondo
Copy link
Contributor

grondo commented Oct 11, 2017

restarted a build that failed with #1169

@codecov-io
Copy link

codecov-io commented Oct 11, 2017

Codecov Report

Merging #1231 into master will decrease coverage by 0.11%.
The diff coverage is 68.88%.

@@            Coverage Diff             @@
##           master    #1231      +/-   ##
==========================================
- Coverage   78.21%   78.09%   -0.12%     
==========================================
  Files         158      154       -4     
  Lines       29298    28660     -638     
==========================================
- Hits        22915    22382     -533     
+ Misses       6383     6278     -105
Impacted Files Coverage Δ
src/bindings/lua/kvs-lua.c 76.59% <ø> (ø) ⬆️
src/common/libcompat/reactor.c 81.81% <ø> (+3.86%) ⬆️
src/bindings/lua/flux-lua.c 81.18% <68.88%> (-0.49%) ⬇️
src/common/libflux/keepalive.c 86.66% <0%> (-6.67%) ⬇️
src/common/libflux/content.c 86.66% <0%> (-3.34%) ⬇️
src/common/libkvs/kvs_watch.c 86.34% <0%> (-0.89%) ⬇️
src/common/libflux/rpc.c 92.56% <0%> (-0.83%) ⬇️
src/common/libflux/future.c 88.31% <0%> (-0.47%) ⬇️
src/common/libflux/msg_handler.c 86.09% <0%> (-0.38%) ⬇️
src/common/libflux/message.c 81.25% <0%> (-0.36%) ⬇️
... and 8 more

@grondo
Copy link
Contributor

grondo commented Oct 11, 2017

Actually, maybe the f:recvmsg() lua function is also dead code and can be removed?

@garlick
Copy link
Member Author

garlick commented Oct 11, 2017

OK, let me see if that breaks anything.

@garlick
Copy link
Member Author

garlick commented Oct 11, 2017

It's actually used by t/lua/t0001-sendrecv.t, so I'd assume we want to leave it in?

@grondo
Copy link
Contributor

grondo commented Oct 11, 2017

Hm, code coverage appeared to indicate it wasn't called.
We can leave as is for now, and I'll merge this and maybe look into it later.

@grondo grondo merged commit 5fe021a into flux-framework:master Oct 11, 2017
@garlick garlick deleted the compat_cleanup branch November 15, 2017 00:13
@grondo grondo mentioned this pull request May 10, 2018
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