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

Predefined flows shouldn't attempting to download and compile things, especially not with sudo #387

Closed
expenses opened this issue Mar 17, 2020 · 4 comments

Comments

@expenses
Copy link

The predefined coverage-kcov flow downloads kcov, builds it and tries to install it with sudo. This is pretty dangerous and is totally unnecessary. It'd be much better to just check if kcov exists in $PATH and just print an error if it doesn't exist.

@sagiegurari
Copy link
Owner

today it both checks if it exists and also checks for min capabilities (meaning that its not an old kcov version that is not supported). only if it is old or not installed will it call sudo installation flow.

i know it feels risky, but the code is open source and you can see exactly what it does so there is a lot of transparency here. also you don't have to allow the sudo and it will just fail.
but i do feel its really helpful as it sets up everything for you which is not simple one liner so i would'nt want (as a user) to lose it.

@sagiegurari
Copy link
Owner

by the way, cargo-make also supports tarpaulin and you can change it via env to use that.
for me its not working well so its not the default one.

sagiegurari added a commit that referenced this issue Mar 18, 2020
…new environment variable CARGO_MAKE_SUDO_DISABLE #387
@sagiegurari
Copy link
Owner

@expenses i just pushed a commit which enables to have sudo invocation prevented for non CI envs.
you just need to define the CARGO_MAKE_SUDO_DISABLE env in your makefile and it will try to run kcov without trying to install first.
hope this helps you

@sagiegurari
Copy link
Owner

i'm closing this one because

  1. just release a new cargo-make version which enables to disable sudo if requested
  2. lack of feedback from OP

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

No branches or pull requests

2 participants