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
adding new package: pyre-check (untested) #40809
Conversation
@GrahamcOfBorg build pyre-check |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: pyre-check Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: pyre-check Partial log (click to expand)
|
You'll have to add a
|
buildPhase = '' | ||
./scripts/setup.sh --local | ||
make | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, we prefer to let the default buildPhase
do its thing, since it will handle various debugging/parallelization flags, etc. When we want it to do something non-standard, we do something like this:
preBuild = ''
./scripts/setup.sh --local
'';
(the default buildPhase will call make for you). Though in this case it's probably more appropriate to put this as a preConfigure
hook instead.
homepage = https://pyre-check.org/; | ||
description = "A performant type-checker for Python 3"; | ||
license = stdenv.lib.licenses.mit; | ||
platforms = with stdenv.lib.platforms; unix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, when adding a new package, it's expected that you'll volunteer to maintain it by adding yourself to this file:
https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix
and adding a maintainers = with stdenv.lib.maintainers; [ bbarker ];
Can you format the commit message according to CONTRIBUTING.md? Namely, |
Thanks for your PR! Unfortunately this PR won't work in this form. I started packaging pyre and it needs ppxlib which in turn requires updating the jane-street ocaml libraries in nixpkgs to 0.11. Once the ocaml updates are in something like the following would do the job (still has too many dependencies): { stdenv, fetchFromGitHub, ocamlPackages, makeWrapper, writeScript }:
let
vsc = writeScript "vv" ''
# Add version information to the file.
cat > "./version.ml" <<EOF
let build_info () =
"nixpkgs-master"
let version () =
"nixpkgs-master"
EOF
'';
in stdenv.mkDerivation rec {
name = "pyre-${version}";
version = "master";
src = fetchFromGitHub {
owner = "facebook";
repo = "pyre-check";
rev = "master";
sha256 = "1a0ylg076n4kybi3ra1cbnrm6vg1k1zs29g9hmyfygzf0blqfrcp";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = with ocamlPackages; [
ocaml findlib batteries menhir stdint
zarith camlp4 yojson pprint core sedlex ppx_jane ppx_sexp_conv ppx_tools ppx_let ppx_core ppx_driver
ulex ocaml-migrate-parsetree process ppx_deriving ppx_deriving_yojson ocamlbuild
];
buildPhase = ''
sed "s/%VERSION%/0.7.0/" Makefile.template > Makefile
export HOME=.
mkdir $out
# the shipped generate-version-number needs git and hg.
cp ${vsc} ./scripts/generate-version-number.sh
export OCAMLFIND_DESTDIR=$out
make release
'';
makeFlags = [ "PREFIX=$(out)" ];
} |
See #42738 for ppxlib packaging |
Thank you for contributing! |
Motivation for this change
Adding pyre-check; a static analysis package for python 3.5+.
Things done
I haven't tested so far due to #40782 blocking me from testing my local nixpkgs repo.
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)