This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 157467 - Big number of source files cause problem of "ar" tool running
Summary: Big number of source files cause problem of "ar" tool running
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Thomas Preisler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-26 23:01 UTC by alexeykryshen
Modified: 2011-04-15 22:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexeykryshen 2009-01-26 23:01:09 UTC
The static library project with 305 source files failed to build at "archiving" stage due to very big command line for
"ar" tool.

The resulting command line ( the "${AR} rv dist/Debug/${PLATFORM}/libfox_d.a ${OBJECTFILES}" command in the generated
makefile after substitution for ${OBJECTFILES} ) is 33.627 characters long and this cause following error:
"make[2]: execvp: ar: Bad file number"

To check if the issue is really in the length of the tool's command line I have copy the complete command line for the
"ar" tool from the Output window to *.bat file and split it into two commands with half of source big command line each.
This batch file works normally and library is created without any errors. This test confirm my suggestion about the
cause of the issue.

Tools used:
The "ar" tool version is 2.19
The "make" tool version is 3.81
The MSYS version is 1.0.11 (MINGW32_NT-5.1 EZH 1.0.11(0.46/3/2) 2009-01-05 22:56 i686 Msys)
Comment 1 Thomas Preisler 2009-01-26 23:05:52 UTC
not sure what we can do.....
Comment 2 alexeykryshen 2009-01-27 11:39:29 UTC
Maybe the "xargs" tool can be useful ? The "build/{CONFIG}" directory can be scanned for the object files (*.o) and
result must be passed to the "xargs" which will run the "ar" tool.
Comment 3 Thomas Preisler 2011-04-15 22:29:29 UTC
I just tried ar from MinGW distro from 20110316 (not sure how to get the specific ar version) and it does weem to work with a large number of libraries. I tried 700 and it worked. Don't know if it has a limit too. I may suggest using a newer MinGW or Cygwin.