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 214920 - MacOSX: Smart Build Analyzer doesn't fix project
Summary: MacOSX: Smart Build Analyzer doesn't fix project
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project Discovery (show other bugs)
Version: 7.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on: 259035
Blocks:
  Show dependency tree
 
Reported: 2012-06-28 14:00 UTC by soldatov
Modified: 2016-05-20 10:36 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test project (27.00 KB, application/x-tar)
2012-06-28 14:00 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2012-06-28 14:00:14 UTC
Created attachment 121501 [details]
test project

Scenario:
- Untar the attached project on MacOSX
- Open project in IDE
- Rebuild project
===> Code Assistance is not fixed
Comment 1 Alexander Simon 2012-06-29 08:23:38 UTC
Confirmed.
Preload library is not notified about exec gcc. This is trace:
------------8<------------------
$ gcc
BuildTrace: func1
BuildTrace: execvp called. PATH=/usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2

BuildTrace: TOOLS=gcc
            LOG=/var/tmp/dlight_tester/1d7a43ea/qq.txt

BuildTrace: key = i686-apple-darwin11-llvm-gcc-4.2
BuildTrace: func1
BuildTrace: execve called. PATH=/usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2

BuildTrace: TOOLS=gcc
            LOG=/var/tmp/dlight_tester/1d7a43ea/qq.txt

BuildTrace: key = i686-apple-darwin11-llvm-gcc-4.2
i686-apple-darwin11-llvm-gcc-4.2: no input files
------------8<------------------
I.e. OS resolves links (by own rules) and pass resolver executable in the library.
Example of link resolution:
------------8<------------------
$ type gcc
gcc is hashed (/usr/bin/gcc)
$ ls -la /usr/bin/gcc
lrwxr-xr-x  1 root  wheel  12 Jun 26 19:24 /usr/bin/gcc -> llvm-gcc-4.2
$ ls -la /usr/bin/llvm-gcc-4.2
lrwxr-xr-x  1 root  admin  32 Jun 26 19:24 /usr/bin/llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
$ ls -la /usr/bin/../llvm-gcc-4.2/bin/llvm-gcc-4.2
-rwxrwxr-x  1 root  admin  117152 Jul 27  2011 /usr/bin/../llvm-gcc-4.2/bin/llvm-gcc-4.2
$ file /usr/bin/../llvm-gcc-4.2/bin/llvm-gcc-4.2
/usr/bin/../llvm-gcc-4.2/bin/llvm-gcc-4.2: Mach-O universal binary with 2 architectures
/usr/bin/../llvm-gcc-4.2/bin/llvm-gcc-4.2 (for architecture i386):      Mach-O executable i386
/usr/bin/../llvm-gcc-4.2/bin/llvm-gcc-4.2 (for architecture x86_64):    Mach-O 64-bit executable x86_64
------------8<------------------
So manual link resolution (llvm-gcc-4.2) is not equal OS link resolution (i686-apple-darwin11-llvm-gcc-4.2):
------------8<------------------
$ ls -la /usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2
-rwxrwxr-x  1 root  admin  544448 Jul 27  2011 /usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2
$ file /usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2
/usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2: Mach-O universal binary with 2 architectures
/usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2 (for architecture i386):  Mach-O executable i386
/usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2 (for architecture x86_64):        Mach-O 64-bit executable x86_64
------------8<------------------
Last experiment:
------------8<------------------
$ sh -c gcc
BuildTrace: func1
BuildTrace: execve called. PATH=/usr/bin/gcc

BuildTrace: TOOLS=gcc
            LOG=/var/tmp/dlight_tester/1d7a43ea/qq.txt

BuildTrace: key = gcc

BuildTrace: found gcc

BuildTrace: opened file /var/tmp/dlight_tester/1d7a43ea/qq.txt

BuildTrace: log closed
BuildTrace: func1
BuildTrace: execvp called. PATH=/usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2

BuildTrace: TOOLS=gcc
            LOG=/var/tmp/dlight_tester/1d7a43ea/qq.txt

BuildTrace: key = i686-apple-darwin11-llvm-gcc-4.2
BuildTrace: func1
BuildTrace: execve called. PATH=/usr/bin/../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2

BuildTrace: TOOLS=gcc
            LOG=/var/tmp/dlight_tester/1d7a43ea/qq.txt

BuildTrace: key = i686-apple-darwin11-llvm-gcc-4.2
i686-apple-darwin11-llvm-gcc-4.2: no input files
------------8<------------------
i.e. sh pass gcc to library.
Comment 2 Alexander Simon 2014-05-14 13:56:11 UTC
Is the issue still actual?
IMHO it should be fixed in NB 7.4.
Please verify.
Comment 3 Alexander Simon 2014-05-14 14:25:12 UTC
Still actual
Comment 4 Alexander Simon 2014-05-14 14:33:37 UTC
Work around:
Replace C compiler path
from /usr/bin/gcc
to /usr/llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2
Comment 5 soldatov 2015-12-30 11:22:36 UTC
Same bug in MacOSX 10.11 with default GCC
Comment 6 Vladimir Kvashin 2016-04-27 16:30:03 UTC
There is a related issue #259035 (Implement wrapper technique in discovery in addition to preload/interpose technique)
Comment 7 Alexander Simon 2016-05-20 10:36:52 UTC
IDE uses "tool collection wrapper" technology. See bug #259035