From 1f016e5dedbb5bc7293c1638e1238989d6fabaa5 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 23 Nov 2022 12:30:01 +0100 Subject: [PATCH] upstream-unittests: Apply RPM workaround for package notes from Ruby Vim adds Ruby LDFLAGS during configuration, which (due Ruby's decision to embed flags from the building time) contains flags from buildsystem environment, especially package notes. This flag expects additional environment variables to be set and they aren't set in normal environment. I've reported it to Vim upstream with PR which removes Ruby LDFLAGS from configure script https://github.com/vim/vim/pull/11592 . --- Sanity/upstream-unittests/runtest.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sanity/upstream-unittests/runtest.sh b/Sanity/upstream-unittests/runtest.sh index 1919bd4..6f22812 100755 --- a/Sanity/upstream-unittests/runtest.sh +++ b/Sanity/upstream-unittests/runtest.sh @@ -70,6 +70,10 @@ rlJournalStart rlRun "RUBY_CFLAGS='`ruby -r rbconfig -e "puts RbConfig::CONFIG['CFLAGS']"`'" 0 "Get ruby CFLAGS" rlRun "export CFLAGS='$RUBY_CFLAGS'" 0 "Set ruby CFLAGS" + # newer redhat-rpm-config brings in packager-notes script, which breaks LDFLAGS we get from Ruby + # we need to set several env variable randomly to get configure working again... + rlRun "RPM_WORKAROUND='RPM_ARCH=\"x86_64\" RPM_PACKAGE_RELEASE=\"1\" RPM_PACKAGE_VERSION=\"1\" RPM_PACKAGE_NAME=\"vim\"'" + # show relevant info & ENV variables rlLog "TEST: $TEST" rlLog "CONFOPT: $CONFOPT" @@ -85,8 +89,8 @@ rlJournalStart rlRun "TERM=$TERM_type" # following block of code is taken from upstream travis.yml - rlRun "su $TESTER -c './configure ${CONFOPT} CFLAGS=\"${CFLAGS} $RUBY_FLAGS\"'" 0 "Configure Vim" - rlRun "su $TESTER -c 'make'" 0 "Build the binary which we substitute" + rlRun "su $TESTER -c './configure ${CONFOPT} CFLAGS=\"${CFLAGS} $RUBY_FLAGS\" $RPM_WORKAROUND'" 0 "Configure Vim" + rlRun "su $TESTER -c '$RPM_WORKAROUND make'" 0 "Build the binary which we substitute" rlRun "su $TESTER -c 'ln -sf /usr/bin/vim src/vim'" 0 "Create symlink to installed vim for testing" rlRun "su $TESTER -c 'make ${TEST} |& tee output'" 0,2 "Run tests (skip builtin terminal errors)" _res_=$?