From f08e647cd67f0644e1080e86f30a88705bfcc449 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 3 Mar 2022 21:32:17 -0500 Subject: [PATCH] Add rust to binder configuration (#7732) * Add rust to binder postBuild In #7658 we updated added rust code to the Qiskit build environment. This was done to accelerate performance critical portions of the library. However, in #7658 we overlooked the binder tests which are used to perform image comparisons for visualizations in a controlled environment. The base binder docker image does not have the rust compiler installed, so we need to manually install it prior to running pip to install terra. This commit takes care of this and adds rust to the binder environment. * Install rust via conda for binder env The binder image build is implicitly installing terra as it launches. So trying to install rust manually as part of the postBuild script is too late because it will have failed by then. Looking at the available configuration files: https://mybinder.readthedocs.io/en/latest/config_files.html?#configuration-files we can install conda packages defined in environment.yml as part of the image build, and this will occur prior to the installation of terra. This commit pivots to using the environment.yml to do this and we can rely on the conda packaged version of rust instead of rustup. * Move all binder files .binder/ dir * Remove duplicate pip install in postBuild * Revert "Remove duplicate pip install in postBuild" This was actually needed, without this terra isn't actually installed. This reverts commit d61c7a68e88747cd38f82643c2b35eca33932a52. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .binder/environment.yml | 8 ++++++++ postBuild => .binder/postBuild | 0 2 files changed, 8 insertions(+) create mode 100644 .binder/environment.yml rename postBuild => .binder/postBuild (100%) diff --git a/.binder/environment.yml b/.binder/environment.yml new file mode 100644 index 000000000000..b27049ee1513 --- /dev/null +++ b/.binder/environment.yml @@ -0,0 +1,8 @@ +name: qiskit-terra-binder-test +channels: + - defaults + - conda-forge +dependencies: + - rust + - graphviz + - pip diff --git a/postBuild b/.binder/postBuild similarity index 100% rename from postBuild rename to .binder/postBuild