Opened 8 years ago

Closed 8 years ago

#51812 closed defect (fixed)

nawk @20121220_0: parallel build can produce broken program

Reported by: larryv (Lawrence Velázquez) Owned by: tobypeterson
Priority: Normal Milestone:
Component: ports Version: 2.3.99
Keywords: haspatch Cc:
Port: nawk

Description

I installed nawk a few hours ago to test an AWK script I’ve been writing, but it was completely nonfunctional.

% cat >/tmp/foo.txt <<EOF
heredoc> a
heredoc> b
heredoc> c
heredoc> EOF
% /opt/local/bin/nawk '{ print $0 }' </tmp/foo.txt
/opt/local/bin/nawk: syntax error at source line 1
 context is
	{ >>>  print <<<  $0 }
/opt/local/bin/nawk: illegal statement at source line 1
%

I rebuilt nawk a few times; several but not all of the builds actually did produce a working program.

% /opt/local/bin/nawk '{ print $0 }' </tmp/foo.txt
a
b
c
%

The attached patch disables parallel builds and seems to circumvent the issue entirely. (It’d be nice to fix the makefile, but the build is so quick that it doesn’t seem worth the effort.) It also revbumps to make sure broken installations are replaced.

Attachments (3)

nawk.j8.log (23.2 KB) - added by larryv (Lawrence Velázquez) 8 years ago.
log of a -j8 build that produced a bad program
nawk.j1.log (23.2 KB) - added by larryv (Lawrence Velázquez) 8 years ago.
log of a -j1 build that produced a good program
Portfile-nawk.diff (479 bytes) - added by larryv (Lawrence Velázquez) 8 years ago.
disable parallel builds and revbump

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by larryv (Lawrence Velázquez)

Attachment: nawk.j8.log added

log of a -j8 build that produced a bad program

Changed 8 years ago by larryv (Lawrence Velázquez)

Attachment: nawk.j1.log added

log of a -j1 build that produced a good program

Changed 8 years ago by larryv (Lawrence Velázquez)

Attachment: Portfile-nawk.diff added

disable parallel builds and revbump

comment:1 Changed 8 years ago by larryv (Lawrence Velázquez)

Some additional information, in case it’s of use.

% sw_vers
ProductName:	Mac OS X
ProductVersion:	10.11.5
BuildVersion:	15F34
% /usr/bin/clang -v
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
%

comment:2 Changed 8 years ago by larryv (Lawrence Velázquez)

Resolution: fixed
Status: newclosed

In da6f71a/macports-ports:

nawk: Disable parallel build

Due to incomplete dependency specifications, the makefile has a race
condition wherein some objects are compiled using the bundled parser
header and others with a newly generated one, successfully producing
a broken program. Pending development and submission of a proper fix,
work around the race condition by disabling parallel builds altogether.

Closes #51812 (timeout).

Note: See TracTickets for help on using tickets.