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

slither: init at 0.3.0 #50957

Closed
wants to merge 1 commit into from
Closed

slither: init at 0.3.0 #50957

wants to merge 1 commit into from

Conversation

asymmetric
Copy link
Contributor

@asymmetric asymmetric commented Nov 23, 2018

Motivation for this change

Adds slither, which has both a library and a CLI component.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@asymmetric
Copy link
Contributor Author

asymmetric commented Nov 26, 2018

Not sure what's wrong with the test.

@FRidh is the PR 👍 for you now?

@worldofpeace
Copy link
Contributor

worldofpeace commented Nov 29, 2018

I'm seeing python_requires='>=3.6', in the setup.py so we need to disable this for interpreter versions older than 3.6. (pythonAtLeast is useful here)

Also looks like it might want solc in PATH https://github.com/trailofbits/slither/blob/99767a1bb46e59c86f6b69933b56a251e6a89004/README.md#configuration

@asymmetric
Copy link
Contributor Author

@worldofpeace how would you do this? I don't see a buildPython36Package function.

@asymmetric
Copy link
Contributor Author

asymmetric commented Nov 29, 2018

@worldofpeace added disabled = pythonOlder "3.6"; - is that the right way?

Alternatively, I could use disabledIf in python-packages.nix.

@asymmetric
Copy link
Contributor Author

Is this ready to be merged?

@worldofpeace
Copy link
Contributor

Is this ready to be merged?

This issue still stands

Also looks like it might want solc in PATH https://github.com/trailofbits/slither/blob/99767a1bb46e59c86f6b69933b56a251e6a89004/README.md#configuration

I'm not familiar with this software, so I'm not sure if this is appropriate, but this can be achieved with:

nativeBuildInputs = [ makeWrapper ];

postFixup = ''
  wrapProgram $out/bin/slither \
    --prefix PATH : "${stdenv.lib.makeBinPath [ solc ]}"
'';

@asymmetric
Copy link
Contributor Author

asymmetric commented Dec 10, 2018

@worldofpeace good catch, I had missed that comment.

Why is makeBinPath preferred to something like "${solc}/bin"?

@worldofpeace
Copy link
Contributor

Why is makeBinPath preferred to something like "${solc}/bin"?

makeBinPath basically does that.

It's well commented here

makeBinPath = makeSearchPathOutput "bin" "bin";

@asymmetric
Copy link
Contributor Author

Why is makeBinPath preferred to something like "${solc}/bin"?

makeBinPath basically does that.

It's well commented here

nixpkgs/lib/strings.nix

Line 163 in 475d653
makeBinPath = makeSearchPathOutput "bin" "bin";

Yeah, but because the implementation is so simple, I'm not sure what the benefit is of hiding it behind a function :)

Anyway, this is probably OT.

@worldofpeace
Copy link
Contributor

worldofpeace commented Dec 10, 2018

This program has no python tests so can you add?

# Has no tests
doCheck = false

Also since we're going with calling this slither-analyzer we need to change the commit msg.

@asymmetric
Copy link
Contributor Author

This program has no python tests so can you add?

Does it make sense? If they're added later on, we need to remember to set doCheck = false; does leaving it as is create any inconvenience?

@worldofpeace
Copy link
Contributor

worldofpeace commented Dec 10, 2018

This program has no python tests so can you add?

Does it make sense? If they're added later on, we need to remember to set doCheck = false; does leaving it as is create any inconvenience?

I'm not sure what you mean.
doCheck value controls if the check phase is executed.
By default tests are run in python (in nixpkgs) and because they're no tests we are running the checkPhase unnecessarily. So we should disable the execution of the checkPhase.

@asymmetric
Copy link
Contributor Author

asymmetric commented Dec 10, 2018

I'm not sure what you mean.

I mean that if tests are added in a future release, someone has to notice and remember to remove doCheck = false;.

Leaving doCheck to its default, true, seems to have no negative side-effects, so why change it?

@worldofpeace
Copy link
Contributor

I'm not sure what you mean.

I mean that if tests are added in a future release, someone has to notice and remember to remove doCheck = false;.

Leaving doCheck to its default, true, seems to have no negative side-effects, so why change it?

I would hope that our reviewers would be astute to catch that.
Additionally this is done in many other packages that don't have tests.

@asymmetric
Copy link
Contributor Author

I respectfully disagree. I don't see the benefit of disabling the tests when there are none, as it brings virtually no benefits while exposing the package (and nixpkgs) to unnecessary risk.

But if you feel strongly about it, I'll add it. I am just not convinced it's a good idea.

@worldofpeace
Copy link
Contributor

I respectfully disagree. I don't see the benefit of disabling the tests when there are none, as it brings virtually no benefits while exposing the package (and nixpkgs) to unnecessary risk.

But if you feel strongly about it, I'll add it. I am just not convinced it's a good idea.

I don't feel particularly strong about it, but just for consistency with other packages like this we'll need to disable them.

@FRidh Any comments you could contribute to this would be interesting since I've seen you instruct people to do this.

@worldofpeace
Copy link
Contributor

Merged in 6283971

@asymmetric asymmetric deleted the slither branch December 13, 2018 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants