forked from M-Labs/artiq
nix: add rustc, migen and misoc
This allows firmware compilation.
This commit is contained in:
parent
6df4ae934f
commit
73941d4661
|
@ -1,15 +1,17 @@
|
||||||
{system ? builtins.currentSystem}:
|
{ pkgs ? import <nixpkgs> {}}:
|
||||||
|
with pkgs;
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> {inherit system;};
|
# this code was copied from nipxkgs rev. ffafe9 (nixcloud team) and slightly modified
|
||||||
callPackage = pkgs.lib.callPackageWith (pkgs // self );
|
rust = callPackage ./pkgs/rust
|
||||||
|
(stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
|
||||||
self = {
|
stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
|
||||||
binutils-or1k = callPackage ./binutils-or1k.nix {};
|
});
|
||||||
llvm-src = callPackage ./fetch-llvm-clang.nix {};
|
llvm-src = callPackage ./fetch-llvm-clang.nix {};
|
||||||
llvm-or1k = callPackage ./llvm-or1k.nix {};
|
in rec {
|
||||||
llvmlite = callPackage ./llvmlite.nix {};
|
inherit (rust) cargo rustc;
|
||||||
artiq = callPackage ./artiq.nix { };
|
inherit (callPackage ./pkgs/python3Packages.nix {}) migen misoc;
|
||||||
};
|
binutils-or1k = callPackage ./binutils-or1k.nix {};
|
||||||
artiq = self.artiq;
|
llvm-or1k = callPackage ./llvm-or1k.nix { inherit llvm-src; };
|
||||||
in
|
llvmlite = callPackage ./llvmlite.nix { inherit llvm-or1k; };
|
||||||
artiq
|
#artiq = callPackage ./artiq.nix { inherit binutils-or1k; };
|
||||||
|
}
|
||||||
|
|
|
@ -43,4 +43,3 @@ stdenv.mkDerivation rec {
|
||||||
platforms = stdenv.lib.platforms.all;
|
platforms = stdenv.lib.platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,113 @@
|
||||||
|
{ pkgs, stdenv, fetchFromGitHub, python, python3Packages }:
|
||||||
|
|
||||||
|
rec {
|
||||||
|
asyncserial = python3Packages.buildPythonPackage rec {
|
||||||
|
version = "git-09a9fc";
|
||||||
|
pname = "asyncserial";
|
||||||
|
name = "${pname}-${version}";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "m-labs";
|
||||||
|
repo = "asyncserial";
|
||||||
|
rev = "d95bc1d6c791b0e9785935d2f62f628eb5cdf98d";
|
||||||
|
sha256 = "0yzkka9jk3612v8gx748x6ziwykq5lr7zmr9wzkcls0v2yilqx9k";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3Packages; [ pyserial ] ++ (with pkgs; [ ]);
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "asyncio support for pyserial";
|
||||||
|
homepage = "https://m-labs.hk/gateware.html";
|
||||||
|
license = licenses.bsd2;
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
misoc = python3Packages.buildPythonPackage rec {
|
||||||
|
version = "git-714ea6";
|
||||||
|
pname = "misoc";
|
||||||
|
name = "${pname}-${version}";
|
||||||
|
|
||||||
|
# you can use the src definition to point to your local git checkout (don't forget the submodules) so
|
||||||
|
# hacking is easier!
|
||||||
|
#src = /home/bar/misoc;
|
||||||
|
|
||||||
|
# instead of this (nixcloud team)
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "m-labs";
|
||||||
|
repo = "misoc";
|
||||||
|
rev = "308b4728bdb1900fe3c9d71c10cc84322ad3e4ed";
|
||||||
|
sha256 = "0fc1axrwjhb86m2dwkj6h3qwwci9xw0jsvg8pzb2r8hci2v8432h";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# there are still so many tests failing (nixcloud team)
|
||||||
|
# ======================================================================
|
||||||
|
# ERROR: framebuffer (unittest.loader._FailedTest)
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# ImportError: Failed to import test module: framebuffer
|
||||||
|
# Traceback (most recent call last):
|
||||||
|
# File "/nix/store/bwfygfcdvis9wd1c1v51xwnwhw1hx0a0-python3-3.6.6/lib/python3.6/unittest/loader.py", line 153, in loadTestsFromName
|
||||||
|
# module = __import__(module_name)
|
||||||
|
# File "/build/source/misoc/cores/framebuffer/__init__.py", line 1, in <module>
|
||||||
|
# from misoc.cores.framebuffer.core import Framebuffer
|
||||||
|
# File "/build/source/misoc/cores/framebuffer/core.py", line 2, in <module>
|
||||||
|
# from migen.flow.network import *
|
||||||
|
# ModuleNotFoundError: No module named 'migen.flow'
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# watch for these messages:
|
||||||
|
# writing manifest file 'misoc.egg-info/SOURCES.txt'
|
||||||
|
# running build_ext
|
||||||
|
# /nix/store/w7cmmmzafv81wwhkadpar6vdvbqphzdf-python3.6-bootstrapped-pip-18.1/lib/python3.6/site-packages/setuptools/dist.py:398: UserWarning: Normalizing '0.6.dev' to '0.6.dev0'
|
||||||
|
# normalized_version,
|
||||||
|
# debug (unittest.loader._FailedTest)
|
||||||
|
# Run the test without collecting errors in a TestResult ... ERROR
|
||||||
|
# framebuffer (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# sdram_model (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# test (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# test_df (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# test_wb (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# test_refresher (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# test_common (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# test_lasmi (unittest.loader._FailedTest) ... ERROR
|
||||||
|
# test_bankmachine (unittest.loader._FailedTest) ... ERROR
|
||||||
|
#
|
||||||
|
# you can disable the tests (which is a bad idea, fix them instead)
|
||||||
|
# doCheck = false;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3Packages; [ pyserial jinja2 numpy asyncserial migen ];
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "A high performance and small footprint system-on-chip based on Migen https://m-labs.hk";
|
||||||
|
homepage = "https://m-labs.hk/gateware.html";
|
||||||
|
license = licenses.bsd2;
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
migen = python3Packages.buildPythonPackage rec {
|
||||||
|
version = "git-3d8a58";
|
||||||
|
pname = "migen";
|
||||||
|
name = "${pname}-${version}";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "m-labs";
|
||||||
|
repo = "migen";
|
||||||
|
rev = "3d8a58033ea0e90e435db0d14c25c86ee7d2fee2";
|
||||||
|
sha256 = "0fw70bzang79wylwsw9b47vssjnhx6mwzm00dg3b49iyg57jymvh";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/diamond' (nixcloud team)
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
propagatedBuildInputs = with python3Packages; [ colorama sphinx sphinx_rtd_theme ] ++ (with pkgs; [ verilator ]);
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "A Python toolbox for building complex digital hardware";
|
||||||
|
homepage = "https://m-labs.hk/gateware.html";
|
||||||
|
license = licenses.bsd2;
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
{ stdenv, makeWrapper, bash, buildRustPackage, curl, darwin
|
||||||
|
, version
|
||||||
|
, src
|
||||||
|
, platform
|
||||||
|
, versionType
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (stdenv.lib) optionalString;
|
||||||
|
inherit (darwin.apple_sdk.frameworks) Security;
|
||||||
|
|
||||||
|
bootstrapping = versionType == "bootstrap";
|
||||||
|
|
||||||
|
installComponents
|
||||||
|
= "rustc,rust-std-${platform}"
|
||||||
|
+ (optionalString bootstrapping ",cargo")
|
||||||
|
;
|
||||||
|
in
|
||||||
|
|
||||||
|
rec {
|
||||||
|
inherit buildRustPackage;
|
||||||
|
|
||||||
|
rustc = stdenv.mkDerivation rec {
|
||||||
|
name = "rustc-${versionType}-${version}";
|
||||||
|
|
||||||
|
inherit version;
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = http://www.rust-lang.org/;
|
||||||
|
description = "A safe, concurrent, practical language";
|
||||||
|
maintainers = with maintainers; [ qknight ];
|
||||||
|
license = [ licenses.mit licenses.asl20 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs .
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
./install.sh --prefix=$out \
|
||||||
|
--components=${installComponents}
|
||||||
|
|
||||||
|
${optionalString (stdenv.isLinux && bootstrapping) ''
|
||||||
|
patchelf \
|
||||||
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||||
|
"$out/bin/rustc"
|
||||||
|
patchelf \
|
||||||
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||||
|
"$out/bin/rustdoc"
|
||||||
|
patchelf \
|
||||||
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||||
|
"$out/bin/cargo"
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (stdenv.isDarwin && bootstrapping) ''
|
||||||
|
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustc"
|
||||||
|
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustdoc"
|
||||||
|
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
|
||||||
|
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
|
||||||
|
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
|
||||||
|
for f in $out/lib/lib*.dylib; do
|
||||||
|
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$f"
|
||||||
|
done
|
||||||
|
''}
|
||||||
|
|
||||||
|
# Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
|
||||||
|
# (or similar) here. It causes strange effects where rustc loads
|
||||||
|
# the wrong libraries in a bootstrap-build causing failures that
|
||||||
|
# are very hard to track down. For details, see
|
||||||
|
# https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
cargo = stdenv.mkDerivation rec {
|
||||||
|
name = "cargo-${versionType}-${version}";
|
||||||
|
|
||||||
|
inherit version;
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = http://www.rust-lang.org/;
|
||||||
|
description = "A safe, concurrent, practical language";
|
||||||
|
maintainers = with maintainers; [ qknight ];
|
||||||
|
license = [ licenses.mit licenses.asl20 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs .
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
patchShebangs ./install.sh
|
||||||
|
./install.sh --prefix=$out \
|
||||||
|
--components=cargo
|
||||||
|
|
||||||
|
${optionalString (stdenv.isLinux && bootstrapping) ''
|
||||||
|
patchelf \
|
||||||
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||||
|
"$out/bin/cargo"
|
||||||
|
''}
|
||||||
|
|
||||||
|
${optionalString (stdenv.isDarwin && bootstrapping) ''
|
||||||
|
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
|
||||||
|
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
|
||||||
|
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
|
||||||
|
''}
|
||||||
|
|
||||||
|
wrapProgram "$out/bin/cargo" \
|
||||||
|
--suffix PATH : "${rustc}/bin"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
{ stdenv, fetchurl, callPackage }:
|
||||||
|
|
||||||
|
let
|
||||||
|
# Note: the version MUST be one version prior to the version we're
|
||||||
|
# building
|
||||||
|
version = "1.28.0";
|
||||||
|
|
||||||
|
# fetch hashes by running `print-hashes.sh 1.24.1`
|
||||||
|
hashes = {
|
||||||
|
i686-unknown-linux-gnu = "de7cdb4e665e897ea9b10bf6fd545f900683296456d6a11d8510397bb330455f";
|
||||||
|
x86_64-unknown-linux-gnu = "2a1390340db1d24a9498036884e6b2748e9b4b057fc5219694e298bdaa37b810";
|
||||||
|
armv7-unknown-linux-gnueabihf = "346558d14050853b87049e5e1fbfae0bf0360a2f7c57433c6985b1a879c349a2";
|
||||||
|
aarch64-unknown-linux-gnu = "9b6fbcee73070332c811c0ddff399fa31965bec62ef258656c0c90354f6231c1";
|
||||||
|
i686-apple-darwin = "752e2c9182e057c4a54152d1e0b3949482c225d02bb69d9d9a4127dc2a65fb68";
|
||||||
|
x86_64-apple-darwin = "5d7a70ed4701fe9410041c1eea025c95cad97e5b3d8acc46426f9ac4f9f02393";
|
||||||
|
};
|
||||||
|
|
||||||
|
platform =
|
||||||
|
if stdenv.hostPlatform.system == "i686-linux"
|
||||||
|
then "i686-unknown-linux-gnu"
|
||||||
|
else if stdenv.hostPlatform.system == "x86_64-linux"
|
||||||
|
then "x86_64-unknown-linux-gnu"
|
||||||
|
else if stdenv.hostPlatform.system == "armv7l-linux"
|
||||||
|
then "armv7-unknown-linux-gnueabihf"
|
||||||
|
else if stdenv.hostPlatform.system == "aarch64-linux"
|
||||||
|
then "aarch64-unknown-linux-gnu"
|
||||||
|
else if stdenv.hostPlatform.system == "i686-darwin"
|
||||||
|
then "i686-apple-darwin"
|
||||||
|
else if stdenv.hostPlatform.system == "x86_64-darwin"
|
||||||
|
then "x86_64-apple-darwin"
|
||||||
|
else throw "missing bootstrap url for platform ${stdenv.hostPlatform.system}";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
|
||||||
|
sha256 = hashes."${platform}";
|
||||||
|
};
|
||||||
|
|
||||||
|
in callPackage ./binaryBuild.nix
|
||||||
|
{ inherit version src platform;
|
||||||
|
buildRustPackage = null;
|
||||||
|
versionType = "bootstrap";
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
{ stdenv, fetchurl, file, curl, pkgconfig, python, openssl, cmake, zlib
|
||||||
|
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin
|
||||||
|
, version
|
||||||
|
, patches ? []
|
||||||
|
, src }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (darwin.apple_sdk.frameworks) CoreFoundation;
|
||||||
|
src_rustc = fetchurl {
|
||||||
|
url = "https://static.rust-lang.org/dist/rustc-1.28.0-src.tar.gz";
|
||||||
|
sha256 = "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
name = "cargo-${version}";
|
||||||
|
inherit version src patches;
|
||||||
|
|
||||||
|
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
|
||||||
|
cargoVendorDir = "src/vendor";
|
||||||
|
preBuild = "cd src; pushd tools/cargo";
|
||||||
|
postBuild = "popd";
|
||||||
|
|
||||||
|
passthru.rustc = rustc;
|
||||||
|
|
||||||
|
# changes hash of vendor directory otherwise
|
||||||
|
dontUpdateAutotoolsGnuConfigScripts = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
|
buildInputs = [ cacert file curl python openssl cmake zlib makeWrapper libgit2 ]
|
||||||
|
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation libiconv ];
|
||||||
|
|
||||||
|
LIBGIT2_SYS_USE_PKG_CONFIG=1;
|
||||||
|
|
||||||
|
# fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel
|
||||||
|
RUSTC_BOOTSTRAP=1;
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
tar xf ${src_rustc}
|
||||||
|
mv rustc-1.28.0-src/src/vendor/ src/vendor
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# NOTE: We override the `http.cainfo` option usually specified in
|
||||||
|
# `.cargo/config`. This is an issue when users want to specify
|
||||||
|
# their own certificate chain as environment variables take
|
||||||
|
# precedence
|
||||||
|
wrapProgram "$out/bin/cargo" \
|
||||||
|
--suffix PATH : "${rustc}/bin" \
|
||||||
|
--set CARGO_HTTP_CAINFO "${cacert}/etc/ssl/certs/ca-bundle.crt" \
|
||||||
|
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||||
|
'';
|
||||||
|
|
||||||
|
checkPhase = ''
|
||||||
|
# Disable cross compilation tests
|
||||||
|
export CFG_DISABLE_CROSS_TESTS=1
|
||||||
|
cargo test
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Disable check phase as there are failures (4 tests fail)
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = https://crates.io;
|
||||||
|
description = "Downloads your Rust project's dependencies and builds your project";
|
||||||
|
maintainers = with maintainers; [ wizeman retrry ];
|
||||||
|
license = [ licenses.mit licenses.asl20 ];
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,90 @@
|
||||||
|
{ stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl
|
||||||
|
, targets ? []
|
||||||
|
, targetToolchains ? []
|
||||||
|
, targetPatches ? []
|
||||||
|
, fetchFromGitHub
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
|
||||||
|
version = "1.28.0";
|
||||||
|
cargoVersion = "1.28.0";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "m-labs";
|
||||||
|
repo = "rust";
|
||||||
|
sha256 = "03lfps3xvvv7wv1nnwn3n1ji13z099vx8c3fpbzp9rnasrwzp5jy";
|
||||||
|
rev = "f305fb024318e96997fbe6e4a105b0cc1052aad4"; # artiq-1.28.0 branch
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
in rec {
|
||||||
|
# nixcloud team code
|
||||||
|
or1k-crates = stdenv.mkDerivation {
|
||||||
|
name = "or1k-crates";
|
||||||
|
inherit src;
|
||||||
|
phases = [ "unpackPhase" "buildPhase" ];
|
||||||
|
buildPhase = ''
|
||||||
|
destdir=$out
|
||||||
|
rustc="${rustc_internal}/bin/rustc --out-dir ''${destdir} -L ''${destdir} --target or1k-unknown-none -g -C target-feature=+mul,+div,+ffl1,+cmov,+addc -C opt-level=s --crate-type rlib"
|
||||||
|
|
||||||
|
mkdir -p ''${destdir}
|
||||||
|
''${rustc} --crate-name core src/libcore/lib.rs
|
||||||
|
''${rustc} --crate-name compiler_builtins src/libcompiler_builtins/src/lib.rs --cfg 'feature="compiler-builtins"' --cfg 'feature="mem"'
|
||||||
|
''${rustc} --crate-name std_unicode src/libstd_unicode/lib.rs
|
||||||
|
''${rustc} --crate-name alloc src/liballoc/lib.rs
|
||||||
|
''${rustc} --crate-name libc src/liblibc_mini/lib.rs
|
||||||
|
''${rustc} --crate-name unwind src/libunwind/lib.rs
|
||||||
|
''${rustc} -Cpanic=abort --crate-name panic_abort src/libpanic_abort/lib.rs
|
||||||
|
''${rustc} -Cpanic=unwind --crate-name panic_unwind src/libpanic_unwind/lib.rs --cfg llvm_libunwind
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
# nixcloud team code
|
||||||
|
# this is basically a wrapper, which uses rustc_internal and inserts or1k-crates into it
|
||||||
|
rustc = stdenv.mkDerivation {
|
||||||
|
name = "rustc";
|
||||||
|
src = ./.;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
mkdir -p $out/lib/rustlib/or1k-unknown-none/lib/
|
||||||
|
cp -r ${or1k-crates}/* $out/lib/rustlib/or1k-unknown-none/lib/
|
||||||
|
cp -r ${rustc_internal}/* $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
# nixcloud team code
|
||||||
|
# originally rustc but now renamed to rustc_internal
|
||||||
|
rustc_internal = callPackage ./rustc.nix {
|
||||||
|
inherit stdenv llvm targets targetPatches targetToolchains rustPlatform version src;
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./patches/net-tcp-disable-tests.patch
|
||||||
|
|
||||||
|
# Re-evaluate if this we need to disable this one
|
||||||
|
#./patches/stdsimd-disable-doctest.patch
|
||||||
|
|
||||||
|
# Fails on hydra - not locally; the exact reason is unknown.
|
||||||
|
# Comments in the test suggest that some non-reproducible environment
|
||||||
|
# variables such $RANDOM can make it fail.
|
||||||
|
./patches/disable-test-inherit-env.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
forceBundledLLVM = true;
|
||||||
|
|
||||||
|
#configureFlags = [ "--release-channel=stable" ];
|
||||||
|
|
||||||
|
# 1. Upstream is not running tests on aarch64:
|
||||||
|
# see https://github.com/rust-lang/rust/issues/49807#issuecomment-380860567
|
||||||
|
# So we do the same.
|
||||||
|
# 2. Tests run out of memory for i686
|
||||||
|
#doCheck = !stdenv.isAarch64 && !stdenv.isi686;
|
||||||
|
|
||||||
|
# Disabled for now; see https://github.com/NixOS/nixpkgs/pull/42348#issuecomment-402115598.
|
||||||
|
doCheck = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
cargo = callPackage ./cargo.nix rec {
|
||||||
|
version = cargoVersion;
|
||||||
|
inherit src;
|
||||||
|
inherit stdenv;
|
||||||
|
inherit rustc; # the rustc that will be wrapped by cargo
|
||||||
|
inherit rustPlatform; # used to build cargo
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
--- rustc-1.26.2-src.org/src/libstd/process.rs 2018-06-01 21:40:11.000000000 +0100
|
||||||
|
+++ rustc-1.26.2-src/src/libstd/process.rs 2018-06-08 07:50:23.023828658 +0100
|
||||||
|
@@ -1745,6 +1745,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
+ #[ignore]
|
||||||
|
fn test_inherit_env() {
|
||||||
|
use env;
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
|
||||||
|
index 0f60b5b3e..9b08415e7 100644
|
||||||
|
--- a/src/libstd/net/tcp.rs
|
||||||
|
+++ b/src/libstd/net/tcp.rs
|
||||||
|
@@ -962,6 +962,7 @@ mod tests {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn listen_localhost() {
|
||||||
|
let socket_addr = next_test_ip4();
|
||||||
|
@@ -1020,6 +1021,7 @@ mod tests {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn read_eof() {
|
||||||
|
each_ip(&mut |addr| {
|
||||||
|
@@ -1039,6 +1041,7 @@ mod tests {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn write_close() {
|
||||||
|
each_ip(&mut |addr| {
|
||||||
|
@@ -1065,6 +1068,7 @@ mod tests {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn multiple_connect_serial() {
|
||||||
|
each_ip(&mut |addr| {
|
||||||
|
@@ -1087,6 +1091,7 @@ mod tests {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn multiple_connect_interleaved_greedy_schedule() {
|
||||||
|
const MAX: usize = 10;
|
||||||
|
@@ -1123,6 +1128,7 @@ mod tests {
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
fn multiple_connect_interleaved_lazy_schedule() {
|
||||||
|
const MAX: usize = 10;
|
||||||
|
each_ip(&mut |addr| {
|
||||||
|
@@ -1401,6 +1407,7 @@ mod tests {
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
fn clone_while_reading() {
|
||||||
|
each_ip(&mut |addr| {
|
||||||
|
let accept = t!(TcpListener::bind(&addr));
|
||||||
|
@@ -1421,7 +1422,10 @@ mod tests {
|
||||||
|
|
||||||
|
// FIXME: re-enabled bitrig/openbsd tests once their socket timeout code
|
||||||
|
// no longer has rounding errors.
|
||||||
|
- #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
|
||||||
|
+ #[cfg_attr(any(target_os = "bitrig",
|
||||||
|
+ target_os = "netbsd",
|
||||||
|
+ target_os = "openbsd",
|
||||||
|
+ target_os = "macos"), ignore)]
|
||||||
|
#[test]
|
||||||
|
fn timeouts() {
|
||||||
|
let addr = next_test_ip4();
|
||||||
|
@@ -1596,6 +1603,7 @@ mod tests {
|
||||||
|
drop(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn nodelay() {
|
||||||
|
let addr = next_test_ip4();
|
||||||
|
@@ -1610,6 +1618,7 @@ mod tests {
|
||||||
|
assert_eq!(false, t!(stream.nodelay()));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn ttl() {
|
||||||
|
let ttl = 100;
|
||||||
|
@@ -1647,6 +1656,7 @@ mod tests {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ #[cfg_attr(target_os = "macos", ignore)]
|
||||||
|
#[test]
|
||||||
|
fn peek() {
|
||||||
|
each_ip(&mut |addr| {
|
||||||
|
@@ -1679,6 +1689,7 @@ mod tests {
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
+ #[cfg_attr(any(target_os = "linux", target_os = "macos"), ignore)]
|
||||||
|
fn connect_timeout_unroutable() {
|
||||||
|
// this IP is unroutable, so connections should always time out,
|
||||||
|
// provided the network is reachable to begin with.
|
|
@ -0,0 +1,20 @@
|
||||||
|
diff --git a/src/stdsimd/coresimd/x86/mod.rs b/src/stdsimd/coresimd/x86/mod.rs
|
||||||
|
index 32915c332..7cb54f31e 100644
|
||||||
|
--- a/src/stdsimd/coresimd/x86/mod.rs
|
||||||
|
+++ b/src/stdsimd/coresimd/x86/mod.rs
|
||||||
|
@@ -279,7 +279,6 @@ types! {
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
- /// ```
|
||||||
|
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
|
||||||
|
/// # #![cfg_attr(not(dox), no_std)]
|
||||||
|
/// # #[cfg(not(dox))]
|
||||||
|
@@ -301,7 +300,6 @@ types! {
|
||||||
|
/// # }
|
||||||
|
/// # if is_x86_feature_detected!("sse") { unsafe { foo() } }
|
||||||
|
/// # }
|
||||||
|
- /// ```
|
||||||
|
pub struct __m256(f32, f32, f32, f32, f32, f32, f32, f32);
|
||||||
|
|
||||||
|
/// 256-bit wide set of four `f64` types, x86-specific
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# All rust-related downloads can be found at
|
||||||
|
# https://static.rust-lang.org/dist/index.html. To find the date on
|
||||||
|
# which a particular thing was last updated, look for the *-date.txt
|
||||||
|
# file, e.g.
|
||||||
|
# https://static.rust-lang.org/dist/channel-rust-beta-date.txt
|
||||||
|
|
||||||
|
PLATFORMS=(
|
||||||
|
i686-unknown-linux-gnu
|
||||||
|
x86_64-unknown-linux-gnu
|
||||||
|
armv7-unknown-linux-gnueabihf
|
||||||
|
aarch64-unknown-linux-gnu
|
||||||
|
i686-apple-darwin
|
||||||
|
x86_64-apple-darwin
|
||||||
|
)
|
||||||
|
BASEURL=https://static.rust-lang.org/dist
|
||||||
|
VERSION=${1:-}
|
||||||
|
DATE=${2:-}
|
||||||
|
|
||||||
|
if [[ -z $VERSION ]]
|
||||||
|
then
|
||||||
|
echo "No version supplied"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $DATE ]]
|
||||||
|
then
|
||||||
|
BASEURL=$BASEURL/$DATE
|
||||||
|
fi
|
||||||
|
|
||||||
|
for PLATFORM in "${PLATFORMS[@]}"
|
||||||
|
do
|
||||||
|
URL="$BASEURL/rust-$VERSION-$PLATFORM.tar.gz.sha256"
|
||||||
|
SHA256=$(curl -sSfL $URL | cut -d ' ' -f 1)
|
||||||
|
echo "$PLATFORM = \"$SHA256\";"
|
||||||
|
done
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ stdenv, rustc }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "rust-src";
|
||||||
|
src = rustc.src;
|
||||||
|
phases = [ "unpackPhase" "installPhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
mv src $out
|
||||||
|
rm -rf $out/{ci,doc,driver,etc,grammar,llvm,rt,rtstartup,rustllvm,test,tools,vendor}
|
||||||
|
'';
|
||||||
|
}
|
|
@ -0,0 +1,199 @@
|
||||||
|
{ stdenv, targetPackages
|
||||||
|
, fetchurl, fetchgit, fetchzip, file, python2, tzdata, ps
|
||||||
|
, llvm, jemalloc, ncurses, darwin, rustPlatform, git, cmake, curl
|
||||||
|
, which, libffi, gdb
|
||||||
|
, version
|
||||||
|
, forceBundledLLVM ? false
|
||||||
|
, src
|
||||||
|
, configureFlags ? []
|
||||||
|
, patches
|
||||||
|
, targets
|
||||||
|
, targetPatches
|
||||||
|
, targetToolchains
|
||||||
|
, doCheck ? true
|
||||||
|
, broken ? false
|
||||||
|
, pkgs
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (stdenv.lib) optional optionalString;
|
||||||
|
inherit (darwin.apple_sdk.frameworks) Security;
|
||||||
|
|
||||||
|
llvmShared = llvm.override { enableSharedLibraries = true; };
|
||||||
|
llvmOR1k = (import ../../default.nix {}).llvm-or1k;
|
||||||
|
|
||||||
|
target = builtins.replaceStrings [" "] [","] (builtins.toString targets);
|
||||||
|
src_rustc = fetchurl {
|
||||||
|
url = "https://static.rust-lang.org/dist/rustc-1.28.0-src.tar.gz";
|
||||||
|
sha256 = "11k4rn77bca2rikykkk9fmprrgjswd4x4kaq7fia08vgkir82nhx";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "rustc-${version}";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
inherit src;
|
||||||
|
|
||||||
|
__darwinAllowLocalNetworking = true;
|
||||||
|
|
||||||
|
# rustc complains about modified source files otherwise
|
||||||
|
dontUpdateAutotoolsGnuConfigScripts = true;
|
||||||
|
|
||||||
|
# Running the default `strip -S` command on Darwin corrupts the
|
||||||
|
# .rlib files in "lib/".
|
||||||
|
#
|
||||||
|
# See https://github.com/NixOS/nixpkgs/pull/34227
|
||||||
|
stripDebugList = if stdenv.isDarwin then [ "bin" ] else null;
|
||||||
|
|
||||||
|
NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${llvmShared}/lib";
|
||||||
|
|
||||||
|
# Enable nightly features in stable compiles (used for
|
||||||
|
# bootstrapping, see https://github.com/rust-lang/rust/pull/37265).
|
||||||
|
# This loosens the hard restrictions on bootstrapping-compiler
|
||||||
|
# versions.
|
||||||
|
RUSTC_BOOTSTRAP = "1";
|
||||||
|
|
||||||
|
# Increase codegen units to introduce parallelism within the compiler.
|
||||||
|
RUSTFLAGS = "-Ccodegen-units=10";
|
||||||
|
|
||||||
|
# We need rust to build rust. If we don't provide it, configure will try to download it.
|
||||||
|
# Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py
|
||||||
|
configureFlags = configureFlags
|
||||||
|
++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
|
||||||
|
++ [ "--enable-vendor" ]
|
||||||
|
# ++ [ "--jemalloc-root=${jemalloc}/lib"
|
||||||
|
++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ]
|
||||||
|
++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
|
||||||
|
++ optional (targets != []) "--target=${target}"
|
||||||
|
#++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}"
|
||||||
|
++ [ "--llvm-root=${llvmOR1k}" ] ;
|
||||||
|
|
||||||
|
# The bootstrap.py will generated a Makefile that then executes the build.
|
||||||
|
# The BOOTSTRAP_ARGS used by this Makefile must include all flags to pass
|
||||||
|
# to the bootstrap builder.
|
||||||
|
postConfigure = ''
|
||||||
|
substituteInPlace Makefile --replace 'BOOTSTRAP_ARGS :=' 'BOOTSTRAP_ARGS := --jobs $(NIX_BUILD_CORES)'
|
||||||
|
'';
|
||||||
|
|
||||||
|
# FIXME: qknight, readd deleted vendor folder from 1.28 rustc
|
||||||
|
preConfigure = ''
|
||||||
|
export HOME=$out
|
||||||
|
# HACK: we add the vendor folder from rustc 1.28 to make the compiling work
|
||||||
|
tar xf ${src_rustc}
|
||||||
|
mv rustc-1.28.0-src/src/vendor/ src/vendor
|
||||||
|
cp -R ${llvmOR1k} src/llvm
|
||||||
|
'';
|
||||||
|
|
||||||
|
patches = patches ++ targetPatches;
|
||||||
|
|
||||||
|
# the rust build system complains that nix alters the checksums
|
||||||
|
dontFixLibtool = true;
|
||||||
|
|
||||||
|
passthru.target = target;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs src/etc
|
||||||
|
|
||||||
|
# Fix dynamic linking against llvm
|
||||||
|
#${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''}
|
||||||
|
|
||||||
|
# Fix the configure script to not require curl as we won't use it
|
||||||
|
sed -i configure \
|
||||||
|
-e '/probe_need CFG_CURL curl/d'
|
||||||
|
|
||||||
|
# Fix the use of jemalloc prefixes which our jemalloc doesn't have
|
||||||
|
# TODO: reenable if we can figure out how to get our jemalloc to work
|
||||||
|
#[ -f src/liballoc_jemalloc/lib.rs ] && sed -i 's,je_,,g' src/liballoc_jemalloc/lib.rs
|
||||||
|
#[ -f src/liballoc/heap.rs ] && sed -i 's,je_,,g' src/liballoc/heap.rs # Remove for 1.4.0+
|
||||||
|
|
||||||
|
# Disable fragile tests.
|
||||||
|
rm -vr src/test/run-make/linker-output-non-utf8 || true
|
||||||
|
rm -vr src/test/run-make/issue-26092 || true
|
||||||
|
|
||||||
|
# Remove test targeted at LLVM 3.9 - https://github.com/rust-lang/rust/issues/36835
|
||||||
|
rm -vr src/test/run-pass/issue-36023.rs || true
|
||||||
|
|
||||||
|
# Disable test getting stuck on hydra - possible fix:
|
||||||
|
# https://reviews.llvm.org/rL281650
|
||||||
|
rm -vr src/test/run-pass/issue-36474.rs || true
|
||||||
|
|
||||||
|
# On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)'
|
||||||
|
sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs
|
||||||
|
|
||||||
|
# https://github.com/rust-lang/rust/issues/39522
|
||||||
|
echo removing gdb-version-sensitive tests...
|
||||||
|
find src/test/debuginfo -type f -execdir grep -q ignore-gdb-version '{}' \; -print -delete
|
||||||
|
rm src/test/debuginfo/{borrowed-c-style-enum.rs,c-style-enum-in-composite.rs,gdb-pretty-struct-and-enums-pre-gdb-7-7.rs,generic-enum-with-different-disr-sizes.rs}
|
||||||
|
|
||||||
|
# Useful debugging parameter
|
||||||
|
# export VERBOSE=1
|
||||||
|
'' + optionalString stdenv.isDarwin ''
|
||||||
|
# Disable all lldb tests.
|
||||||
|
# error: Can't run LLDB test because LLDB's python path is not set
|
||||||
|
rm -vr src/test/debuginfo/*
|
||||||
|
rm -v src/test/run-pass/backtrace-debuginfo.rs
|
||||||
|
|
||||||
|
# error: No such file or directory
|
||||||
|
rm -v src/test/run-pass/issue-45731.rs
|
||||||
|
|
||||||
|
# Disable tests that fail when sandboxing is enabled.
|
||||||
|
substituteInPlace src/libstd/sys/unix/ext/net.rs \
|
||||||
|
--replace '#[test]' '#[test] #[ignore]'
|
||||||
|
substituteInPlace src/test/run-pass/env-home-dir.rs \
|
||||||
|
--replace 'home_dir().is_some()' true
|
||||||
|
rm -v src/test/run-pass/fds-are-cloexec.rs # FIXME: pipes?
|
||||||
|
rm -v src/test/run-pass/sync-send-in-std.rs # FIXME: ???
|
||||||
|
'';
|
||||||
|
|
||||||
|
# rustc unfortunately need cmake for compiling llvm-rt but doesn't
|
||||||
|
# use it for the normal build. This disables cmake in Nix.
|
||||||
|
dontUseCmakeConfigure = true;
|
||||||
|
|
||||||
|
# ps is needed for one of the test cases
|
||||||
|
nativeBuildInputs =
|
||||||
|
[ file python2 ps rustPlatform.rust.rustc git cmake
|
||||||
|
which libffi
|
||||||
|
]
|
||||||
|
# Only needed for the debuginfo tests
|
||||||
|
++ optional (!stdenv.isDarwin) gdb;
|
||||||
|
|
||||||
|
buildInputs = [ ncurses pkgs.zlib ] ++ targetToolchains
|
||||||
|
++ optional stdenv.isDarwin Security
|
||||||
|
++ optional (!forceBundledLLVM) llvmShared;
|
||||||
|
|
||||||
|
outputs = [ "out" "man" "doc" ];
|
||||||
|
setOutputFlags = false;
|
||||||
|
|
||||||
|
# Disable codegen units and hardening for the tests.
|
||||||
|
preCheck = ''
|
||||||
|
export RUSTFLAGS=
|
||||||
|
export TZDIR=${tzdata}/share/zoneinfo
|
||||||
|
export hardeningDisable=all
|
||||||
|
'' +
|
||||||
|
# Ensure TMPDIR is set, and disable a test that removing the HOME
|
||||||
|
# variable from the environment falls back to another home
|
||||||
|
# directory.
|
||||||
|
optionalString stdenv.isDarwin ''
|
||||||
|
export TMPDIR=/tmp
|
||||||
|
sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
|
||||||
|
'';
|
||||||
|
|
||||||
|
inherit doCheck;
|
||||||
|
|
||||||
|
configurePlatforms = [];
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/pull/21742#issuecomment-272305764
|
||||||
|
# https://github.com/rust-lang/rust/issues/30181
|
||||||
|
# enableParallelBuilding = false;
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = https://www.rust-lang.org/;
|
||||||
|
description = "A safe, concurrent, practical language";
|
||||||
|
maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington ];
|
||||||
|
license = [ licenses.mit licenses.asl20 ];
|
||||||
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
|
broken = broken;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,8 +1,21 @@
|
||||||
{system ? builtins.currentSystem}:
|
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> {inherit system;};
|
pkgs = import <nixpkgs> {};
|
||||||
artiq = pkgs.callPackage ./default.nix {};
|
artiqpkgs = import ./default.nix { inherit pkgs; };
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
buildInputs = [ artiq ];
|
# with this configuration we can't build kasli target(s) because misoc packaged via nix does not work correctly
|
||||||
|
# want to build using nix-shell anyway? easy:
|
||||||
|
# 1. remove misoc from the list below
|
||||||
|
# 2. nix-shell
|
||||||
|
# 3. export PYTHONPATH=$PYTHONPATH:/home/joachim/Desktop/projects/artiq-toolchain/misoc
|
||||||
|
# 4. cd artiq/gateware/targets
|
||||||
|
# 5. python kasli.py --no-compile-gateware
|
||||||
|
buildInputs = with artiqpkgs; [ rustc cargo binutils-or1k llvm-or1k llvmlite migen misoc ]
|
||||||
|
++ (with pkgs; [ python3 python36Packages.jinja2 python36Packages.numpy ]); # for artiq the python lib...
|
||||||
|
shellHook = ''
|
||||||
|
export TARGET_AR=${artiqpkgs.binutils-or1k}/bin/or1k-linux-ar
|
||||||
|
export PYTHONPATH=$PYTHONPATH:`pwd`/..
|
||||||
|
|
||||||
|
echo "please see comments in nix/shell.nix and nix/pkgs/python3Packages.nix (nixcloud team)"
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue