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 .
This commit is contained in:
Zdenek Dohnal 2022-11-23 12:30:01 +01:00
commit 1f016e5ded

View file

@ -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_=$?