Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#36303 closed defect (duplicate)

llvm-3.1 compilation hangs on sw_vers -> hack found

Reported by: bobo@… Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Low Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: llvm-3.1

Description

I only post this hoping it might win someone a bit of time.

I'm running a Mountain Lion 10.8.2 with xcode 4.5 and the command line extension installed.

I had to install llvm-3.1 as a dependency of octave. During the compilation, it launches a shell command and hangs forever with no cpu activity.

I find out that the stalled command was:

/bin/sh -c echo `sw_vers -productVersion` | sed -E 's/(10.[0-9]).*/\1/'  

I tested this line in a shell and it returns nothing which is somehow suspicious to me...

Moreover, ps -ef reports one process launched as

 sed -E s/(10.[0-9]).*/\1/

without the quotes nor anything piped into sed (not that I could see at least). Maybe it is waiting for an input... though killing this process did not unstall the build process.

I "simply" hard-coded the two variables DARWIN_VERSION and DARWIN_MAJVERS in the two makefiles Makefile.rules and Makefile.llvm.rules according to my OS and everything compiled smoothly. Sorry I didn't had the time to dig any further on how to correct this problem in a more elegant way.

PS: nor could I found the maintainer to cc this ticket to.

Change History (5)

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

Keywords: sed sw_vers hang stall removed
Owner: changed from macports-tickets@… to jeremyhu@…

Replying to bobo@…:

I find out that the stalled command was:

/bin/sh -c echo `sw_vers -productVersion` | sed -E 's/(10.[0-9]).*/\1/'  

Sounds like #34221. One suggestion in that ticket is to reinstall OS X, since it appears that something may be wrong with your sw_vers command.

PS: nor could I found the maintainer to cc this ticket to.

"port info llvm-3.1" tells you who the maintainer is.

comment:2 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: duplicate
Status: newclosed

Please don't just reinstall without getting me some data first.

When in this state, run 'sudo sysdiagnose sw_vers' and send me the resulting tarball.

comment:3 Changed 12 years ago by gnw3

The line you give won't work unless you escape the space after echo or apply some quotes, so it is possible the sw_vers command is OK.

I copied the text from llvm-3.n.src/Makefile.rules into a trivial Makfile:

  DARWIN_VERSION := `sw_vers -productVersion`
  # Strip a number like 10.4.7 to 10.4
  DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
  # Get "4" out of 10.4 for later pieces in the makefile.
  DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
  
  all:
         echo $(DARWIN_VERSION) and $(DARWIN_MAJVERS)

On Snow Leopard (/usr/bin/make is GNU make 3.81) I get:

$ /usr/bin/make
10.6 and 6
SHELL=/bin/sh  /usr/bin/make
10.6 and 6

Does Mountain Lion use a different make program? Does /bin/sh work in a terminal? Do other simple $(shell xxx) examples work in Makefiles?

comment:4 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Please provide the sysdiagnose tarball to help me see what is going wrong on your system.

comment:5 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Feel free to send it via dropbox

Note: See TracTickets for help on using tickets.