From 0899df19b77e2e066dd63433f01c66578b086ad0 Mon Sep 17 00:00:00 2001 From: "Bloemert Arnold (TT-RHC/EAE2.2)" Date: Sat, 20 Feb 2021 14:04:15 +0100 Subject: [PATCH 1/3] Always use PREFIX instead of LIBRARY_PREFIX This allows ruby packages to be generic noarch packages. --- recipe/activate.msh | 9 ++------- recipe/activate.ps1 | 9 ++------- recipe/activate.sh | 9 ++------- recipe/bld.bat | 8 ++++---- recipe/deactivate.bat | 2 +- recipe/deactivate.msh | 1 - recipe/deactivate.ps1 | 2 -- recipe/deactivate.sh | 2 -- 8 files changed, 11 insertions(+), 31 deletions(-) diff --git a/recipe/activate.msh b/recipe/activate.msh index 2fbb31b..f819965 100644 --- a/recipe/activate.msh +++ b/recipe/activate.msh @@ -1,7 +1,2 @@ -if_(is_set("COMSPEC")).then_([ - export("GEM_HOME", path.join(env("CONDA_PREFIX"), "Library/share/rubygems")), - sys.path_prepend(path.join(env("CONDA_PREFIX"), "Library/share/rubygems/bin")) -]).else_([ - export("GEM_HOME", path.join(env("CONDA_PREFIX"), "share/rubygems")), - sys.path_prepend(path.join(env("CONDA_PREFIX"), "share/rubygems/bin")) -]) \ No newline at end of file +export("GEM_HOME", path.join(env("CONDA_PREFIX"), "share/rubygems")), +sys.path_prepend(path.join(env("CONDA_PREFIX"), "share/rubygems/bin")) \ No newline at end of file diff --git a/recipe/activate.ps1 b/recipe/activate.ps1 index 3a03c7f..628d8e9 100644 --- a/recipe/activate.ps1 +++ b/recipe/activate.ps1 @@ -1,7 +1,2 @@ -if (Test-Path env:COMSPEC) { - $Env:GEM_HOME=$(Join-Path -Path $Env:CONDA_PREFIX -ChildPath Library/share/rubygems) - $Env:PATH="$(Join-Path -Path $Env:CONDA_PREFIX -ChildPath Library/share/rubygems/bin);$Env:PATH" -} else { - $Env:GEM_HOME=$(Join-Path -Path $Env:CONDA_PREFIX -ChildPath share/rubygems) - $Env:PATH="$(Join-Path -Path $Env:CONDA_PREFIX -ChildPath share/rubygems/bin);$Env:PATH" -} \ No newline at end of file +$Env:GEM_HOME=$(Join-Path -Path $Env:CONDA_PREFIX -ChildPath share/rubygems) +$Env:PATH="$(Join-Path -Path $Env:CONDA_PREFIX -ChildPath share/rubygems/bin);$Env:PATH" \ No newline at end of file diff --git a/recipe/activate.sh b/recipe/activate.sh index 9394e8e..cdab325 100644 --- a/recipe/activate.sh +++ b/recipe/activate.sh @@ -1,7 +1,2 @@ -if [ -z "$COMSPEC" ]; then - export GEM_HOME=$CONDA_PREFIX/share/rubygems/ - export PATH="$CONDA_PREFIX/share/rubygems/bin:$PATH" -else - export GEM_HOME=$CONDA_PREFIX/Library/share/rubygems/ - export PATH="$CONDA_PREFIX/Library/share/rubygems/bin:$PATH" -fi \ No newline at end of file +export GEM_HOME=$CONDA_PREFIX/share/rubygems/ +export PATH="$CONDA_PREFIX/share/rubygems/bin:$PATH" \ No newline at end of file diff --git a/recipe/bld.bat b/recipe/bld.bat index 6c1beb0..33ae5ea 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -2,7 +2,7 @@ setlocal enableextensions RMDIR /s /q ext\fiddle\libffi-3.2.1 -CALL win32\configure.bat --prefix=%LIBRARY_PREFIX% +CALL win32\configure.bat --prefix=%PREFIX% if %errorlevel% neq 0 exit /b %errorlevel% nmake @@ -11,13 +11,13 @@ if %errorlevel% neq 0 exit /b %errorlevel% nmake install if %errorlevel% neq 0 exit /b %errorlevel% -mkdir %LIBRARY_PREFIX%\etc +mkdir %PREFIX%\etc if %errorlevel% neq 0 exit /b %errorlevel% -mkdir %LIBRARY_PREFIX%\share\rubygems +mkdir %PREFIX%\share\rubygems if %errorlevel% neq 0 exit /b %errorlevel% -echo "gemhome: %LIBRARY_PREFIX%/share/rubygems" > %LIBRARY_PREFIX%/etc/gemrc +echo "gemhome: %PREFIX%/share/rubygems" > %PREFIX%/etc/gemrc if %errorlevel% neq 0 exit /b %errorlevel% setlocal EnableDelayedExpansion diff --git a/recipe/deactivate.bat b/recipe/deactivate.bat index d6662a0..eef4b2a 100644 --- a/recipe/deactivate.bat +++ b/recipe/deactivate.bat @@ -29,4 +29,4 @@ goto :EOF :start set GEM_HOME= -call :removeFromPath "%CONDA_PREFIX%\Library\share\rubygems\bin" \ No newline at end of file +call :removeFromPath "%CONDA_PREFIX%\share\rubygems\bin" \ No newline at end of file diff --git a/recipe/deactivate.msh b/recipe/deactivate.msh index fd9763f..8365adb 100644 --- a/recipe/deactivate.msh +++ b/recipe/deactivate.msh @@ -1,3 +1,2 @@ unset(env("GEM_HOME")) -sys.path_remove(path.join(env("CONDA_PREFIX"), "Library/share/rubygems/bin")) sys.path_remove(path.join(env("CONDA_PREFIX"), "share/rubygems/bin")) \ No newline at end of file diff --git a/recipe/deactivate.ps1 b/recipe/deactivate.ps1 index 10aef94..62a67f1 100644 --- a/recipe/deactivate.ps1 +++ b/recipe/deactivate.ps1 @@ -1,6 +1,4 @@ try { Remove-Item env:GEM_HOME} catch { Write-Host "Failed to execute Remove-Item env:GEM_HOME" } -$rmpath = $(Join-Path -Path $Env:CONDA_PREFIX -ChildPath Library/share/rubygems/bin) -$Env:PATH = ($Env:PATH.Split(';') | Where-Object { $_ -ne $rmpath }) -join ';' $rmpath = $(Join-Path -Path $Env:CONDA_PREFIX -ChildPath share/rubygems/bin) $Env:PATH = ($Env:PATH.Split(';') | Where-Object { $_ -ne $rmpath }) -join ';' \ No newline at end of file diff --git a/recipe/deactivate.sh b/recipe/deactivate.sh index 837bec1..a7c5c88 100644 --- a/recipe/deactivate.sh +++ b/recipe/deactivate.sh @@ -1,6 +1,5 @@ if [ "$ZSH_VERSION" != "" ]; then unset GEM_HOME - path=(${path[@]:#"$CONDA_PREFIX/Library/share/rubygems/bin"}) path=(${path[@]:#"$CONDA_PREFIX/share/rubygems/bin"}) else # Taken from http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html @@ -19,6 +18,5 @@ else export $PATHVARIABLE="$NEWPATH" } unset GEM_HOME - pathremove "$CONDA_PREFIX/Library/share/rubygems/bin" pathremove "$CONDA_PREFIX/share/rubygems/bin" fi \ No newline at end of file From 0388ce68a33ca21829febf9c835d8627b9a19733 Mon Sep 17 00:00:00 2001 From: "Bloemert Arnold (TT-RHC/EAE2.2)" Date: Sat, 20 Feb 2021 14:07:22 +0100 Subject: [PATCH 2/3] Increase build number --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index bf5f8b4..e7caa9e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -16,7 +16,7 @@ source: - fix-isinf-redefinition-msvc.patch # [win] build: - number: 5 + number: 6 track_features: - rb{{ major_minor | replace(".", "") }} run_exports: From dd413f3ed40b3f45a870cb7b72f1a6fc69ec5d76 Mon Sep 17 00:00:00 2001 From: conda-forge-linter Date: Fri, 29 Oct 2021 18:26:33 +0000 Subject: [PATCH 3/3] MNT: Re-rendered with conda-build 3.21.4, conda-smithy 3.14.1, and conda-forge-pinning 2021.10.29.07.34.22 --- .azure-pipelines/azure-pipelines-linux.yml | 5 +++++ .azure-pipelines/azure-pipelines-osx.yml | 5 +++++ .azure-pipelines/azure-pipelines-win.yml | 6 +++--- .ci_support/linux_64_.yaml | 4 +--- .ci_support/linux_aarch64_.yaml | 2 -- .ci_support/linux_ppc64le_.yaml | 4 +--- .ci_support/osx_64_.yaml | 4 +--- .ci_support/osx_arm64_.yaml | 4 +--- .ci_support/win_64_.yaml | 4 +--- .drone.yml | 1 + .scripts/build_steps.sh | 9 +++++---- .scripts/run_docker_build.sh | 7 +++++-- .scripts/run_osx_build.sh | 8 +++++--- .travis.yml | 3 ++- build-locally.py | 1 + 15 files changed, 37 insertions(+), 30 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index f04e699..8d62612 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -32,6 +32,11 @@ jobs: export CI=azure export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi .scripts/run_docker_build.sh displayName: Run docker build env: diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 39baad3..84d4f42 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -23,6 +23,11 @@ jobs: export OSX_FORCE_SDK_DOWNLOAD="1" export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi ./.scripts/run_osx_build.sh displayName: Run OSX build env: diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 117b337..b6ce7ac 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -52,7 +52,7 @@ jobs: - task: CondaEnvironment@1 inputs: - packageSpecs: 'python=3.6 conda-build conda "conda-forge-ci-setup=3" pip' # Optional + packageSpecs: 'python=3.9 conda-build conda "conda-forge-ci-setup=3" pip boa' # Optional installOptions: "-c conda-forge" updateConda: true displayName: Install conda-build and activate environment @@ -86,7 +86,7 @@ jobs: - script: | call activate base - conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables + conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables displayName: Build recipe env: PYTHONUNBUFFERED: 1 @@ -107,4 +107,4 @@ jobs: BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) - condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False'))) \ No newline at end of file + condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False')), not(eq(variables['Build.Reason'], 'PullRequest'))) \ No newline at end of file diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 99367e0..dc38be1 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -5,7 +5,7 @@ c_compiler_version: cdt_name: - cos6 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cxx_compiler: @@ -29,8 +29,6 @@ pin_run_as_build: max_pin: x.x ncurses: max_pin: x.x - openssl: - max_pin: x.x.x readline: max_pin: x zlib: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index cef3026..4be540f 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -33,8 +33,6 @@ pin_run_as_build: max_pin: x.x ncurses: max_pin: x.x - openssl: - max_pin: x.x.x readline: max_pin: x zlib: diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index ab2c1a3..7ba0abf 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -5,7 +5,7 @@ c_compiler_version: cdt_name: - cos7 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cxx_compiler: @@ -29,8 +29,6 @@ pin_run_as_build: max_pin: x.x ncurses: max_pin: x.x - openssl: - max_pin: x.x.x readline: max_pin: x zlib: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index b5a8ba4..2accc56 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -5,7 +5,7 @@ c_compiler: c_compiler_version: - '11' channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cxx_compiler: @@ -29,8 +29,6 @@ pin_run_as_build: max_pin: x.x ncurses: max_pin: x.x - openssl: - max_pin: x.x.x readline: max_pin: x zlib: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index a4e15d9..88b5a7f 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -5,7 +5,7 @@ c_compiler: c_compiler_version: - '11' channel_sources: -- conda-forge/label/rust_dev,conda-forge +- conda-forge channel_targets: - conda-forge main cxx_compiler: @@ -29,8 +29,6 @@ pin_run_as_build: max_pin: x.x ncurses: max_pin: x.x - openssl: - max_pin: x.x.x readline: max_pin: x zlib: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 9669fb5..29ef76d 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -1,7 +1,7 @@ c_compiler: - vs2017 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cxx_compiler: @@ -9,8 +9,6 @@ cxx_compiler: openssl: - 1.1.1 pin_run_as_build: - openssl: - max_pin: x.x.x zlib: max_pin: x.x target_platform: diff --git a/.drone.yml b/.drone.yml index af15091..f816045 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,6 +25,7 @@ steps: - export CI=drone - export GIT_BRANCH="$DRONE_BRANCH" - export FEEDSTOCK_NAME=$(basename ${DRONE_REPO_NAME}) + - export IS_PR_BUILD=$(if [[ "$${DRONE_PULL_REQUEST:-}" == "" ]]; then echo "False"; else echo "True"; fi) - sed -i '$ichown -R conda:conda "$FEEDSTOCK_ROOT"' /opt/docker/bin/entrypoint - /opt/docker/bin/entrypoint $FEEDSTOCK_ROOT/.scripts/build_steps.sh - echo "Done building" diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 99baf86..9008710 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -25,7 +25,8 @@ conda-build: root-dir: ${FEEDSTOCK_ROOT}/build_artifacts CONDARC -BUILD_CMD=build +GET_BOA=boa +BUILD_CMD=mambabuild conda install --yes --quiet "conda-forge-ci-setup=3" conda-build pip ${GET_BOA:-} -c conda-forge @@ -37,8 +38,8 @@ source run_conda_forge_build_setup # make the build number clobber make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" -if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" +if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${HOST_PLATFORM}" != linux-* ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" fi @@ -66,7 +67,7 @@ else ( startgroup "Uploading packages" ) 2> /dev/null - if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" fi diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 244ccd1..0c6515f 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -75,12 +75,15 @@ fi ( startgroup "Start Docker" ) 2> /dev/null export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" +export IS_PR_BUILD="${IS_PR_BUILD:-False}" +docker pull "${DOCKER_IMAGE}" docker run ${DOCKER_RUN_ARGS} \ -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ -e CONFIG \ -e HOST_USER_ID \ -e UPLOAD_PACKAGES \ + -e IS_PR_BUILD \ -e GIT_BRANCH \ -e UPLOAD_ON_BRANCH \ -e CI \ @@ -91,9 +94,9 @@ docker run ${DOCKER_RUN_ARGS} \ -e BINSTAR_TOKEN \ -e FEEDSTOCK_TOKEN \ -e STAGING_BINSTAR_TOKEN \ - $DOCKER_IMAGE \ + "${DOCKER_IMAGE}" \ bash \ - /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh + "/home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh" # verify that the end of the script was reached test -f "$DONE_CANARY" diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 708b1e1..3dca437 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -9,15 +9,17 @@ MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} ( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" -MINIFORGE_FILE="Miniforge3-MacOSX-x86_64.sh" +MINIFORGE_FILE="Miniforge3-MacOSX-$(uname -m).sh" curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" +rm -rf ${MINIFORGE_HOME} bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} ( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null ( startgroup "Configuring conda" ) 2> /dev/null -BUILD_CMD=build +GET_BOA=boa +BUILD_CMD=mambabuild source ${MINIFORGE_HOME}/etc/profile.d/conda.sh conda activate base @@ -66,7 +68,7 @@ validate_recipe_outputs "${FEEDSTOCK_NAME}" ( startgroup "Uploading packages" ) 2> /dev/null -if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then +if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml fi diff --git a/.travis.yml b/.travis.yml index ecb962d..fb73b82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ script: - export CI=travis - export GIT_BRANCH="$TRAVIS_BRANCH" - export FEEDSTOCK_NAME=$(basename ${TRAVIS_REPO_SLUG}) + - if [[ "${TRAVIS_PULL_REQUEST:-}" == "false" ]]; then export IS_PR_BUILD="False"; else export IS_PR_BUILD="True"; fi - - if [[ ${PLATFORM} =~ .*linux.* ]]; then ./.scripts/run_docker_build.sh; fi \ No newline at end of file + - if [[ ${PLATFORM} =~ .*linux.* ]]; then CONDA_FORGE_DOCKER_RUN_ARGS=--network=host ./.scripts/run_docker_build.sh; fi \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index 00eeb34..f3d4f62 100755 --- a/build-locally.py +++ b/build-locally.py @@ -13,6 +13,7 @@ def setup_environment(ns): os.environ["CONFIG"] = ns.config os.environ["UPLOAD_PACKAGES"] = "False" + os.environ["IS_PR_BUILD"] = "True" if ns.debug: os.environ["BUILD_WITH_CONDA_DEBUG"] = "1" if ns.output_id: