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

Projects
None yet
4 participants
@garlick
Copy link
Member

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

garlick added some commits Oct 11, 2017

libcompat: isolate header files
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.
libcompat: clean up transitive includes
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.
libcompat/rpc: drop dead code
No users for this.
libcompat/reactor: drop dead code
The following functions are dropped due to no users:
  flux_msghandler_addvec()
  flux_reactor_start()

@garlick garlick requested a review from grondo Oct 11, 2017

@grondo

grondo approved these changes Oct 11, 2017

Copy link
Contributor

grondo left a comment

Wow, nice!

Sorry about the stale lua bindings code ☹️

@coveralls

This comment has been minimized.

Copy link

coveralls commented Oct 11, 2017

Coverage Status

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

@grondo

This comment has been minimized.

Copy link
Contributor

grondo commented Oct 11, 2017

restarted a build that failed with #1169

@codecov-io

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

grondo commented Oct 11, 2017

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

@garlick

This comment has been minimized.

Copy link
Member Author

garlick commented Oct 11, 2017

OK, let me see if that breaks anything.

@garlick

This comment has been minimized.

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

This comment has been minimized.

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

2 of 4 checks passed

codecov/patch 68.88% of diff hit (target 78.21%)
Details
codecov/project 78.09% (-0.12%) compared to 1f5f9be
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 78.664%
Details

@garlick garlick deleted the garlick:compat_cleanup branch Nov 15, 2017

@grondo grondo referenced this pull request May 10, 2018

Closed

0.9.0 Release #1479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.