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

cmd/flux: ensure selfdir always at front of PATH, and fix issue when builddir is inaccessible #1683

merged 3 commits into from Sep 27, 2018


None yet
4 participants
Copy link

grondo commented Sep 27, 2018

This pulls off the cmd/flux fixes from #1670 into their own PR. These fixes were more general than just testsuite changes required for the docker environment.

grondo added some commits Sep 26, 2018

cmd/flux: do not die on EACCES to build dir
Problem: if the original build directory for flux-core is still
around and inaccessible to the flux(1) command due to permissions,
the flux executable dies with

 flux realpath (private/path) Permission denied

while attempting to determine if it is run out of a builddir or the
installed path.

Fix this by checking for either ENOENT or EACCES from realpath(3),
and falling through to the installed path check if either error
is encountered.

Fixes #1674
libutil: environment_push should always move items to front
Problem: The flux(1) command driver doesn't move the path to itself
to the front of PATH when its path already exists in PATH. This
could cause a `flux` binary from a different installation of
flux to be run inadvertently, e.g.:

 $ PATH='/usr/src/src/cmd:/bin:/usr/bin' /usr/bin/flux /bin/sh -c 'which flux'

Fix this by having `environment_push()` *always* push an entry to the
front, even when that entry already exists in the environment "item".

Fixes #1679
t1102-cmddriver.t: check that flux moves selfdir to front of PATH
Add a test to ensure that the flux(1) cmddriver moves its own
"selfdir" to the front of PATH, even when selfdir already exists in
PATH (but not at the front).

@grondo grondo changed the title Fixes for flux(1) cmddriver handling of selfdir and PATH cmd/flux: ensure selfdir always at front of PATH, and fix issue when builddir is inaccessible Sep 27, 2018


This comment has been minimized.

Copy link

coveralls commented Sep 27, 2018

Coverage Status

Coverage decreased (-0.006%) to 79.993% when pulling 25e85ca on grondo:cmddriver-fixes into 8b195da on flux-framework:master.


This comment has been minimized.

Copy link

codecov-io commented Sep 27, 2018

Codecov Report

Merging #1683 into master will decrease coverage by <.01%.
The diff coverage is 75%.

@@            Coverage Diff             @@
##           master    #1683      +/-   ##
- Coverage   79.69%   79.69%   -0.01%     
  Files         186      186              
  Lines       34330    34335       +5     
+ Hits        27361    27363       +2     
- Misses       6969     6972       +3
Impacted Files Coverage Δ
src/common/libutil/environment.c 87.12% <100%> (+0.39%) ⬆️
src/cmd/flux.c 83.87% <33.33%> (-0.92%) ⬇️
src/common/libflux/content.c 86.66% <0%> (-3.34%) ⬇️
src/common/libflux/mrpc.c 86.11% <0%> (-1.2%) ⬇️
src/common/libflux/rpc.c 93.23% <0%> (-0.76%) ⬇️
src/broker/overlay.c 73.81% <0%> (-0.32%) ⬇️
src/cmd/flux-module.c 85.06% <0%> (-0.31%) ⬇️
src/modules/kvs/kvs.c 65.87% <0%> (-0.17%) ⬇️
src/common/libflux/message.c 80.78% <0%> (-0.12%) ⬇️
src/common/libflux/future.c 85.57% <0%> (ø) ⬆️
... and 3 more

This comment has been minimized.

Copy link
Contributor Author

grondo commented Sep 27, 2018

This is ready to go in. Then I will rebase #1670 on master.


This comment has been minimized.

Copy link

garlick commented Sep 27, 2018

Right, thanks!

@garlick garlick merged commit 3225d9f into flux-framework:master Sep 27, 2018

2 of 4 checks passed

codecov/patch 75% of diff hit (target 79.69%)
codecov/project 79.69% (-0.01%) compared to 8b195da
continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage decreased (-0.006%) to 79.993%

@grondo grondo deleted the grondo:cmddriver-fixes branch Feb 8, 2019

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.