From c46a59dd130ccb7c4a4ce69f13d5f2b1071c1dc9 Mon Sep 17 00:00:00 2001 From: Maximilian Scheurer Date: Sat, 28 Nov 2020 12:19:45 +0100 Subject: [PATCH] Fixes for conda on GHA (#103) * temporary fix conda pybind11 2.6 issue * try to fix ccache * try to fix pytest * fix weird error * set home dir correctly * annoying * only pybind11 from copy * all c-f * try blas=mkl * revert and install verify * pin new adccore * remove flag * downgrad core * bump macos in ci, add todo --- .github/workflows/ci.yaml | 2 +- conda/build.sh | 1 + conda/conda_build_config.yaml | 2 +- scripts/upload_to_anaconda.sh | 4 ++-- setup.py | 13 ++++++++++++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1d8d122f..c4ed93a9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: include: - {version: '3.6', os: ubuntu-latest} - {version: '3.8', os: ubuntu-latest} - - {version: '3.6', os: macOS-10.14 } + - {version: '3.6', os: macOS-10.15 } steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/conda/build.sh b/conda/build.sh index 8ce04945..2fac9e86 100644 --- a/conda/build.sh +++ b/conda/build.sh @@ -4,6 +4,7 @@ set -eu # Setup wrapper scripts for ccache during adcc builds ccache -M 1Gi +mkdir -p $HOME/bin rm -rf $HOME/bin/cc rm -rf $HOME/bin/cxx echo -e '#!/bin/sh\n' "ccache $CC \$@" > $HOME/bin/cc diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml index a21e9d03..14af0423 100644 --- a/conda/conda_build_config.yaml +++ b/conda/conda_build_config.yaml @@ -9,7 +9,7 @@ target_platform: - osx-64 # [osx] - linux-64 # [linux] CONDA_BUILD_SYSROOT: - - /Users/travis/MacOSX10.9.sdk # [osx] + - /Users/runner/MacOSX10.9.sdk # [osx] c_compiler_version: - 7.3.0 # [linux] - 4 # [osx] diff --git a/scripts/upload_to_anaconda.sh b/scripts/upload_to_anaconda.sh index d70a031c..eb3c4f0b 100755 --- a/scripts/upload_to_anaconda.sh +++ b/scripts/upload_to_anaconda.sh @@ -40,9 +40,9 @@ fi < conda/meta.yaml.in sed "s/@ADCC_VERSION@/$ADCC_VERSION/g;" > conda/meta.yaml # Install requirements and setup channels -conda install conda-build anaconda-client --yes +conda install conda-build anaconda-client conda-verify --yes # conda config --append channels psi4/label/dev # conda config --append channels pyscf # Running build and deployment -conda build conda --user adcc --token $ANACONDA_TOKEN --label $LABEL +conda build conda -c defaults -c conda-forge --user adcc --token $ANACONDA_TOKEN --label $LABEL diff --git a/setup.py b/setup.py index c71048c7..de3931ea 100755 --- a/setup.py +++ b/setup.py @@ -53,7 +53,10 @@ def finalize_options(self): def is_conda_build(): - return os.environ.get("CONDA_BUILD", None) == "1" + return ( + os.environ.get("CONDA_BUILD", None) == "1" + or os.environ.get("CONDA_EXE", None) + ) def get_adccore_data(): @@ -64,6 +67,13 @@ def get_adccore_data(): import AdcCore + # TODO: find a more sustainable and clean solution ASAP + if is_conda_build(): + os.environ["LDFLAGS_LD"] = \ + os.environ["LDFLAGS_LD"].replace("-dead_strip_dylibs", "") + os.environ["LDFLAGS"] = \ + os.environ["LDFLAGS"].replace("-Wl,-dead_strip_dylibs", "") + adccore = AdcCore.AdcCore() if not adccore.is_config_file_present \ or adccore.version != adccore_version[0] \ @@ -132,6 +142,7 @@ def adccsetup(*args, **kwargs): """Wrapper around setup, displaying a link to adc-connect.org on any error.""" if is_conda_build(): kwargs.pop("install_requires") + kwargs.pop("tests_require") try: setup(*args, **kwargs) except Exception as e: