Wine build fails on older versions

Questions about Wine on Linux
Locked
voice
Level 1
Level 1
Posts: 8
Joined: Sat Sep 29, 2012 10:26 am

Wine build fails on older versions

Post by voice »

Hi, am trying to build older versions of wine for regression testing, however build fails with this message:

Code: Select all

make[1]: Entering directory `/media/storage/temp/wine-git-1/tools/wrc'
ccache gcc -m32 -m32 -c -I. -I. -I../../include -I../../include  -D__WINESRC__ -DINCLUDEDIR="\"/usr/local/include/wine\""   -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wstrict-prototypes -Wtype-limits -Wunused-but-set-parameter -Wwrite-strings -fno-omit-frame-pointer -Wpointer-arith -Wlogical-op -I/usr/include/freetype2   -g -O0  -o parser.tab.o parser.tab.c
parser.y: In function ‘rsrcid_to_token’:
parser.y:2841:15: error: ‘YYLEX’ undeclared (first use in this function)
   lookahead = YYLEX;
               ^
parser.y:2841:15: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [parser.tab.o] Error 1
make[1]: Leaving directory `/media/storage/temp/wine-git-1/tools/wrc'
make: *** [tools/wrc] Error 2
Happens to versions before commit 8fcac3b2bb8ce4cdbcffc126df779bf1be168882
Tried downgrading bison to 2.7.1-1 as suggested here (https://bbs.archlinux.org/viewtopic.php?id=167276) but that doesn't have any effect.
I have seen bug #34329 (http://bugs.winehq.org/show_bug.cgi?id=34329)
Using Arch Linux x64.
Exact commands I used:

Code: Select all

git clone git://source.winehq.org/git/wine.git wine-git/
cd wine-git
CC="ccache gcc -m32" CFLAGS="-g -O0" ./configure --verbose --disable-tests
make
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Wine build fails on older versions

Post by oiaohm »

voice make sure the patches listed in that bug are applied. It did not just break new versions of bison it broke older as well. There is a sweet spot without those patches it works.

8fcac3b2bb8ce4cdbcffc126df779bf1be168882 is basically one of the patches that must remain applied. There are 6 in total taht must remain applied.

Basically if you go back before any of the 6 apply them.
voice
Level 1
Level 1
Posts: 8
Joined: Sat Sep 29, 2012 10:26 am

Re: Wine build fails on older versions

Post by voice »

Thanks, I see now. So I have to manually patch sources after checkout'ing older version.

I noticed some versions complain about some of those patches (and some fail to build if patch skipped). How can I know which patches to apply for which version?
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Re: Wine build fails on older versions

Post by oiaohm »

voice there is a way to find out if the patches are applied.
http://unix.stackexchange.com/questions ... ed-already
patch -p0 -N --dry-run --silent < patchfile 2>/dev/null
#If the patch has not been applied then the $? which is the exit status
#for last command would have a success status code = 0
if [ $? -eq 0 ];
then
#apply the patch
patch -p0 -N < patchfile
fi
There will be complaints applying those patches to versions of wine prior to 1.6.0. Things over time have been changed a little.

Its all 6 in the bug that have to be there building with 3.0 works. Most likely exploiting patch dry run functionality to find out if already applied is the simplest way.
voice
Level 1
Level 1
Posts: 8
Joined: Sat Sep 29, 2012 10:26 am

Re: Wine build fails on older versions

Post by voice »

This script should do the trick

Code: Select all

#!/bin/sh

PATCHES=(
3f98185fb8f88c181877e909ab1b6422fb9bca1e
8fcac3b2bb8ce4cdbcffc126df779bf1be168882
bda5a2ffb833b2824325bd9361b30dbaf5f78068
c14e322a92a24e704836c5c12207c694a30e805f
f86c46f6403fe338a544ab134bdf563c5b0934ae
ffbe1ca986bd299e1fc894440849914378adbf5c
)


for i in "${PATCHES[@]}"
do
	# Check if patch file exists in directory
	if [ -f $i ];
	then
		echo "$i file exists"
	else
		echo "$i file doesn't exist, downloading:"
		curl "http://source.winehq.org/git/wine.git/patch/$i" -o $i
	fi

	# Apply patch if necessary
	if nohup patch -p1 -N --dry-run --silent <$i 2>/dev/null; then
		echo "$i Patching now:"
		patch -p1 < $i
	else
		echo "$i Already applied"
	fi

	echo

done
Just put this script in wine git source root and run every time after checkout'ing or bisecting.

Don't forget to chmod +x it!
Locked