Opened 6 years ago

Closed 6 years ago

#55603 closed defect (invalid)

gmp @6.1.2: port install stuck on configure

Reported by: roncli (Ronald M. Clifford) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: gmp

Description

I have just recently upgraded to High Sierra 10.13.2 and XCode 9.2, including command line tools. I've had some problems with a couple of ports, so I just decided to start over. After uninstalling macports per https://guide.macports.org/chunked/installing.macports.uninstalling.html, and repeated attempts at sudo port clean gmp, I'm still unable to get gmp to install. The issue is that it gets stuck on configure:

roncli@DownwardSpiral:~$ port list installed
roncli@DownwardSpiral:~$ sudo port clean gmp
--->  Cleaning gmp
roncli@DownwardSpiral:~$ sudo port install gmp
--->  Fetching distfiles for gmp
--->  Verifying checksums for gmp
--->  Extracting gmp
--->  Applying patches to gmp
--->  Configuring gmp

It will sit here until I ctrl-C to cancel.

Attached are the various logs.

Attachments (9)

main.log (14.9 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
main.log
config.log (5.8 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
config.log
main.2.log (9.5 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
main.2.log
config.2.log (5.8 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
config.2.log
config.3.log (284.3 KB) - added by kencu (Ken) 6 years ago.
gmp config log works
config.4.log.gz (48.9 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
config.4.log.gz
terminal.5.txt (9.1 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
terminal.5.txt
config.5.log (5.8 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
config.5.log
main.5.log (9.5 KB) - added by roncli (Ronald M. Clifford) 6 years ago.
main.5.log

Download all attachments as: .zip

Change History (29)

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: main.log added

main.log

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: config.log added

config.log

comment:1 Changed 6 years ago by roncli (Ronald M. Clifford)

Also, I went into the gmp source directory afterwards and issued a manual sudo ./configure, which worked.

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

Cc: mcalhoun@… removed
Owner: set to MarcusCalhoun-Lopez
Status: newassigned

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

Despite what you posted above, it appears that your build attempt was not a clean build:

150	:debug:main Skipping completed org.macports.archivefetch (gmp)
151	:debug:main Privilege de-escalation not attempted as not running as root.
152	:debug:main Skipping completed org.macports.fetch (gmp)
153	:debug:main Privilege de-escalation not attempted as not running as root.
154	:debug:main Skipping completed org.macports.checksum (gmp)
155	:debug:main Privilege de-escalation not attempted as not running as root.
156	:debug:main Skipping completed org.macports.extract (gmp)
157	:debug:main Privilege de-escalation not attempted as not running as root.
158	:debug:main Skipping completed org.macports.patch (gmp)
159	:debug:main Privilege de-escalation not attempted as not running as root.
160	:debug:configure configure phase started at Thu Dec 28 11:55:35 PST 2017

Notice all the "skipping" lines, in your log.

Partially-completed builds are unstable, and will usually fail if restarted. In fact, MacPorts should probably automatically clean between build attempts -- that's a feature request.

For now, you need to clean manually -- so try sudo port clean gmp and then sudo port -v install gmp to see if it works. It usually will. Please report back if not.

I just rebuilt gmp on a similar system and it worked without issue.

comment:4 Changed 6 years ago by roncli (Ronald M. Clifford)

Similar result. You can see where I'm ctrl-C'ing out after waiting a couple of minutes. I'll attach main and config logs from this attempt.

roncli@DownwardSpiral:~$ sudo port clean gmp
--->  Cleaning gmp
roncli@DownwardSpiral:~$ sudo port -v install gmp
--->  Fetching distfiles for gmp
--->  Verifying checksums for gmp
--->  Checksumming gmp-6.1.2.tar.bz2
--->  Extracting gmp
--->  Extracting gmp-6.1.2.tar.bz2
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gmp/gmp/work" && /usr/bin/bzip2 -dc '/opt/local/var/macports/distfiles/gmp/gmp-6.1.2.tar.bz2' | /usr/bin/tar -xf - 
--->  Applying patches to gmp
--->  Applying patch-Makefile.in.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/gmp/files/patch-Makefile.in.diff'
patching file Makefile.in
--->  Patching gmp-h.in: s|"@CC@"|"/usr/bin/clang"|g
--->  Configuring gmp
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2" && ./configure --prefix=/opt/local --enable-cxx 
^Cchecking build system type... 
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2" && ./configure --prefix=/opt/local --enable-cxx 
Exit code: 1
Error: Aborted: SIGINT received.

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: main.2.log added

main.2.log

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: config.2.log added

config.2.log

Changed 6 years ago by kencu (Ken)

Attachment: config.3.log added

gmp config log works

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

OK. Seems to me your configure is getting stuck identifying your system type. Perhaps a little googling regarding whatever your system type is and gmp might lead to some fixes out there on the web.

No idea at present why it configures when you go in manually and run configure. Maybe you might post that config.log, for interested.

comment:6 Changed 6 years ago by roncli (Ronald M. Clifford)

Google comes up empty for the search: "ivybridge-apple-darwin17.3.0" gmp, just something for gcc46 on homebrew that doesn't even look related to the system type.

Attached is the GZIP'd config.log from the command line:

cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2" && sudo ./configure --prefix=/opt/local --enable-cxx

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: config.4.log.gz added

config.4.log.gz

comment:7 in reply to:  3 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

Partially-completed builds are unstable, and will usually fail if restarted. In fact, MacPorts should probably automatically clean between build attempts -- that's a feature request.

No, resumed builds of most ports won't usually fail. If they did, MacPorts wouldn't have the feature to automatically try to resume an interrupted build. But they can sometimes fail, and it is a good idea to clean and try again before submitting a bug report.

comment:8 in reply to:  5 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

OK. Seems to me your configure is getting stuck identifying your system type.

Not necessarily. Some configure output might be getting cached and might not be getting written to the log. So to see where it's actually getting stuck, please run:

sudo port clean gmp
sudo port -d install gmp

comment:9 Changed 6 years ago by roncli (Ronald M. Clifford)

Before the ctrl-C, it gets stuck, I let it run for ~5 minutes. I'll attach the terminal output, as well as config and main logs again.

Last edited 6 years ago by roncli (Ronald M. Clifford) (previous) (diff)

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: terminal.5.txt added

terminal.5.txt

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: config.5.log added

config.5.log

Changed 6 years ago by roncli (Ronald M. Clifford)

Attachment: main.5.log added

main.5.log

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

weird. some kind of permissions issue? It configures just fine when you run configure manually with sudo, but not when macports runs as the macports user. Don't know how else to explain it.

can you install anything else from source? try sudo port -v -s install the_silver_searcher and see if that installs...

If it was my system, I'd first empty out everything in the build directory. If that didn't work (probably wouldn't) , then I'd totally blow out the macports installation, reboot the system, and start fresh.

Nuke the site from orbit -- only way to be sure.

comment:11 Changed 6 years ago by roncli (Ronald M. Clifford)

I can install a bunch of things from source. The only other issue I have had is with fondu, and I have not started debugging that one yet. Right now, though, everything is nuked and no ports are installed so I can focus on just this one issue for now. The nuke from orbit routine was actually one of the first things I did before bringing the issue here. :) Unfortunately, it didn't help.

Since I've been home, I've started doing some deeper debugging of the issue. It happens when configure calls config.guess. It runs config.guess, and even echos the appropriate system type, "ivybridge-apple-darwin17.3.0".

The specific part in configure that is getting stuck:

test "x$ac_build_alias" = x &&
  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`

It is going as far as running /bin/sh "./config.guess" successfully, but something about this statement is not allowing the script to go further. I'm at a loss as to why this might be.

Last edited 6 years ago by roncli (Ronald M. Clifford) (previous) (diff)

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

but it works when you runs as sudo.

are you sure you can install things from source? unless you did something special, you are just downloading prebuilt binaries. you have to use the -s flag to build from source.

Except gmp, which always builds from source.

comment:13 Changed 6 years ago by roncli (Ronald M. Clifford)

OK I finally found the issue:

roncli@DownwardSpiral:~$ sudo xcodebuild -license check
roncli@DownwardSpiral:~$ sudo -u 'macports' xcodebuild -license check
xcodebuild: error: couldn't create cache file '/var/folders/zy/phns8z2x63xcllcs35bfxrpc0000gp/T/xcrun_db-S1k9spLw' (errno=Permission denied)
^C
roncli@DownwardSpiral:~$ 

The first silently succeeds. The second throws an error and hangs. This was found by going through ps axu. After playing around, I came up with the above reproducible error in the terminal.

Now I know the problem, and probably isn't actually with gmp. However, the solution eludes me. Any ideas?

comment:14 Changed 6 years ago by roncli (Ronald M. Clifford)

AHA. Solution was to remove the temporary folder sudo rm -R /var/folders/zy/phns8z2x63xcllcs35bfxrpc0000gp , then re-accept the xcode license sudo xcodebuild -license . I've got it working. Thanks for your time. :)

roncli@DownwardSpiral:~$ sudo port install gmp
--->  Configuring gmp
--->  Building gmp
--->  Staging gmp into destroot
--->  Installing gmp @6.1.2_1
--->  Activating gmp @6.1.2_1
--->  Cleaning gmp
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.
roncli@DownwardSpiral:~$ 

comment:15 Changed 6 years ago by mf2k (Frank Schima)

Resolution: invalid
Status: assignedclosed

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

I think this happens when clang is run as root (such as during your attempt to run sudo ./configure in the build directory), and then later on, you try to run clang as a non-root user.

clang creates a working folder in /var/folders/IO to hold it's compilation products. It seems to re-use this folder, and if the permissions on that folder get messed up, it gets permissions errors when it tries to use it.

Trying a simple test:

$ clang++ -v -dynamiclib testlib.cpp  -install_name @rpath/libtestlib.dylib -current_version 1.0 -o libtestlib.dylib
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.9/bin
 "/opt/local/libexec/llvm-3.9/bin/clang" -cc1 -triple x86_64-apple-macosx10.6.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name testlib.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/Shared/Downloads/test-meson-libraries-master/src -ferror-limit 19 -fmessage-length 196 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.6.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI/-Tmp-/testlib-a27586.o -x c++ testlib.cpp
clang -cc1 version 3.9.1 based upon LLVM 3.9.1 default target x86_64-apple-darwin10.8.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/libexec/llvm-3.9/bin/../include/c++/v1
 /usr/local/include
 /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/opt/local/libexec/llvm-3.9/bin/ld" -demangle -lto_library /opt/local/libexec/llvm-3.9/lib/libLTO.dylib -dynamic -dylib -dylib_current_version 1.0 -arch x86_64 -dylib_install_name @rpath/libtestlib.dylib -macosx_version_min 10.6.0 -o libtestlib.dylib /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI/-Tmp-/testlib-a27586.o -lc++ -lSystem /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/lib/darwin/libclang_rt.osx.a

this folder is created /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI.

If you change the permissions on that folder to root:

$ sudo chown  -R root:wheel /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI

then it tries to use that same folder over again with the next compile, and no surprise, nothing will build:

$ clang++ -v -dynamiclib testlib.cpp  -install_name @rpath/libtestlib.dylib -current_version 1.0 -o libtestlib.dylib
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.9/bin
clang: error: unable to make temporary file: Permission denied

deleting that folder allows clang to build again, but interestingly it seems to create the exact same temp folder again:

$ clang++ -v -dynamiclib testlib.cpp  -install_name @rpath/libtestlib.dylib -current_version 1.0 -o libtestlib.dylib
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-3.9/bin
 "/opt/local/libexec/llvm-3.9/bin/clang" -cc1 -triple x86_64-apple-macosx10.6.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name testlib.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/Shared/Downloads/test-meson-libraries-master/src -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.6.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI/-Tmp-/testlib-57a7d1.o -x c++ testlib.cpp
clang -cc1 version 3.9.1 based upon LLVM 3.9.1 default target x86_64-apple-darwin10.8.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/libexec/llvm-3.9/bin/../include/c++/v1
 /usr/local/include
 /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/opt/local/libexec/llvm-3.9/bin/ld" -demangle -lto_library /opt/local/libexec/llvm-3.9/lib/libLTO.dylib -dynamic -dylib -dylib_current_version 1.0 -arch x86_64 -dylib_install_name @rpath/libtestlib.dylib -macosx_version_min 10.6.0 -o libtestlib.dylib /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI/-Tmp-/testlib-57a7d1.o -lc++ -lSystem /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.1/lib/darwin/libclang_rt.osx.a

comment:17 Changed 6 years ago by antonvoo

I ran the install in debug mode. It failed with this context in the config.log:

checking for flex... flex checking lex output file root... configure: error: cannot find output from flex; giving up Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2" && ./configure --prefix=/opt/local --enable-cxx Exit code: 1 Error: Failed to configure gmp, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2/config.log Error: Failed to configure gmp: 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_release_tarballs_ports_devel_gmp/gmp/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug. Error: Processing of port gmp failed

comment:18 Changed 6 years ago by antonvoo

Resolution: invalid
Status: closedreopened

I have what appears to be the same issue with gmp: it fails on configure, while manually configure succeeds.

In debug mode I get this in the config.log : checking for flex... flex checking lex output file root... configure: error: cannot find output from flex; giving up Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2" && ./configure --prefix=/opt/local --enable-cxx Exit code: 1 Error: Failed to configure gmp, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gmp/gmp/work/gmp-6.1.2/config.log Error: Failed to configure gmp: 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_release_tarballs_ports_devel_gmp/gmp/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug. Error: Processing of port gmp failed

comment:19 Changed 6 years ago by antonvoo

I was able to solve this by following the migration instructions found at https://trac.macports.org/wiki/Migration#Migrationprocedure .

comment:20 Changed 6 years ago by jmroot (Joshua Root)

Resolution: invalid
Status: reopenedclosed

Doesn't look like comment:17 and following are the same issue. Re-closing.

Note: See TracTickets for help on using tickets.