Opened 5 years ago

Closed 5 years ago

#60070 closed defect (wontfix)

Ports opportunistically use libmacho and libunwind; fail when architectures don't match

Reported by: TheLastLovemark Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia)
Port: libmacho, libunwind

Description

I tried port -vd install wine -universal and received the prompt to also install its dependencies.

Versions of these ports were already installed without universal variants. The non-universal versions were deactivated by the install process.

$ port installed inactive
The following ports are currently installed:
  gettext @0.19.8.1_2
  libiconv @1.16_0
  m4 @1.4.18_2
  ncurses @6.1_0

The build ended up failing:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... /usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bison/bison/work/bison-3.5.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bison/bison/work/bison-3.5.1" && ./configure --prefix=/opt/local --disable-dependency-tracking --disable-silent-rules ac_cv_prog_HAVE_GCJ_IN_PATH= ac_cv_prog_HAVE_GIJ_IN_PATH= ac_cv_prog_HAVE_JAVA_IN_PATH= ac_cv_prog_HAVE_JAVAC_IN_PATH= ac_cv_prog_HAVE_JIKES_IN_PATH= ac_cv_prog_HAVE_JRE_IN_PATH= ac_cv_prog_HAVE_JVIEW_IN_PATH= ac_cv_prog_VALGRIND= 
Exit code: 77
Error: Failed to configure bison, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bison/bison/work/bison-3.5.1/config.log
Error: Failed to configure bison: configure failure: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: configure failure: command execution failed
    while executing
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bison/bison/main.log for details.
DEBUG: could not read "/opt/local/share/man/man3/textdomain.3.gz": no such file or directory
    while executing
"::file type $file"
DEBUG: upgrade bison failed
    while executing
"macports::_upgrade_mport_deps $mport $target"
    (procedure "mportexec" line 46)
    invoked from within
"mportexec $workername $target"
Error: Unable to execute port: upgrade bison failed

Bison config/main and Wine main log files attached.

Attachments (10)

bison_config.log (36.7 KB) - added by TheLastLovemark 5 years ago.
Bison Config
bison_main.log (16.4 KB) - added by TheLastLovemark 5 years ago.
Bison Main
wine_main.log (11.8 KB) - added by TheLastLovemark 5 years ago.
Wine Main
newBison_config.log (36.7 KB) - added by TheLastLovemark 5 years ago.
newBison_main.log (12.0 KB) - added by TheLastLovemark 5 years ago.
wine-universal_main.log (11.4 KB) - added by TheLastLovemark 5 years ago.
cairo-i386-config.log (213.1 KB) - added by TheLastLovemark 5 years ago.
cairo-x86_64-config.log (193.8 KB) - added by TheLastLovemark 5 years ago.
cairo-main.log (1.9 MB) - added by TheLastLovemark 5 years ago.
wine_main.2.log (209.6 KB) - added by TheLastLovemark 5 years ago.

Change History (18)

Changed 5 years ago by TheLastLovemark

Attachment: bison_config.log added

Bison Config

Changed 5 years ago by TheLastLovemark

Attachment: bison_main.log added

Bison Main

Changed 5 years ago by TheLastLovemark

Attachment: wine_main.log added

Wine Main

comment:1 Changed 5 years ago by jmroot (Joshua Root)

configure:5208: checking whether the C compiler works
configure:5230: /usr/bin/clang -pipe -Os -arch x86_64 -arch i386 -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -arch i386 conftest.c  >&5
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: in '/opt/local/lib/libmacho.dylib', file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libmacho.dylib for architecture i386

comment:2 Changed 5 years ago by kencu (Ken)

so try:

sudo port -f uninstall libmacho
sudo port -v install libmacho +universal

although -- libmacho has a default +universal variant on my system at least, so I'm not sure how it comes to be that you have a non-universal version installed in the first place...

Last edited 5 years ago by kencu (Ken) (previous) (diff)

comment:3 Changed 5 years ago by TheLastLovemark

$ port installed libmacho
The following ports are currently installed:
  libmacho @921_0+universal (active)

Ok.

Ran it again.

# port install wine -universal
--->  Computing dependencies for bison
--->  Fetching archive for bison
--->  Attempting to fetch bison-3.5.1_0+universal.darwin_17.i386-x86_64.tbz2 from https://packages.macports.org/bison
--->  Attempting to fetch bison-3.5.1_0+universal.darwin_17.i386-x86_64.tbz2 from http://aus.us.packages.macports.org/macports/packages/bison
--->  Attempting to fetch bison-3.5.1_0+universal.darwin_17.i386-x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/bison
--->  Fetching distfiles for bison
--->  Verifying checksums for bison
--->  Extracting bison
--->  Applying patches to bison
--->  Configuring bison
Error: Failed to configure bison, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bison/bison/work/bison-3.5.1/config.log
Error: Failed to configure bison: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bison/bison/main.log for details.
Error: Unable to execute port: upgrade bison failed

logs attached

Changed 5 years ago by TheLastLovemark

Attachment: newBison_config.log added

Changed 5 years ago by TheLastLovemark

Attachment: newBison_main.log added

Changed 5 years ago by TheLastLovemark

Attachment: wine-universal_main.log added

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

Cc: jeremyhu added; ryandesign removed
Port: libmacho libunwind added; bison removed
Summary: port install wine -universal fails because of bison build failurePorts opportunistically use libmacho and libunwind; fail when architectures don't match

The wine port is not like other ports. In other ports, building non-universal means building for the CPU's native architecture—e.g. on an x86_64 processor it would build for x86_64. In wine, on the other hand, building non-universal means building for i386, even on an x86_64 processor. See comment:ticket:58025:3 for why it is this way and some solutions we might be able to use in the future.

So when you are asking MacPorts to install wine non-universal on an x86_64 system, the only thing you are accomplishing is that you are preventing yourself from being able to run 64-bit Windows software with it. MacPorts will still need to build wine's dependencies universal. That's why it's building bison universal. And that's failing, with this message from configure:

:info:configure checking whether the C compiler works... no
:info:configure configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bison/bison/work/bison-3.5.1':
:info:configure configure: error: C compiler cannot create executables
:info:configure See `config.log' for more details

And this message in config.log:

configure:5208: checking whether the C compiler works
configure:5230: /usr/bin/clang -pipe -Os -arch x86_64 -arch i386 -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -arch i386 conftest.c  >&5
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: in '/opt/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libunwind.dylib for architecture i386

libunwind is part of the operating system. But apparently we also have a port for it. And you apparently have that port installed. So anything that uses libunwind is going to find the MacPorts copy instead. And it's going to need to have been built for the same architectures, which on your system it's not, just as on your system libmacho, another part of the operating system, had a corresponding port installed shadowing the system version. I do not know why we have there ports or why you have them installed. To solve this, either install the libunwind port with the universal variant, or better yet, uninstall it, along with the libmacho port mentioned previously.

I'm going to un-Cc myself since I am very busy this month and this is not a problem with wine. In my opinion, the problem is that the libmacho and libunwind ports exist, because the only consequence of that seems to be that it enables users to shoot themselves in the foot by installing them.

comment:5 Changed 5 years ago by TheLastLovemark

I made sure MP version of libunwind was installed.

Ran port -vd install wine

Now cairo is the problem.

18 warnings and 9 errors generated.
make[3]: *** [cairo-analysis-surface.lo] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_cairo/cairo/work/cairo-1.16.0-i386/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_cairo/cairo/work/cairo-1.16.0-i386/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_cairo/cairo/work/cairo-1.16.0-i386'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_cairo/cairo/work/cairo-1.16.0-i386'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_cairo/cairo/work/cairo-1.16.0-i386" && /usr/bin/make -j4 -w all 
Exit code: 2
Error: Failed to build cairo: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: command execution failed
    while executing
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_cairo/cairo/main.log for details.
DEBUG: could not read "/opt/local/share/graphite2/graphite2.cmake": no such file or directory
    while executing
"::file type $file"
DEBUG: upgrade gstreamer1 failed
    while executing
"macports::_upgrade_mport_deps $mport $target"
    (procedure "mportexec" line 46)
    invoked from within
"mportexec $workername $target"
Error: Unable to execute port: upgrade gstreamer1 failed

wine main, cairo i386, x86_64 config, and main logs attached.

Changed 5 years ago by TheLastLovemark

Attachment: cairo-i386-config.log added

Changed 5 years ago by TheLastLovemark

Attachment: cairo-x86_64-config.log added

Changed 5 years ago by TheLastLovemark

Attachment: cairo-main.log added

Changed 5 years ago by TheLastLovemark

Attachment: wine_main.2.log added

comment:6 Changed 5 years ago by kencu (Ken)

libmacho is needed for older systems, as the system does not supply a new enough version. I forget just now what uses libunwind, but it's part of the llvm tree with clang and libc++ .

I think we can see that trying to install wine -universal is a big waste of time and effort at present, so my advice is to go with the flow and stop trying to make it work -universal.

comment:7 Changed 5 years ago by TheLastLovemark

@Ken I stopped trying -universal after Ryan's explanation.

comment:8 Changed 5 years ago by kencu (Ken)

Resolution: wontfix
Status: newclosed

The reason libunwind and libmacho were installed as x86_64-only is that the user requested -universal. Both libunwind and libmacho were defaulted to universal variants by Jeremy to avoid this, but you can't overcome a specific override.

There is nothing to fix here in libunwind or libmacho. The root issue is the -universal on wine uniquely means forcing i386 whereas for every other port, it means the native architecture, and so long as this is the case, -universal will never work for the current wine port on 64bit OSs.

Note: See TracTickets for help on using tickets.