Opened 12 years ago

Closed 12 years ago

#36828 closed defect (worksforme)

wine-devel: Undefined symbols "_wine_build", referenced from: _wine_get_build_id in config.o

Reported by: asipper10@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: jyrkiwahlstedt
Port: wine-devel

Description

error is

Error: org.macports.destroot for port wine-devel returned: command execution failed
Please see the log file for port wine-devel for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_wine-devel/wine-devel/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port wine-devel failed

the log file is attached

Attachments (3)

main.log (135.6 KB) - added by asipper10@… 12 years ago.
wine-devel log file
main.2.log (3.2 MB) - added by asipper10@… 12 years ago.
main.log after cleaning
version.c (1 bytes) - added by asipper10@… 12 years ago.

Change History (19)

Changed 12 years ago by asipper10@…

Attachment: main.log added

wine-devel log file

comment:1 Changed 12 years ago by asipper10@…

didn't mean to set milestone

comment:2 Changed 12 years ago by mf2k (Frank Schima)

Cc: jwa@… added
Keywords: wine-devel wine fail removed
Milestone: MacPorts Future
Owner: changed from macports-tickets@… to ryandesign@…

In the future, please also Cc the port maintainer(s).

comment:3 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

This log is not from a clean build. Please "sudo port clean wine-devel", then try again, then attach the new main.log if it fails again.

comment:4 Changed 12 years ago by asipper10@…

Sorry

Changed 12 years ago by asipper10@…

Attachment: main.2.log added

main.log after cleaning

comment:5 Changed 12 years ago by asipper10@…

still fails

comment:6 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: Wine-devel fails to installwine-devel: Undefined symbols "_wine_build", referenced from: _wine_get_build_id in config.o

Thanks. So this is interesting.

Here's what my log has happening at the beginning of the destroot:

:info:destroot make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_wine-devel/wine-devel/work/wine-1.5.16/libs/wine'
:info:destroot version=`(GIT_DIR=../../.git git describe HEAD 2>/dev/null || echo "wine-1.5.16") | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $version | cmp -s - version.c) || echo $version >version.c || (rm -f version.c && exit 1)
:info:destroot make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_wine-devel/wine-devel/work/wine-1.5.16/libs/wine'

And then it continues on. Here's what yours says:

:info:destroot make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_wine-devel/wine-devel/work/wine-1.5.16/libs/wine'
:info:destroot version=`(GIT_DIR=../../.git git describe HEAD 2>/dev/null || echo "wine-1.5.16") | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $version | cmp -s - version.c) || echo $version >version.c || (rm -f version.c && exit 1)
:info:destroot /opt/local/bin/gcc-apple-4.2 -m32 -c -I. -I. -I../../include -I../../include  -D__WINESRC__ -DWINE_UNICODE_API="" -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes -Wwrite-strings -fno-omit-frame-pointer -Wpointer-arith -I/opt/local/include/freetype2 -I/opt/local/include   -I/opt/local/include -pipe -O2 -arch i386  -o version.o version.c
:info:destroot /opt/local/bin/gcc-apple-4.2 -m32 -dynamiclib -install_name /opt/local/lib/libwine.1.dylib -compatibility_version 1 -current_version 1.0 -Wl,-headerpad_max_install_names c_037.o c_10000.o c_10006.o c_10007.o c_10029.o c_1006.o c_10079.o c_10081.o c_1026.o c_1250.o c_1251.o c_1252.o c_1253.o c_1254.o c_1255.o c_1256.o c_1257.o c_1258.o c_1361.o c_20127.o c_20866.o c_20932.o c_21866.o c_28591.o c_28592.o c_28593.o c_28594.o c_28595.o c_28596.o c_28597.o c_28598.o c_28599.o c_28600.o c_28603.o c_28604.o c_28605.o c_28606.o c_424.o c_437.o c_500.o c_737.o c_775.o c_850.o c_852.o c_855.o c_856.o c_857.o c_860.o c_861.o c_862.o c_863.o c_864.o c_865.o c_866.o c_869.o c_874.o c_875.o c_878.o c_932.o c_936.o c_949.o c_950.o casemap.o collation.o compose.o config.o cptable.o debug.o fold.o ldt.o loader.o mbtowc.o mmap.o port.o sortkey.o string.o utf8.o wctomb.o wctype.o        version.o ../../libs/port/libwine_port.a   -framework CoreFoundation -L/opt/local/lib -framework CoreServices -lz -Wl,-no_pie -arch i386  -o libwine.1.0.dylib
:info:destroot Undefined symbols for architecture i386:
:info:destroot   "_wine_build", referenced from:
:info:destroot       _wine_get_build_id in config.o
:info:destroot ld: symbol(s) not found for architecture i386
:info:destroot collect2: ld returned 1 exit status
:info:destroot make[1]: *** [libwine.1.0.dylib] Error 1
:info:destroot make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_wine-devel/wine-devel/work/wine-1.5.16/libs/wine'

At which point it has failed.

The line starting with version= is complicated and deserves some analysis. First, it tries to use git to determine the version of code being built. If that fails (for example if the code being built is not from git but from a release tarball, which is the case in MacPorts) then the string "wine-1.5.16" is used. (This string is presumably inserted into the code at the time the release tarball is produced.) The string from the preceding step is then wrapped in a line of C code, which assigns it to the C constant "wine_build". This line of C code is assigned to the shell variable "version". This shell variable is compared with the contents of the file "version.c". If they are not identical, the shell variable is written into the file. If writing the file fails, the file is deleted and the script exits with an error.

In make, a file is automatically rebuilt if any of its dependencies have changed since it was built. version.c is used to build version.o, and version.o is a dependency of libwine. In my log, after running the command that begins with version=, nothing else happens. version.o and libwine are not rebuilt. This is what we would expect, since version.o and libwine have already been built in the build phase, and the version of code has not changed since then. But in your log, version.o is rebuilt, and then it tries to rebuild libwine and fails, saying wine_build is not defined. This tells us that the command that begins with version= did in fact change version.c in your case, thus triggering version.o to rebuild. It also shows that version.c did not get generated correctly this second time.

Could you attach the file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_wine-devel/wine-devel/work/wine-1.5.16/libs/wine/version.c so that we can see what ended up inside it?

Also, could you run the following command and tell us what output, if any, it produces:

echo `(GIT_DIR=../../.git git describe HEAD 2>/dev/null || echo "wine-1.5.16") | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'`

Changed 12 years ago by asipper10@…

Attachment: version.c added

comment:7 Changed 12 years ago by asipper10@…

no output. Also version.c is attached.

comment:8 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

And the version.c file is empty, which is consistent with the above command not producing any output. So now we have to dissect that command to figure out why it didn't produce any output. I might suggest trying these commands; let us know the output:

GIT_DIR=../../.git git describe HEAD; echo $?
GIT_DIR=../../.git git describe HEAD 2>/dev/null || echo "wine-1.5.16"; echo $?
echo hello | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'; echo $?
echo hello | sed -n -e 's/\(.*\)/const char wine_build[] = "\1";/p'; echo $?
which sed
ls -l `which sed`

comment:9 Changed 12 years ago by asipper10@…

I got:

0
0
0
0
/USR/BIN/sed
-rwxr-xr-x  1 root  wheel  38080 Aug 25 19:01 /USR/BIN/sed

comment:10 in reply to:  9 ; Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Thanks. Several odd results here.

The first command should have printed an error; on my system:

$ GIT_DIR=../../.git git describe HEAD; echo $?
fatal: Not a git repository: '../../.git'
128

This should print an error, because I am not in a git checkout at the time that I run it. Are you in a git checkout of some project when you run this? Is your home directory or your entire hard disk a git checkout?

The third and fourth commands should have printed a line of C code; on my system:

$ echo hello | sed -n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'; echo $?
const char wine_build[] = "hello";
0

Yours printed no output, which is strange. Your sed command is the same size as mine which is a good indication it's the same command as mine.

Why does your path have /USR/BIN in capital letters? The directories on disk are in lowercase: /usr/bin. What's your PATH?

echo $PATH

On a case-insensitive filesystem, as Macs have by default and as I assume you have, it shouldn't matter if the case is wrong, but all the same it would help us rule out possibilities if you would set the components of your PATH to have the same case as they do on disk.

comment:11 Changed 12 years ago by asipper10@…

/USR/BIN:/BIN:/USR/SBIN:/SBIN:/USR/LOCAL/BIN:/OPT/X11/BIN:/USR/TEXBINsr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin

I'm using a compiled zsh shell not default bash

comment:12 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, so please fix the PATH so that the case of all paths matches the case of the path on disk, and remove duplicates; and try with bash.

comment:13 Changed 12 years ago by asipper10@…

Bash fails to

comment:14 in reply to:  10 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Ok. What about this:

Replying to ryandesign@…:

Are you in a git checkout of some project when you run this? Is your home directory or your entire hard disk a git checkout?

comment:15 Changed 12 years ago by asipper10@…

Not that I am aware of. I fixed the problem by reinstalling mountain lion.

comment:16 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: worksforme
Status: newclosed

Ok, I'm glad you got it working.

Note: See TracTickets for help on using tickets.