-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Add a bunch of riscv-related packages #213222
Add a bunch of riscv-related packages #213222
Conversation
May I ask why so many just want riscv-gnu-toolchain instead of using |
|
What about |
That targets |
a1d52e7
to
935f374
Compare
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.
This is a huge PR. Can we split into smaller ones to ease reviewing and merging?
pname = "sail-riscv"; | ||
version = "0.5"; | ||
|
||
nativeBuildInputs = with ocamlPackages; [ sail ocamlbuild findlib ncurses ocaml zlib.dev z3 ]; |
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.
No need to use zlib.dev
here, zlib
is enough, stdenv automatically selects the correct output. Also only compilers/tools should reside in nativeBuildInputs
, libraries should be in buildInputs
. You may set strictDeps = true;
to make sure everything is correctly located.
|
||
outputs = [ "out" "ocaml_emu" "isabelle_model" "coq_model" "hol4_model" ]; | ||
|
||
preConfigure = "sed 's/^SAIL:=$(/SAIL:=sail #/' -i Makefile"; |
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.
set makeFlags = [ "SAIL=sail" ]
is normally enough, no need to patch the Makefile.
SAIL_DIR = "${ocamlPackages.sail}/share/sail"; | ||
SAIL = "sail"; |
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.
Move these to makeFlags
if possible.
runHook preInstall | ||
mkdir -p $out/bin | ||
cp c_emulator/riscv_sim_${arch} $out/bin | ||
mkdir -p $ocaml_emu/bin | ||
cp ocaml_emulator/riscv_ocaml_sim_${arch} $ocaml_emu/bin | ||
cp -r generated_definitions/coq/ $coq_model | ||
cp -r generated_definitions/isabelle/ $isabelle_model | ||
cp -r generated_definitions/hol4/ $hol4_model | ||
runHook postInstall |
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.
Are these files extremely large or something? Keeping everything in $out is fine in most cases.
runHook preInstall | |
mkdir -p $out/bin | |
cp c_emulator/riscv_sim_${arch} $out/bin | |
mkdir -p $ocaml_emu/bin | |
cp ocaml_emulator/riscv_ocaml_sim_${arch} $ocaml_emu/bin | |
cp -r generated_definitions/coq/ $coq_model | |
cp -r generated_definitions/isabelle/ $isabelle_model | |
cp -r generated_definitions/hol4/ $hol4_model | |
runHook postInstall | |
runHook preInstall | |
install -Dm755 c_emulator/riscv_sim_${arch} $out/bin/riscv_sim_${arch} | |
install -Dm755 ocaml_emulator/riscv_ocaml_sim_${arch} $ocaml_emu/bin/riscv_ocaml_sim_${arch} | |
cp -r generated_definitions/coq/ $coq_model | |
cp -r generated_definitions/isabelle/ $isabelle_model | |
cp -r generated_definitions/hol4/ $hol4_model | |
runHook postInstall |
}; | ||
newlib = { | ||
url = newlib.src.url; | ||
hash = "sha256-8pbjcvUTJCJNOHzBFtw3pr05cZh1Z0b5OisC6aXUAVQ="; |
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.
(same for spike and pk) Why override the hash here?
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.
The original (newlib/spike/pk).src uses fetchurl, not fetchzip, so its just more convenient
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.
However the url could change as the versions are updated, these override would slowly rotten.
mv $out/bin/lem $out/bin/.lem_wrapped | ||
makeWrapper $out/bin/.lem_wrapped $out/bin/lem --set LEMLIB $out/share/lem/library |
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.
Use wrapProgram
in stead of makeWrapper
, which automatically handles creating .foo-wrapped
.
duneVersion = "3"; | ||
minimalOCamlVersion = "4.08"; | ||
|
||
SAIL_DIR = "$out"; |
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.
Could this be moved to makeFlags
(or equivalent for buildDunePackage
, I know little about ocaml packaging.)
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.
Which part in the project need this ? maybe their is a better way.
buildPhase = '' | ||
runHook preBuild | ||
rm -r aarch* # Remove code derived from non-bsd2 arm spec | ||
rm -r snapshots # Some of this might be derived from stuff in the aarch dir, it builds fine without it | ||
dune build --release ''${enableParallelBuild:+-j $NIX_BUILD_CORES} | ||
runHook postBuild | ||
''; | ||
checkPhase = '' | ||
runHook preCheck | ||
dune runtest ''${enableParallelBuild:+-j $NIX_BUILD_CORES} | ||
runHook postCheck | ||
''; | ||
installPhase = '' | ||
runHook preInstall | ||
dune install --prefix $out --libdir $OCAMLFIND_DESTDIR | ||
runHook postInstall | ||
''; |
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.
Looks like these should have been handled by buildDunePackage
?
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.
buildDunePackage
only builds a single package from a source tree, sail
has multiple packages in the same source tree
''; | ||
postInstall = '' | ||
mv $out/bin/sail $out/bin/.sail_wrapped | ||
makeWrapper $out/bin/.sail_wrapped $out/bin/sail --set SAIL_DIR $out/share/sail |
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.
use wrapProgram
pname = "fusesoc"; | ||
version = "1.12.0"; | ||
|
||
propagatedBuildInputs = [ edalize pyparsing pyyaml simplesat ipyxact verilog verilator gnumake gcc ]; |
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.
Why are gnumake
and gcc
in propagated build inputs?
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.
it should be in propagatedNativeBuildInputs
or nativeBuildInputs
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.
theyre needed at runtime
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.
please add why doCheck are disabled otherwise it looks correct (I haven't tested)
rm -r aarch* # Remove code derived from non-bsd2 arm spec | ||
rm -r snapshots # Some of this might be derived from stuff in the aarch dir, it builds fine without it |
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.
Why not define it un preBuild hook ? since you rewrite a part of buildDunePackage
duneVersion = "3"; | ||
minimalOCamlVersion = "4.08"; | ||
|
||
SAIL_DIR = "$out"; |
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.
Which part in the project need this ? maybe their is a better way.
version = "0.55.0"; | ||
|
||
propagatedBuildInputs = [ mbstrdecoder typepy ]; | ||
doCheck = false; |
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.
Why disabling test ?
pname = "fusesoc"; | ||
version = "1.12.0"; | ||
|
||
propagatedBuildInputs = [ edalize pyparsing pyyaml simplesat ipyxact verilog verilator gnumake gcc ]; |
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.
it should be in propagatedNativeBuildInputs
or nativeBuildInputs
version = "1.1.1"; | ||
|
||
propagatedBuildInputs = [ chardet ]; | ||
doCheck = false; |
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.
Why those test are disabled
let | ||
|
||
versionFile = writeText "simplesat_ver" '' | ||
# THIS FILE IS GENERATED FROM SETUP_EXT |
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.
Can you add command if someone need to regenerate this ?
buildPythonPackage rec { | ||
pname = "tcolorpy"; | ||
version = "0.1.2"; | ||
doCheck = false; |
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.
same here
version = "1.3.0"; | ||
|
||
propagatedBuildInputs = [ mbstrdecoder python-dateutil pytz packaging ]; | ||
doCheck = false; |
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.
same here
pname = "zipfile2"; | ||
version = "0.0.12"; | ||
|
||
doCheck = false; |
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.
same here
@@ -32129,7 +32144,7 @@ with pkgs; | |||
|
|||
eiskaltdcpp = libsForQt5.callPackage ../applications/networking/p2p/eiskaltdcpp { }; | |||
|
|||
qdirstat = libsForQt5.callPackage ../applications/misc/qdirstat {}; | |||
qdirstat = libsForQt5.callPackage ../applications/misc/qdirstat { }; |
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.
please avoid unrelated change it is bad for git diff (or do this in a separate commit so it can be in .git-blame-ignore-revs
)
ofborg doesn't understands |
One for |
Just do it as you would like to. |
where do I check this? |
All sub-PRs are done |
Description of changes
Add
riscv-gnu-toolchain
,python3Packages.riscof
,python3Packages.fusesoc
and their dependenciesThings done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes