forked from M-Labs/artiq
flake: switch to nightly rust with mozilla overlay
This commit is contained in:
parent
1b516b16e2
commit
8c468d0346
17
flake.lock
17
flake.lock
|
@ -1,5 +1,21 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"mozilla-overlay": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1627922300,
|
||||||
|
"narHash": "sha256-/5fyO/265Wrli2pHpe1/i9Lu8XnQ5K+2YLz9Sz568cI=",
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"rev": "b1001ed670666ca4ce1c1b064481f88694315c1d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "mozilla",
|
||||||
|
"repo": "nixpkgs-mozilla",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1628696776,
|
"lastModified": 1628696776,
|
||||||
|
@ -18,6 +34,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"mozilla-overlay": "mozilla-overlay",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"src-pythonparser": "src-pythonparser",
|
"src-pythonparser": "src-pythonparser",
|
||||||
"src-sipyco": "src-sipyco"
|
"src-sipyco": "src-sipyco"
|
||||||
|
|
203
flake.nix
203
flake.nix
|
@ -2,108 +2,127 @@
|
||||||
description = "A leading-edge control system for quantum information experiments";
|
description = "A leading-edge control system for quantum information experiments";
|
||||||
|
|
||||||
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-21.05;
|
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-21.05;
|
||||||
|
inputs.mozilla-overlay = { url = github:mozilla/nixpkgs-mozilla; flake = false; };
|
||||||
inputs.src-sipyco = { url = github:m-labs/sipyco; flake = false; };
|
inputs.src-sipyco = { url = github:m-labs/sipyco; flake = false; };
|
||||||
inputs.src-pythonparser = { url = github:m-labs/pythonparser; flake = false; };
|
inputs.src-pythonparser = { url = github:m-labs/pythonparser; flake = false; };
|
||||||
|
|
||||||
outputs = { self, nixpkgs, src-sipyco, src-pythonparser }: with import nixpkgs { system = "x86_64-linux"; }; rec {
|
outputs = { self, nixpkgs, mozilla-overlay, src-sipyco, src-pythonparser }:
|
||||||
packages.x86_64-linux = rec {
|
let
|
||||||
sipyco = python3Packages.buildPythonPackage {
|
pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ (import mozilla-overlay) ]; };
|
||||||
name = "sipyco";
|
rustManifest = pkgs.fetchurl {
|
||||||
src = src-sipyco;
|
url = "https://static.rust-lang.org/dist/2021-01-29/channel-rust-nightly.toml";
|
||||||
propagatedBuildInputs = with python3Packages; [ pybase64 numpy ];
|
sha256 = "sha256-EZKgw89AH4vxaJpUHmIMzMW/80wAFQlfcxRoBD9nz0c=";
|
||||||
};
|
};
|
||||||
|
targets = [];
|
||||||
pythonparser = python3Packages.buildPythonPackage {
|
rustChannelOfTargets = _channel: _date: targets:
|
||||||
name = "pythonparser";
|
(pkgs.lib.rustLib.fromManifestFile rustManifest {
|
||||||
src = src-pythonparser;
|
inherit (pkgs) stdenv lib fetchurl patchelf;
|
||||||
doCheck = false;
|
}).rust.override {
|
||||||
propagatedBuildInputs = with python3Packages; [ regex ];
|
inherit targets;
|
||||||
};
|
extensions = ["rust-src"];
|
||||||
|
|
||||||
qasync = python3Packages.buildPythonPackage rec {
|
|
||||||
pname = "qasync";
|
|
||||||
version = "0.10.0";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "CabbageDevelopment";
|
|
||||||
repo = "qasync";
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "1zga8s6dr7gk6awmxkh4pf25gbg8n6dv1j4b0by7y0fhi949qakq";
|
|
||||||
};
|
};
|
||||||
propagatedBuildInputs = [ python3Packages.pyqt5 ];
|
rust = rustChannelOfTargets "nightly" null targets;
|
||||||
checkInputs = [ python3Packages.pytest ];
|
rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
|
||||||
checkPhase = ''
|
rustc = rust;
|
||||||
pytest -k 'test_qthreadexec.py' # the others cause the test execution to be aborted, I think because of asyncio
|
cargo = rust;
|
||||||
'';
|
});
|
||||||
};
|
in rec {
|
||||||
|
packages.x86_64-linux = rec {
|
||||||
outputcheck = python3Packages.buildPythonApplication rec {
|
sipyco = pkgs.python3Packages.buildPythonPackage {
|
||||||
pname = "outputcheck";
|
name = "sipyco";
|
||||||
version = "0.4.2";
|
src = src-sipyco;
|
||||||
src = fetchFromGitHub {
|
propagatedBuildInputs = with pkgs.python3Packages; [ pybase64 numpy ];
|
||||||
owner = "stp";
|
|
||||||
repo = "OutputCheck";
|
|
||||||
rev = "e0f533d3c5af2949349856c711bf4bca50022b48";
|
|
||||||
sha256 = "1y27vz6jq6sywas07kz3v01sqjd0sga9yv9w2cksqac3v7wmf2a0";
|
|
||||||
};
|
};
|
||||||
prePatch = "echo ${version} > RELEASE-VERSION";
|
|
||||||
};
|
|
||||||
|
|
||||||
libartiq-support = stdenv.mkDerivation {
|
pythonparser = pkgs.python3Packages.buildPythonPackage {
|
||||||
name = "libartiq-support";
|
name = "pythonparser";
|
||||||
src = self;
|
src = src-pythonparser;
|
||||||
buildInputs = [ rustc ];
|
doCheck = false;
|
||||||
buildPhase = ''
|
propagatedBuildInputs = with pkgs.python3Packages; [ regex ];
|
||||||
# Obviously, #[feature()] can in fact be used on the stable channel, contrary to what the rustc error message says.
|
};
|
||||||
# You just need to set this obscure RUSTC_BOOTSTRAP environment variable.
|
|
||||||
RUSTC_BOOTSTRAP=1 rustc $src/artiq/test/libartiq_support/lib.rs -Cpanic=unwind -g
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
|
||||||
mkdir $out
|
|
||||||
cp libartiq_support.so $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
artiq = python3Packages.buildPythonPackage rec {
|
qasync = pkgs.python3Packages.buildPythonPackage rec {
|
||||||
pname = "artiq";
|
pname = "qasync";
|
||||||
version = "7.0-dev";
|
version = "0.10.0";
|
||||||
src = self;
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "CabbageDevelopment";
|
||||||
preBuild = "export VERSIONEER_OVERRIDE=${version}";
|
repo = "qasync";
|
||||||
|
rev = "v${version}";
|
||||||
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
|
sha256 = "1zga8s6dr7gk6awmxkh4pf25gbg8n6dv1j4b0by7y0fhi949qakq";
|
||||||
# keep llvm_x and lld_x in sync with llvmlite
|
};
|
||||||
propagatedBuildInputs = [ llvm_9 lld_9 sipyco pythonparser ]
|
propagatedBuildInputs = [ pkgs.python3Packages.pyqt5 ];
|
||||||
++ (with python3Packages; [ pyqtgraph pygit2 numpy dateutil scipy prettytable pyserial python-Levenshtein h5py pyqt5 qasync llvmlite ]);
|
checkInputs = [ pkgs.python3Packages.pytest ];
|
||||||
|
checkPhase = ''
|
||||||
dontWrapQtApps = true;
|
pytest -k 'test_qthreadexec.py' # the others cause the test execution to be aborted, I think because of asyncio
|
||||||
postFixup = ''
|
|
||||||
wrapQtApp "$out/bin/artiq_dashboard"
|
|
||||||
wrapQtApp "$out/bin/artiq_browser"
|
|
||||||
wrapQtApp "$out/bin/artiq_session"
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
|
|
||||||
# Allows subprocesses using python to find all packages you have installed
|
|
||||||
makeWrapperArgs = [
|
|
||||||
''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' ''
|
|
||||||
"--set FONTCONFIG_FILE ${fontconfig.out}/etc/fonts/fonts.conf"
|
|
||||||
];
|
|
||||||
|
|
||||||
# FIXME: automatically propagate lld_9 llvm_9 dependencies
|
|
||||||
checkInputs = [ lld_9 llvm_9 outputcheck lit ];
|
|
||||||
checkPhase = ''
|
|
||||||
python -m unittest discover -v artiq.test
|
|
||||||
|
|
||||||
TESTDIR=`mktemp -d`
|
|
||||||
cp --no-preserve=mode,ownership -R $src/artiq/test/lit $TESTDIR
|
|
||||||
# FIXME: some tests fail
|
|
||||||
#LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so lit -v $TESTDIR/lit
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
defaultPackage.x86_64-linux = python3.withPackages(ps: [ packages.x86_64-linux.artiq ]);
|
outputcheck = pkgs.python3Packages.buildPythonApplication rec {
|
||||||
};
|
pname = "outputcheck";
|
||||||
|
version = "0.4.2";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "stp";
|
||||||
|
repo = "OutputCheck";
|
||||||
|
rev = "e0f533d3c5af2949349856c711bf4bca50022b48";
|
||||||
|
sha256 = "1y27vz6jq6sywas07kz3v01sqjd0sga9yv9w2cksqac3v7wmf2a0";
|
||||||
|
};
|
||||||
|
prePatch = "echo ${version} > RELEASE-VERSION";
|
||||||
|
};
|
||||||
|
|
||||||
|
libartiq-support = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "libartiq-support";
|
||||||
|
src = self;
|
||||||
|
buildInputs = [ rustPlatform.rust.rustc ];
|
||||||
|
buildPhase = ''
|
||||||
|
rustc $src/artiq/test/libartiq_support/lib.rs -Cpanic=unwind -g
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp libartiq_support.so $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
artiq = pkgs.python3Packages.buildPythonPackage rec {
|
||||||
|
pname = "artiq";
|
||||||
|
version = "7.0-dev";
|
||||||
|
src = self;
|
||||||
|
|
||||||
|
preBuild = "export VERSIONEER_OVERRIDE=${version}";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ];
|
||||||
|
# keep llvm_x and lld_x in sync with llvmlite
|
||||||
|
propagatedBuildInputs = [ pkgs.llvm_9 pkgs.lld_9 sipyco pythonparser ]
|
||||||
|
++ (with pkgs.python3Packages; [ pyqtgraph pygit2 numpy dateutil scipy prettytable pyserial python-Levenshtein h5py pyqt5 qasync llvmlite ]);
|
||||||
|
|
||||||
|
dontWrapQtApps = true;
|
||||||
|
postFixup = ''
|
||||||
|
wrapQtApp "$out/bin/artiq_dashboard"
|
||||||
|
wrapQtApp "$out/bin/artiq_browser"
|
||||||
|
wrapQtApp "$out/bin/artiq_session"
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
|
||||||
|
# Allows subprocesses using python to find all packages you have installed
|
||||||
|
makeWrapperArgs = [
|
||||||
|
''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' ''
|
||||||
|
"--set FONTCONFIG_FILE ${pkgs.fontconfig.out}/etc/fonts/fonts.conf"
|
||||||
|
];
|
||||||
|
|
||||||
|
# FIXME: automatically propagate lld_9 llvm_9 dependencies
|
||||||
|
checkInputs = [ pkgs.lld_9 pkgs.llvm_9 pkgs.lit outputcheck ];
|
||||||
|
checkPhase = ''
|
||||||
|
python -m unittest discover -v artiq.test
|
||||||
|
|
||||||
|
TESTDIR=`mktemp -d`
|
||||||
|
cp --no-preserve=mode,ownership -R $src/artiq/test/lit $TESTDIR
|
||||||
|
# FIXME: some tests fail
|
||||||
|
#LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so lit -v $TESTDIR/lit
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultPackage.x86_64-linux = pkgs.python3.withPackages(ps: [ packages.x86_64-linux.artiq ]);
|
||||||
|
};
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
binaryCachePublicKeys = ["nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="];
|
binaryCachePublicKeys = ["nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="];
|
||||||
|
|
Loading…
Reference in New Issue