From e928e75f2201ba8bbdcd991c9f25d83c942e8ec3 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Tue, 3 May 2022 19:10:09 +0300 Subject: [PATCH 1/3] Fix a duplicate error message on stub plan overrun --- plugins/python-build/test/stubs/stub | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugins/python-build/test/stubs/stub b/plugins/python-build/test/stubs/stub index 5ff72b81..b940bedb 100755 --- a/plugins/python-build/test/stubs/stub +++ b/plugins/python-build/test/stubs/stub @@ -83,15 +83,6 @@ if [ -n "${!_STUB_END}" ]; then # the requested index, we failed. if [ $index -ge "${!_STUB_INDEX}" ]; then eval "${_STUB_RESULT}"=1 - { - echo "index: $index; stub index: ${!_STUB_INDEX}" - echo "plan:" - cat "${!_STUB_PLAN}" - echo "run:" - cat "${!_STUB_RUN}" - echo "log:" - cat "${!_STUB_LOG}" - } >&2 fi if [ "${!_STUB_RESULT}" -ne 0 ]; then { From 65316a7e997dabed97c9ed2daae3e383bd97a45d Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Wed, 9 Feb 2022 18:55:23 +0300 Subject: [PATCH 2/3] Don't use Homebrew outside of MacOS In Linux, it's not the primary source of packages and cannot be used without build flag adjustments thus has caused build failures. --- plugins/python-build/bin/python-build | 12 +- plugins/python-build/test/build.bats | 159 ++++++++++++++--------- plugins/python-build/test/compiler.bats | 8 +- plugins/python-build/test/pyenv_ext.bats | 3 +- 4 files changed, 118 insertions(+), 64 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index cd333a4a..314158f8 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -1322,9 +1322,10 @@ configured_with_package_dir() { } use_homebrew() { + is_mac || return 1 # unless Homebrew is at the default /usr/local, need to add its paths to # compiler search to be able to use non-keg-only deps from there - if command -v brew &>/dev/null; then + if is_mac && command -v brew &>/dev/null; then local brew_prefix="$(brew --prefix 2>/dev/null || true)" # /usr/local/lib:/usr/lib is the default library search path if [[ -n $brew_prefix && $brew_prefix != "/usr" && $brew_prefix != "/usr/local" ]]; then @@ -1340,6 +1341,7 @@ needs_yaml() { } use_homebrew_yaml() { + is_mac || return 1 local libdir="$(brew --prefix libyaml 2>/dev/null || true)" if [ -d "$libdir" ]; then echo "python-build: use libyaml from homebrew" @@ -1383,6 +1385,7 @@ has_broken_mac_readline() { } use_homebrew_readline() { + is_mac || return 1 if ! configured_with_package_dir "python" "readline/rlconf.h"; then local libdir="$(brew --prefix readline 2>/dev/null || true)" if [ -d "$libdir" ]; then @@ -1423,6 +1426,7 @@ has_broken_mac_openssl() { } use_homebrew_openssl() { + is_mac || return 1 command -v brew >/dev/null || return 1 for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do local ssldir="$(brew --prefix "${openssl}" || true)" @@ -1522,6 +1526,7 @@ build_package_verify_openssl() { } use_homebrew_zlib() { + is_mac || return 1 local brew_zlib="$(brew --prefix zlib 2>/dev/null || true)" if [ -d "$brew_zlib" ]; then echo "python-build: use zlib from homebrew" @@ -1541,6 +1546,7 @@ use_xcode_sdk_zlib() { } use_homebrew_tcltk() { + is_mac || return 1 # get the version from the folder that homebrew versions local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)" if [ -d "$tcltk_libdir" ]; then @@ -1598,7 +1604,9 @@ get_tcltk_flag_from() { } use_tcltk() { - local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)" + if is_mac; then + local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)" + fi local tcl_tk_libs="$(get_tcltk_flag_from "$PYTHON_CONFIGURE_OPTS")" # if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk diff --git a/plugins/python-build/test/build.bats b/plugins/python-build/test/build.bats index bcf656c2..e324c02d 100644 --- a/plugins/python-build/test/build.bats +++ b/plugins/python-build/test/build.bats @@ -62,7 +62,7 @@ assert_build_log() { cached_tarball "yaml-0.1.6" cached_tarball "Python-3.6.2" - for i in {1..4}; do stub uname '-s : echo Linux'; done + for i in {1..9}; do stub uname '-s : echo Linux'; done stub brew false stub_make_install stub_make_install @@ -89,7 +89,7 @@ OUT cached_tarball "yaml-0.1.6" cached_tarball "Python-3.6.2" - for i in {1..4}; do stub uname '-s : echo Linux'; done + for i in {1..9}; do stub uname '-s : echo Linux'; done stub brew false stub_make_install stub_make_install @@ -119,15 +119,12 @@ OUT cached_tarball "yaml-0.1.6" cached_tarball "Python-3.6.2" - stub uname '-s : echo Linux' '-s : echo Linux' + for i in {1..9}; do stub uname '-s : echo Linux'; done stub brew false stub_make_install stub_make_install stub patch ' : echo patch "$@" | sed -E "s/\.[[:alnum:]]+$/.XXX/" >> build.log' - # pyenv/pyenv#1026 - stub uname false false - TMPDIR="$TMP" install_fixture --patch definitions/needs-yaml <<<"diff --git a/script.py" assert_success @@ -154,7 +151,7 @@ OUT BREW_PREFIX="$TMP/homebrew-prefix" mkdir -p "$BREW_PREFIX" - for i in {1..4}; do stub uname '-s : echo Darwin'; done + for i in {1..9}; do stub uname '-s : echo Darwin'; done for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done stub brew "--prefix : echo '$BREW_PREFIX'" false stub_make_install @@ -164,8 +161,8 @@ install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2. DEF assert_success - unstub sw_vers unstub uname + unstub sw_vers unstub make assert_build_log <>"$tcl_tk_libdir/lib/tclConfig.sh" - stub uname false + for i in {1..10}; do stub uname '-s : echo Darwin'; done + for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done + stub brew false for i in {1..2}; do stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'"; done for i in {1..2}; do stub brew false; done + stub_make_install run_inline_definition <> build.log' stub_make_install - # yyuu/pyenv#257 - stub uname '-s : echo Linux' - stub uname '-s : echo Linux' - stub uname '-s : echo Linux' - export PYTHON_CONFIGURE="${TMP}/custom-configure" run_inline_definition <> build.log" \ " : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'" @@ -332,7 +332,6 @@ OUT unstub make unstub uname - unstub brew } @test "default MACOSX_DEPLOYMENT_TARGET" { From f03adae58a95753fb18ba66d938eb6fa0b22288c Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Wed, 4 May 2022 03:08:46 +0300 Subject: [PATCH 3/3] Rename CI workflows to what they actually do --- .github/workflows/{macos_tests.yml => macos_build.yml} | 4 ++-- .github/workflows/{ubuntu_tests.yml => ubuntu_build.yml} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{macos_tests.yml => macos_build.yml} (97%) rename .github/workflows/{ubuntu_tests.yml => ubuntu_build.yml} (97%) diff --git a/.github/workflows/macos_tests.yml b/.github/workflows/macos_build.yml similarity index 97% rename from .github/workflows/macos_tests.yml rename to .github/workflows/macos_build.yml index 060af251..243e963e 100644 --- a/.github/workflows/macos_tests.yml +++ b/.github/workflows/macos_build.yml @@ -1,7 +1,7 @@ -name: macos_tests +name: macos_build on: [pull_request, push] jobs: - macos_tests: + macos_build: strategy: fail-fast: false matrix: diff --git a/.github/workflows/ubuntu_tests.yml b/.github/workflows/ubuntu_build.yml similarity index 97% rename from .github/workflows/ubuntu_tests.yml rename to .github/workflows/ubuntu_build.yml index 3c6572f4..dc167482 100644 --- a/.github/workflows/ubuntu_tests.yml +++ b/.github/workflows/ubuntu_build.yml @@ -1,7 +1,7 @@ -name: ubuntu_tests +name: ubuntu_build on: [pull_request, push] jobs: - ubuntu_tests: + ubuntu_build: strategy: fail-fast: false matrix: