From 57ca15ebb87efbf87410ea4b1dfd568467ff5106 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 15 Feb 2019 17:23:54 +0800 Subject: [PATCH] new builder for conda-artiq --- artiq/conda-artiq.nix | 80 +++++++++++++++++++++++++++++++++++++++++++ artiq/conda-board.nix | 2 +- artiq/conda-build.nix | 12 +------ main.nix | 8 ++--- 4 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 artiq/conda-artiq.nix diff --git a/artiq/conda-artiq.nix b/artiq/conda-artiq.nix new file mode 100644 index 0000000..f90f103 --- /dev/null +++ b/artiq/conda-artiq.nix @@ -0,0 +1,80 @@ +{ pkgs ? import {}}: +{ artiqSrc }: + +with pkgs; + +let + fakeCondaSource = runCommand "fake-condasrc-artiq" { } + '' + cp --no-preserve=mode,ownership -R ${artiqSrc} $out + mkdir $out/fake-conda; + + cat << EOF > $out/fake-conda/meta.yaml + package: + name: artiq + version: 5e.{{ environ["GIT_FULL_HASH"][:8] }} + + source: + git_url: .. + + {% set data = load_setup_py_data() %} + + build: + noarch: python + entry_points: + # NOTE: conda-build cannot distinguish between console and gui scripts + {% for entry_point_type, entry_points in data.get("entry_points", dict()).items() -%} + {% for entry_point in entry_points -%} + - {{ entry_point }} + {% endfor %} + {% endfor %} + ignore_prefix_files: True + + requirements: + run: + - python >=3.5.3,<3.6 + - llvmlite-artiq 0.23.0.dev py35_5 + - binutils-or1k-linux >=2.27 + - pythonparser >=1.1 + - openocd 0.10.0 6 + - lit + - outputcheck + - scipy + - numpy + - prettytable + - asyncserial + - h5py 2.8 + - python-dateutil + - pyqt >=5.5 + - quamash + - pyqtgraph 0.10.0 + - pygit2 + - aiohttp >=3 + - levenshtein + + about: + home: https://m-labs.hk/artiq + license: LGPL + summary: 'A leading-edge control system for quantum information experiments' + EOF + + cat << EOF > $out/fake-conda/build.sh + #!/bin/bash + set -e + + python setup.py install \ + --prefix=\$PREFIX \ + --single-version-externally-managed \ + --record=record.txt \ + --no-compile + + EOF + chmod 755 $out/fake-conda/build.sh + ''; + conda-artiq = import ./conda-build.nix { inherit pkgs; } { + name = "conda-artiq"; + src = fakeCondaSource; + recipe = "fake-conda"; + }; +in + conda-artiq diff --git a/artiq/conda-board.nix b/artiq/conda-board.nix index f2dd761..4f17401 100644 --- a/artiq/conda-board.nix +++ b/artiq/conda-board.nix @@ -4,7 +4,7 @@ with pkgs; let - fakeCondaSource = runCommand "fake-conda-source-${target}-${variant}" { } + fakeCondaSource = runCommand "fake-condasrc-artiq-board-${target}-${variant}" { } '' cp --no-preserve=mode,ownership -R ${artiqSrc} $out mkdir $out/fake-conda; diff --git a/artiq/conda-build.nix b/artiq/conda-build.nix index 22dd9eb..2213380 100644 --- a/artiq/conda-build.nix +++ b/artiq/conda-build.nix @@ -46,18 +46,8 @@ in stdenv.mkDerivation { buildCommand = '' HOME=`pwd` - # Build requirements make conda-build fail when disconnected from the internet, e.g. in the nix sandbox. - # Just ignore them - python and setuptools are installed anyway. - cat << EOF > clobber.yaml - requirements: - build: - - build: - script_env: - - PYTHON - EOF mkdir $out - ${condaBuilderEnv}/bin/conda-builder-env -c "PYTHON=python conda build --clobber-file clobber.yaml --no-anaconda-upload --no-test --output-folder $out $src/${recipe}" + ${condaBuilderEnv}/bin/conda-builder-env -c "PYTHON=python conda build --no-anaconda-upload --no-test --output-folder $out $src/${recipe}" mkdir -p $out/nix-support echo file conda $out/noarch/*.tar.bz2 >> $out/nix-support/hydra-build-products diff --git a/main.nix b/main.nix index f9e2d9b..e609252 100644 --- a/main.nix +++ b/main.nix @@ -40,11 +40,9 @@ let }) {} boards; jobs = { - #conda-artiq = import "${generatedNix}/conda-build.nix" { inherit pkgs; } { - # name = "conda-artiq"; - # src = import "${generatedNix}/pkgs/artiq-src.nix" { fetchgit = pkgs.fetchgit; }; - # recipe = "conda/artiq"; - #}; + conda-artiq = import "${generatedNix}/conda-artiq.nix" { inherit pkgs; } { + artiqSrc = import "${generatedNix}/pkgs/artiq-src.nix" { fetchgit = pkgs.fetchgit; }; + }; } // boardJobs // artiqPkgs; in jobs // {